Package edu.jas.poly
Class GenSolvablePolynomial<C extends RingElem<C>>
- java.lang.Object
-
- edu.jas.poly.GenPolynomial<C>
-
- edu.jas.poly.GenSolvablePolynomial<C>
-
- Type Parameters:
C
- coefficient type
- All Implemented Interfaces:
AbelianGroupElem<GenPolynomial<C>>
,Element<GenPolynomial<C>>
,MonoidElem<GenPolynomial<C>>
,RingElem<GenPolynomial<C>>
,java.io.Serializable
,java.lang.Comparable<GenPolynomial<C>>
,java.lang.Iterable<Monomial<C>>
- Direct Known Subclasses:
LocalSolvablePolynomial
,QLRSolvablePolynomial
,QuotSolvablePolynomial
,RecSolvablePolynomial
,RecSolvableWordPolynomial
,ResidueSolvablePolynomial
,ResidueSolvableWordPolynomial
public class GenSolvablePolynomial<C extends RingElem<C>> extends GenPolynomial<C>
GenSolvablePolynomial generic solvable polynomials implementing RingElem. n-variate ordered solvable polynomials over C. Objects of this class are intended to be immutable. The implementation is based on TreeMap respectively SortedMap from exponents to coefficients by extension of GenPolybomial. Only the coefficients are modeled with generic types, the exponents are fixed to ExpVector with long, int, short entries (@see edu.jas.poly.ExpVector StorUnit).- Author:
- Heinz Kredel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description GenSolvablePolynomialRing<C>
ring
The factory for the solvable polynomial ring.-
Fields inherited from class edu.jas.poly.GenPolynomial
blen, hash, val
-
-
Constructor Summary
Constructors Modifier Constructor Description GenSolvablePolynomial(GenSolvablePolynomialRing<C> r)
Constructor for zero GenSolvablePolynomial.GenSolvablePolynomial(GenSolvablePolynomialRing<C> r, C c)
Constructor for GenSolvablePolynomial.GenSolvablePolynomial(GenSolvablePolynomialRing<C> r, C c, ExpVector e)
Constructor for GenSolvablePolynomial.protected
GenSolvablePolynomial(GenSolvablePolynomialRing<C> r, java.util.SortedMap<ExpVector,C> v)
Constructor for GenSolvablePolynomial.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenSolvablePolynomial<C>
copy()
Clone this GenSolvablePolynomial.GenSolvablePolynomial<C>
divide(GenSolvablePolynomial<C> S)
GenSolvablePolynomial left division.boolean
equals(java.lang.Object B)
Comparison with any other object.GenSolvablePolynomial<C>
evalAsRightRecursivePolynomial()
Evaluate RecSolvablePolynomial as right coefficients polynomial.GenSolvablePolynomialRing<C>
factory()
Get the corresponding element factory.int
hashCode()
Hash code for this polynomial.boolean
isRightRecursivePolynomial(GenSolvablePolynomial<C> R)
Test RecSolvablePolynomial right coefficients polynomial.GenSolvablePolynomial<C>
leftMonic()
GenSolvablePolynomial left monic, i.e. leadingCoefficient == 1.GenSolvablePolynomial<C>
monic()
GenSolvablePolynomial left monic, i.e. leadingCoefficient == 1.GenSolvablePolynomial<C>
multiply(C b)
GenSolvablePolynomial multiplication.GenSolvablePolynomial<C>
multiply(C b, C c)
GenSolvablePolynomial left and right multiplication.GenSolvablePolynomial<C>
multiply(C b, ExpVector e)
GenSolvablePolynomial multiplication.GenSolvablePolynomial<C>
multiply(C b, ExpVector e, C c, ExpVector f)
GenSolvablePolynomial left and right multiplication.GenSolvablePolynomial<C>
multiply(ExpVector e)
GenSolvablePolynomial multiplication.GenSolvablePolynomial<C>
multiply(ExpVector e, ExpVector f)
GenSolvablePolynomial left and right multiplication.GenSolvablePolynomial<C>
multiply(GenSolvablePolynomial<C> Bp)
GenSolvablePolynomial multiplication.GenSolvablePolynomial<C>
multiply(GenSolvablePolynomial<C> S, GenSolvablePolynomial<C> T)
GenSolvablePolynomial left and right multiplication.GenSolvablePolynomial<C>
multiply(java.util.Map.Entry<ExpVector,C> m)
GenSolvablePolynomial multiplication.GenSolvablePolynomial<C>
multiplyLeft(C b)
GenSolvablePolynomial multiplication.GenSolvablePolynomial<C>
multiplyLeft(C b, ExpVector e)
GenSolvablePolynomial multiplication.GenSolvablePolynomial<C>
multiplyLeft(ExpVector e)
GenSolvablePolynomial multiplication.GenSolvablePolynomial<C>
multiplyLeft(java.util.Map.Entry<ExpVector,C> m)
GenSolvablePolynomial multiplication.GenSolvablePolynomial<C>[]
quotientRemainder(GenSolvablePolynomial<C> S)
GenSolvablePolynomial left division with remainder.GenSolvablePolynomial<C>
remainder(GenSolvablePolynomial<C> S)
GenSolvablePolynomial remainder by left division.GenSolvablePolynomial<C>
rightDivide(GenSolvablePolynomial<C> S)
GenSolvablePolynomial right division.GenSolvablePolynomial<C>
rightMonic()
GenSolvablePolynomial right monic, i.e. leadingCoefficient == 1.GenSolvablePolynomial<C>[]
rightQuotientRemainder(GenSolvablePolynomial<C> S)
GenSolvablePolynomial right division with remainder.GenSolvablePolynomial<C>
rightRecursivePolynomial()
RecSolvablePolynomial right coefficients from left coefficients.GenSolvablePolynomial<C>
rightRemainder(GenSolvablePolynomial<C> S)
GenSolvablePolynomial remainder by right division.GenSolvablePolynomial<C>
scaleSubtractMultiple(C b, C a, ExpVector e, GenSolvablePolynomial<C> S)
GenSolvablePolynomial scale and subtract a multiple.GenSolvablePolynomial<C>
scaleSubtractMultiple(C b, C a, GenSolvablePolynomial<C> S)
GenSolvablePolynomial scale and subtract a multiple.GenSolvablePolynomial<C>
scaleSubtractMultiple(C b, ExpVector g, C a, ExpVector e, GenSolvablePolynomial<C> S)
GenSolvablePolynomial scale and subtract a multiple.GenSolvablePolynomial<C>
subtractMultiple(C a, ExpVector e, GenSolvablePolynomial<C> S)
GenSolvablePolynomial subtract a multiple.GenSolvablePolynomial<C>
subtractMultiple(C a, GenSolvablePolynomial<C> S)
GenSolvablePolynomial subtract a multiple.-
Methods inherited from class edu.jas.poly.GenPolynomial
abs, bitLength, coefficient, coefficientIterator, coeffPrimitivePart, compareTo, contract, contractCoeff, degree, degree, degreeMin, degreeVector, deHomogenize, deltaExpVectors, deltaExpVectors, divide, divide, doAddTo, doAddTo, doAddTo, doPutToMap, doPutToMap, doRemoveFromMap, egcd, exponentIterator, extend, extendLower, extendUnivariate, gcd, getMap, hegcd, homogenize, inflate, inverse, isConstant, isHomogeneous, isONE, isUnit, isWeightHomogeneous, isZERO, iterator, leadingBaseCoefficient, leadingExpVector, leadingFacetPolynomial, leadingMonomial, leadingWeightPolynomial, leftDivideCoeff, length, map, mapOnStream, mapOnStream, maxNorm, modInverse, monicRight, multiply, negate, negateAlt, numberOfVariables, quotientRemainder, reductum, remainder, reverse, rightDivideCoeff, rightGcd, scaleSubtractMultiple, scaleSubtractMultiple, scaleSubtractMultiple, signum, spliterator, squareNorm, subtract, subtract, subtract, subtract, subtractMultiple, subtractMultiple, sum, sum, sum, sum, sumNorm, toScript, toScriptFactory, toString, toString, totalDegree, trailingBaseCoefficient, trailingExpVector, weightDegree
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.jas.structure.MonoidElem
leftDivide, leftRemainder, power, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
-
-
-
-
Field Detail
-
ring
public final GenSolvablePolynomialRing<C extends RingElem<C>> ring
The factory for the solvable polynomial ring. Hides super.ring.
-
-
Constructor Detail
-
GenSolvablePolynomial
public GenSolvablePolynomial(GenSolvablePolynomialRing<C> r)
Constructor for zero GenSolvablePolynomial.- Parameters:
r
- solvable polynomial ring factory.
-
GenSolvablePolynomial
public GenSolvablePolynomial(GenSolvablePolynomialRing<C> r, C c, ExpVector e)
Constructor for GenSolvablePolynomial.- Parameters:
r
- solvable polynomial ring factory.c
- coefficient.e
- exponent.
-
GenSolvablePolynomial
public GenSolvablePolynomial(GenSolvablePolynomialRing<C> r, C c)
Constructor for GenSolvablePolynomial.- Parameters:
r
- solvable polynomial ring factory.c
- coefficient.
-
GenSolvablePolynomial
protected GenSolvablePolynomial(GenSolvablePolynomialRing<C> r, java.util.SortedMap<ExpVector,C> v)
Constructor for GenSolvablePolynomial.- Parameters:
r
- solvable polynomial ring factory.v
- the SortedMap of some other (solvable) polynomial.
-
-
Method Detail
-
factory
public GenSolvablePolynomialRing<C> factory()
Get the corresponding element factory.
-
copy
public GenSolvablePolynomial<C> copy()
Clone this GenSolvablePolynomial.
-
equals
public boolean equals(java.lang.Object B)
Comparison with any other object.
-
hashCode
public int hashCode()
Hash code for this polynomial.
-
multiply
public GenSolvablePolynomial<C> multiply(GenSolvablePolynomial<C> Bp)
GenSolvablePolynomial multiplication.- Parameters:
Bp
- GenSolvablePolynomial.- Returns:
- this*Bp, where * denotes solvable multiplication.
-
multiply
public GenSolvablePolynomial<C> multiply(GenSolvablePolynomial<C> S, GenSolvablePolynomial<C> T)
GenSolvablePolynomial left and right multiplication. Product with two polynomials.- Parameters:
S
- GenSolvablePolynomial.T
- GenSolvablePolynomial.- Returns:
- S*this*T.
-
multiply
public GenSolvablePolynomial<C> multiply(C b)
GenSolvablePolynomial multiplication. Product with coefficient ring element.- Overrides:
multiply
in classGenPolynomial<C extends RingElem<C>>
- Parameters:
b
- coefficient.- Returns:
- this*b, where * is coefficient multiplication.
-
multiply
public GenSolvablePolynomial<C> multiply(C b, C c)
GenSolvablePolynomial left and right multiplication. Product with coefficient ring element.- Parameters:
b
- coefficient.c
- coefficient.- Returns:
- b*this*c, where * is coefficient multiplication.
-
multiply
public GenSolvablePolynomial<C> multiply(ExpVector e)
GenSolvablePolynomial multiplication. Product with exponent vector.- Overrides:
multiply
in classGenPolynomial<C extends RingElem<C>>
- Parameters:
e
- exponent.- Returns:
- this * xe, where * denotes solvable multiplication.
-
multiply
public GenSolvablePolynomial<C> multiply(ExpVector e, ExpVector f)
GenSolvablePolynomial left and right multiplication. Product with exponent vector.- Parameters:
e
- exponent.f
- exponent.- Returns:
- xe * this * xf, where * denotes solvable multiplication.
-
multiply
public GenSolvablePolynomial<C> multiply(C b, ExpVector e)
GenSolvablePolynomial multiplication. Product with ring element and exponent vector.- Overrides:
multiply
in classGenPolynomial<C extends RingElem<C>>
- Parameters:
b
- coefficient.e
- exponent.- Returns:
- this * b xe, where * denotes solvable multiplication.
-
multiply
public GenSolvablePolynomial<C> multiply(C b, ExpVector e, C c, ExpVector f)
GenSolvablePolynomial left and right multiplication. Product with ring element and exponent vector.- Parameters:
b
- coefficient.e
- exponent.c
- coefficient.f
- exponent.- Returns:
- b xe * this * c xf, where * denotes solvable multiplication.
-
multiplyLeft
public GenSolvablePolynomial<C> multiplyLeft(C b, ExpVector e)
GenSolvablePolynomial multiplication. Left product with ring element and exponent vector.- Parameters:
b
- coefficient.e
- exponent.- Returns:
- b xe * this, where * denotes solvable multiplication.
-
multiplyLeft
public GenSolvablePolynomial<C> multiplyLeft(ExpVector e)
GenSolvablePolynomial multiplication. Left product with exponent vector.- Parameters:
e
- exponent.- Returns:
- xe * this, where * denotes solvable multiplication.
-
multiplyLeft
public GenSolvablePolynomial<C> multiplyLeft(C b)
GenSolvablePolynomial multiplication. Left product with coefficient ring element.- Overrides:
multiplyLeft
in classGenPolynomial<C extends RingElem<C>>
- Parameters:
b
- coefficient.- Returns:
- b*this, where * is coefficient multiplication.
-
multiplyLeft
public GenSolvablePolynomial<C> multiplyLeft(java.util.Map.Entry<ExpVector,C> m)
GenSolvablePolynomial multiplication. Left product with 'monomial'.- Parameters:
m
- 'monomial'.- Returns:
- m * this, where * denotes solvable multiplication.
-
multiply
public GenSolvablePolynomial<C> multiply(java.util.Map.Entry<ExpVector,C> m)
GenSolvablePolynomial multiplication. Product with 'monomial'.- Overrides:
multiply
in classGenPolynomial<C extends RingElem<C>>
- Parameters:
m
- 'monomial'.- Returns:
- this * m, where * denotes solvable multiplication.
-
subtractMultiple
public GenSolvablePolynomial<C> subtractMultiple(C a, GenSolvablePolynomial<C> S)
GenSolvablePolynomial subtract a multiple.- Parameters:
a
- coefficient.S
- GenSolvablePolynomial.- Returns:
- this - a * S.
-
subtractMultiple
public GenSolvablePolynomial<C> subtractMultiple(C a, ExpVector e, GenSolvablePolynomial<C> S)
GenSolvablePolynomial subtract a multiple.- Parameters:
a
- coefficient.e
- exponent.S
- GenSolvablePolynomial.- Returns:
- this - a * xe * S.
-
scaleSubtractMultiple
public GenSolvablePolynomial<C> scaleSubtractMultiple(C b, C a, GenSolvablePolynomial<C> S)
GenSolvablePolynomial scale and subtract a multiple.- Parameters:
b
- scale factor.a
- coefficient.S
- GenSolvablePolynomial.- Returns:
- b * this - a * S.
-
scaleSubtractMultiple
public GenSolvablePolynomial<C> scaleSubtractMultiple(C b, C a, ExpVector e, GenSolvablePolynomial<C> S)
GenSolvablePolynomial scale and subtract a multiple.- Parameters:
b
- scale factor.a
- coefficient.e
- exponent.S
- GenSolvablePolynomial.- Returns:
- b * this - a * xe * S.
-
scaleSubtractMultiple
public GenSolvablePolynomial<C> scaleSubtractMultiple(C b, ExpVector g, C a, ExpVector e, GenSolvablePolynomial<C> S)
GenSolvablePolynomial scale and subtract a multiple.- Parameters:
b
- scale factor.g
- scale exponent.a
- coefficient.e
- exponent.S
- GenSolvablePolynomial.- Returns:
- a * xg * this - a * xe * S.
-
monic
public GenSolvablePolynomial<C> monic()
GenSolvablePolynomial left monic, i.e. leadingCoefficient == 1. If leadingCoefficient is not invertible returns this abs value.- Overrides:
monic
in classGenPolynomial<C extends RingElem<C>>
- Returns:
- ldcf(this)**(-1) * this.
-
leftMonic
public GenSolvablePolynomial<C> leftMonic()
GenSolvablePolynomial left monic, i.e. leadingCoefficient == 1. If leadingCoefficient is not invertible returns this abs value.- Returns:
- ldcf(this)**(-1) * this.
-
rightMonic
public GenSolvablePolynomial<C> rightMonic()
GenSolvablePolynomial right monic, i.e. leadingCoefficient == 1. If leadingCoefficient is not invertible returns this abs value.- Returns:
- this * ldcf(this)**(-1).
-
divide
public GenSolvablePolynomial<C> divide(GenSolvablePolynomial<C> S)
GenSolvablePolynomial left division. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.- Parameters:
S
- nonzero GenSolvablePolynomial with invertible leading coefficient.- Returns:
- quotient with this = quotient * S + remainder and deg(remainder) < deg(S) or remainder = 0.
- See Also:
PolyUtil.baseSparsePseudoRemainder(edu.jas.poly.GenPolynomial,edu.jas.poly.GenPolynomial)
-
remainder
public GenSolvablePolynomial<C> remainder(GenSolvablePolynomial<C> S)
GenSolvablePolynomial remainder by left division. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.- Parameters:
S
- nonzero GenSolvablePolynomial with invertible leading coefficient.- Returns:
- remainder with this = quotient * S + remainder and deg(remainder) < deg(S) or remainder = 0.
- See Also:
PolyUtil.baseSparsePseudoRemainder(edu.jas.poly.GenPolynomial,edu.jas.poly.GenPolynomial)
-
quotientRemainder
public GenSolvablePolynomial<C>[] quotientRemainder(GenSolvablePolynomial<C> S)
GenSolvablePolynomial left division with remainder. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.- Parameters:
S
- nonzero GenSolvablePolynomial with invertible leading coefficient.- Returns:
- [ quotient , remainder ] with this = quotient * S + remainder and deg(remainder) < deg(S) or remainder = 0.
- See Also:
PolyUtil.baseSparsePseudoRemainder(edu.jas.poly.GenPolynomial,edu.jas.poly.GenPolynomial)
-
rightDivide
public GenSolvablePolynomial<C> rightDivide(GenSolvablePolynomial<C> S)
GenSolvablePolynomial right division. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.- Parameters:
S
- nonzero GenSolvablePolynomial with invertible leading coefficient.- Returns:
- quotient with this = S * quotient + remainder and deg(remainder) < deg(S) or remainder = 0.
- See Also:
PolyUtil.baseSparsePseudoRemainder(edu.jas.poly.GenPolynomial,edu.jas.poly.GenPolynomial)
-
rightRemainder
public GenSolvablePolynomial<C> rightRemainder(GenSolvablePolynomial<C> S)
GenSolvablePolynomial remainder by right division. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.- Parameters:
S
- nonzero GenSolvablePolynomial with invertible leading coefficient.- Returns:
- remainder with this = S * quotient + remainder and deg(remainder) < deg(S) or remainder = 0.
- See Also:
PolyUtil.baseSparsePseudoRemainder(edu.jas.poly.GenPolynomial,edu.jas.poly.GenPolynomial)
-
rightQuotientRemainder
public GenSolvablePolynomial<C>[] rightQuotientRemainder(GenSolvablePolynomial<C> S)
GenSolvablePolynomial right division with remainder. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.- Parameters:
S
- nonzero GenSolvablePolynomial with invertible leading coefficient.- Returns:
- [ quotient , remainder ] with this = S * quotient + remainder and deg(remainder) < deg(S) or remainder = 0.
- See Also:
PolyUtil.baseSparsePseudoRemainder(edu.jas.poly.GenPolynomial,edu.jas.poly.GenPolynomial)
-
rightRecursivePolynomial
public GenSolvablePolynomial<C> rightRecursivePolynomial()
RecSolvablePolynomial right coefficients from left coefficients. Note: R is represented as a polynomial with left coefficients, the implementation can at the moment not distinguish between left and right coefficients.- Returns:
- R = sum( Xi bi ), with P = sum(ai Xi ) and eval(sum(Xi bi)) == sum(ai Xi)
-
evalAsRightRecursivePolynomial
public GenSolvablePolynomial<C> evalAsRightRecursivePolynomial()
Evaluate RecSolvablePolynomial as right coefficients polynomial. Note: R is represented as a polynomial with left coefficients, the implementation can at the moment not distinguish between left and right coefficients.- Returns:
- this as evaluated polynomial R. R = sum( Xi bi ), this = sum(ai Xi ) = eval(sum(Xi bi))
-
isRightRecursivePolynomial
public boolean isRightRecursivePolynomial(GenSolvablePolynomial<C> R)
Test RecSolvablePolynomial right coefficients polynomial. Note: R is represented as a polynomial with left coefficients, the implementation can at the moment not distinguish between left and right coefficients.- Parameters:
R
- GenSolvablePolynomial with right coefficients.- Returns:
- true, if R is polynomial with right coefficients of this. R = sum( Xi bi ), with this = sum(ai Xi ) and eval(sum(Xi bi)) == sum(ai Xi)
-
-