Package maths

Class TMono


  • public class TMono
    extends java.lang.Object
    Represents a monomial in a polynomial.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      TMono coef  
      int deg  
      TMono next  
      java.math.BigInteger val  
      int x  
    • Constructor Summary

      Constructors 
      Constructor Description
      TMono()
      Default constructor.
      TMono​(int x, int val, int deg)
      Constructs a monomial with the specified variable, value, and degree.
      TMono​(int x, java.math.BigInteger val, int deg)
      Constructs a monomial with the specified variable, value, and degree.
      TMono​(int x, TMono coef, int deg)
      Constructs a monomial with the specified variable, coefficient, and degree.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long value()
      Returns the value of the monomial.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • x

        public int x
      • deg

        public int deg
      • val

        public java.math.BigInteger val
      • coef

        public TMono coef
      • next

        public TMono next
    • Constructor Detail

      • TMono

        public TMono()
        Default constructor.
      • TMono

        public TMono​(int x,
                     java.math.BigInteger val,
                     int deg)
        Constructs a monomial with the specified variable, value, and degree.
        Parameters:
        x - the variable
        val - the value
        deg - the degree
      • TMono

        public TMono​(int x,
                     int val,
                     int deg)
        Constructs a monomial with the specified variable, value, and degree.
        Parameters:
        x - the variable
        val - the value
        deg - the degree
      • TMono

        public TMono​(int x,
                     TMono coef,
                     int deg)
        Constructs a monomial with the specified variable, coefficient, and degree.
        Parameters:
        x - the variable
        coef - the coefficient
        deg - the degree
    • Method Detail

      • value

        public long value()
        Returns the value of the monomial.
        Returns:
        the value of the monomial as a long