Class ColorPolynomial<C extends RingElem<C>>
java.lang.Object
edu.jas.application.ColorPolynomial<C>
- Type Parameters:
C- coefficient type
- All Implemented Interfaces:
Serializable
Colored Polynomials with green, red and white coefficients. Not implementing
RingElem. Note: not general purpose, use only in comprehensive GB.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal GenPolynomial<GenPolynomial<C>> The part with green (= zero) terms and coefficients.private static final org.apache.logging.log4j.Loggerfinal GenPolynomial<GenPolynomial<C>> The part with red (= non zero) terms and coefficients.final GenPolynomial<GenPolynomial<C>> The part with white (= unknown color) terms and coefficients. -
Constructor Summary
ConstructorsConstructorDescriptionColorPolynomial(GenPolynomial<GenPolynomial<C>> g, GenPolynomial<GenPolynomial<C>> r, GenPolynomial<GenPolynomial<C>> w) The constructor creates a colored polynomial from the colored parts. -
Method Summary
Modifier and TypeMethodDescriptionabs()ColorPolynomial absolute value.booleanCheck ordering invariants.divide(GenPolynomial<C> s) ColorPolynomial division by coefficient.booleanIs this polynomial equal to other.Get essential polynomial.Get zero condition on coefficients.Get full polynomial.Get non zero condition on coefficients.inthashCode()Hash code for this colored polynomial.booleanIs this polynomial determined.booleanisONE()Is this polynomial ONE.booleanisZERO()Is this polynomial ZERO.Get leading exponent vector.Get leading monomial.intlength()Length of red and white parts.multiply(GenPolynomial<C> s) ColorPolynomial multiplication by coefficient.multiply(GenPolynomial<C> s, ExpVector e) ColorPolynomial multiplication by monomial.subtract(ColorPolynomial<C> S) ColorPolynomial subtraction.subtract(GenPolynomial<C> s, ExpVector e) ColorPolynomial subtract.sum(ColorPolynomial<C> S) ColorPolynomial summation.sum(GenPolynomial<C> s, ExpVector e) ColorPolynomial summation.toScript()Script representation of ColorPolynomial.toString()String representation of ColorPolynomial.
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
green
The part with green (= zero) terms and coefficients. -
red
The part with red (= non zero) terms and coefficients. -
white
The part with white (= unknown color) terms and coefficients.
-
-
Constructor Details
-
ColorPolynomial
public ColorPolynomial(GenPolynomial<GenPolynomial<C>> g, GenPolynomial<GenPolynomial<C>> r, GenPolynomial<GenPolynomial<C>> w) The constructor creates a colored polynomial from the colored parts.- Parameters:
g- green colored terms and coefficients.r- red colored terms and coefficients.w- white colored terms and coefficients.
-
-
Method Details
-
toString
-
toScript
-
isZERO
public boolean isZERO()Is this polynomial ZERO.- Returns:
- true, if there are only green terms, else false.
-
isONE
public boolean isONE()Is this polynomial ONE.- Returns:
- true, if the only non green term is 1, else false.
-
equals
-
hashCode
-
isDetermined
public boolean isDetermined()Is this polynomial determined.- Returns:
- true, if there are nonzero red terms or if this == 0, else false.
-
checkInvariant
public boolean checkInvariant()Check ordering invariants. TT(green) > LT(red) and TT(red) > LT(white).- Returns:
- true, if all ordering invariants are met, else false.
-
getGreenCoefficients
Get zero condition on coefficients.- Returns:
- green coefficients.
-
getRedCoefficients
Get non zero condition on coefficients.- Returns:
- red coefficients.
-
getPolynomial
Get full polynomial.- Returns:
- sum of all parts.
-
getEssentialPolynomial
Get essential polynomial.- Returns:
- sum of red and white parts.
-
length
public int length()Length of red and white parts.- Returns:
- length of essential parts.
-
leadingExpVector
-
leadingMonomial
Get leading monomial.- Returns:
- LM of red or white parts.
-
abs
-
sum
ColorPolynomial summation. Note: green coefficients stay green, all others become white.- Parameters:
S- ColorPolynomial.- Returns:
- this+S.
-
sum
ColorPolynomial summation.- Parameters:
s- GenPolynomial.e- exponent vector.- Returns:
- this+(c e).
-
subtract
ColorPolynomial subtraction. Note: green coefficients stay green, all others become white.- Parameters:
S- ColorPolynomial.- Returns:
- this-S.
-
subtract
ColorPolynomial subtract.- Parameters:
s- GenPolynomial.e- exponent vector.- Returns:
- this-(c e).
-
multiply
ColorPolynomial multiplication by monomial.- Parameters:
s- Coefficient.e- Expvector.- Returns:
- this * (c t).
-
multiply
ColorPolynomial multiplication by coefficient.- Parameters:
s- Coefficient.- Returns:
- this * (s).
-
divide
ColorPolynomial division by coefficient.- Parameters:
s- Coefficient.- Returns:
- this / (s).
-