Class NTConstant

All Implemented Interfaces:
Constant, Monomial, RationalExpression, NumericExpression, SymbolicExpression, SymbolicObject

public class NTConstant extends HomogeneousExpression<SymbolicObject> implements Constant
A constant which is not 1.
  • Method Details

    • value

      public NumberObject value()
      Description copied from interface: Constant
      Returns the NumberObject wrapped by this Constant.
      Specified by:
      value in interface Constant
      Returns:
      the underlying NumberObject
    • number

      public Number number()
      Description copied from interface: Constant
      Returns the underlying Number wrapped by this Constant. Convenience method, equivalent to value().getNumber().
      Specified by:
      number in interface Constant
      Returns:
      value().getNumber()
    • isZero

      public boolean isZero()
      Description copied from class: HomogeneousExpression
      Returns false, since this will be overridden in NumericExpression.
      Specified by:
      isZero in interface SymbolicExpression
      Overrides:
      isZero in class HomogeneousExpression<SymbolicObject>
      Returns:
      true iff this is the integer 0 or the real 0
    • isOne

      public boolean isOne()
      Description copied from class: HomogeneousExpression
      Returns false, since this will be overridden in NumericExpression.
      Specified by:
      isOne in interface SymbolicExpression
      Overrides:
      isOne in class HomogeneousExpression<SymbolicObject>
      Returns:
      true iff this is the integer 1 or the real 1
    • monomialConstant

      public Constant monomialConstant(IdealFactory factory)
      Description copied from interface: Monomial
      Returns the constant factor of this monomial.
      Specified by:
      monomialConstant in interface Monomial
      Parameters:
      factory - the ideal factory responsible for this monomial
      Returns:
      the constant factor of this monomial
    • monic

      public Monic monic(IdealFactory factory)
      Description copied from interface: Monomial
      Returns the monic factor of this monomial.
      Specified by:
      monic in interface Monomial
      Parameters:
      factory - the ideal factory responsible for this monomial
      Returns:
      the monic factor of this monomial
    • numerator

      public Monomial numerator(IdealFactory factory)
      Description copied from interface: RationalExpression
      Returns the numerator of this rational expression
      Specified by:
      numerator in interface RationalExpression
      Parameters:
      factory - the ideal factory responsible for this expression
      Returns:
      the numerator of this rational expression
    • denominator

      public Monomial denominator(IdealFactory factory)
      Description copied from interface: RationalExpression
      Returns the denominator of this rational expression.
      Specified by:
      denominator in interface RationalExpression
      Parameters:
      factory - the ideal factory responsible for this expression
      Returns:
      the denominator of this rational expression
    • termMap

      public Monomial[] termMap(IdealFactory factory)
      Description copied from interface: Monomial
      Returns the term map of this monomial.
      Specified by:
      termMap in interface Monomial
      Parameters:
      factory - the ideal factory responsible for this monomial
      Returns:
      a term map whose sum is equivalent to this monomial
      See Also:
    • monomialDegree

      public IntegerNumber monomialDegree(NumberFactory factory)
      Description copied from interface: Monomial
      Returns the degree of the monic where each factor is considered to have degree 1. For example, (X^2+Y^2)^3*Z^2 has monomial degree 5: it has two factors, one of degree 3 and one of degree 2.
      Specified by:
      monomialDegree in interface Monomial
      Parameters:
      factory - the NumberFactory used for this operation
      Returns:
      The IntegerNumber represents the monomial degree with NO expansion
    • expand

      public Monomial[] expand(IdealFactory factory)
      Description copied from interface: Monomial
      Returns the expansion of this monomial.
      Specified by:
      expand in interface Monomial
      Parameters:
      factory - the ideal factory responsible for this monomial
      Returns:
      term map whose sum is equivalent to this but with no Polynomials.
      See Also:
    • totalDegree

      public IntegerNumber totalDegree(NumberFactory factory)
      Description copied from interface: Monomial
      The degree of this monomial if it were fully expanded to a polynomial in which the variables cannot be expressed as the sum, product, difference, or quotient of expressions. For example, (X^2+Y^2)^3*Z^2 has total degree 8.
      Specified by:
      totalDegree in interface Monomial
      Parameters:
      factory - the NumberFactory used for this operation
      Returns:
      The IntegerNumber represents total degree of this monomial after full expansion to a polynomial
    • hasNontrivialExpansion

      public boolean hasNontrivialExpansion(IdealFactory factory)
      Description copied from interface: Monomial
      Determines whether or not this monomial could possibly have a non-trivial expansion. A trivial expansion is one consisting of exactly one term.
      Specified by:
      hasNontrivialExpansion in interface Monomial
      Parameters:
      factory - the ideal factory responsible for this monomial
      Returns:
      if false is returned then this monomial has only a trivial expansion, otherwise is might have a nontrivial one
    • monomialOrder

      public int monomialOrder(IdealFactory factory)
      Description copied from interface: Monomial
      Computes the "monomial order" of this Monomial. This is defined as follows:

      Another interpretation: consider this symbolic expressions as a rooted tree. Along any path from the root to a leaf, count the number of "+" (addition) operators to occur. (Note that each Polynomial introduces a single addition operator whose argument is a set of terms.) The maximum plus-count (over all paths) is the monomial order.

      Specified by:
      monomialOrder in interface Monomial
      Parameters:
      factory - the IdealFactory responsible for this Monomial
      Returns:
      the monomial order of this Monomial
    • lower

      public Monomial[] lower(IdealFactory factory)
      Description copied from interface: Monomial

      Computes a term map from performing a single outer-level expansion. This is in contrast with Monomial.expand(IdealFactory), which performs a full expansion.

      Suppose the monomial order of this Monomial is d. Then the Monomials occurring in the returned map will have monomial order at most d-1. Furthermore, if this is a Polynomial, the Monomials occurring in the returned map will have monomial order at most d-2 (assuming d>=2).

      Specified by:
      lower in interface Monomial
      Parameters:
      factory - the IdealFactory responsible for this Monomial
      Returns:
      a term map with lower monomial order.
    • powerRational

      public RationalExpression powerRational(IdealFactory factory, RationalExpression exponent)
      Description copied from interface: RationalExpression

      Computes an expression equivalent to raising this expression to the exponent power.

      Preconditions:

      • if the monomial constant of the numerator of exponent is an integer (including a real integer), it is 1
      • if this has integer type then exponent has integer type

      Specified by:
      powerRational in interface RationalExpression
      Parameters:
      factory - the ideal factory responsible for this expression
      exponent - the power to which this expression should be raised
      Returns:
      an expression equivalent to raising this expression to the exponent power
    • powerInt

      public Constant powerInt(IdealFactory factory, IntegerNumber n)
      Description copied from interface: RationalExpression
      Computes an expression equivalent to raising this expression to the exponent power. In this case the exponent is an IntegerNumber.
      Specified by:
      powerInt in interface Constant
      Specified by:
      powerInt in interface Monomial
      Specified by:
      powerInt in interface RationalExpression
      Parameters:
      factory - the ideal factory responsible for this expression
      n - the power to which this expression should be raised, must be positive
      Returns:
      an expression equivalent to raising this expression to the exponent power
    • maxDegreeOf

      public IntegerNumber maxDegreeOf(NumberFactory factory, Primitive primitive)
      Description copied from interface: Monomial
      Computes the maximum degree to which primitive occurs in this Monomial. For example the primitive X occurs with max degree 11 in XY(X+Z)^10.
      Specified by:
      maxDegreeOf in interface Monomial
      Parameters:
      factory - the NumberFactory used for this operation
      primitive - the Primitive which must have same type as this; it is possible the primitive does not occur at all in this, in which case the result is 0
      Returns:
      The IntegerNumber represents the maximum degree to which primitive occurs in this
    • getTruePrimitives

      public Set<Primitive> getTruePrimitives()
      Description copied from interface: Monomial
      Returns the Primitives which are not Polynomials occurring in this Monomial. These are essentially the "variables" occurring in the polynomial expression.
      Specified by:
      getTruePrimitives in interface Monomial
      Returns:
      the set of primitives that are not polynomials occurring herein