Class GenExteriorPolynomial<C extends RingElem<C>>
java.lang.Object
edu.jas.poly.GenExteriorPolynomial<C>
- Type Parameters:
C- coefficient type
- All Implemented Interfaces:
AbelianGroupElem<GenExteriorPolynomial<C>>, Element<GenExteriorPolynomial<C>>, MonoidElem<GenExteriorPolynomial<C>>, RingElem<GenExteriorPolynomial<C>>, Serializable, Comparable<GenExteriorPolynomial<C>>, Iterable<IndexListMonomial<C>>
public final class GenExteriorPolynomial<C extends RingElem<C>>
extends Object
implements RingElem<GenExteriorPolynomial<C>>, Iterable<IndexListMonomial<C>>
GenExteriorPolynomial generic polynomials implementing RingElem.
Antisymmetric polynomials (in fact vectors) over C. Objects of this class are
intended to be immutable. The implementation is based on TreeMap respectively
SortedMap from index lists to coefficients. Only the coefficients are modeled
with generic types, the "exponents" are fixed to IndexList. C can also be a
non integral domain, e.g. a ModInteger, i.e. it may contain zero divisors,
since multiply() does check for zero coefficients and index lists.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructor for zero GenExteriorPolynomial.Constructor for GenExteriorPolynomial c * x0.Constructor for GenExteriorPolynomial c * xe.Constructor for GenExteriorPolynomial c * xe.Constructor for GenExteriorPolynomial xe.Constructor for GenExteriorPolynomial xe.protectedConstructor for GenExteriorPolynomial.privatePrivate constructor for GenExteriorPolynomial. -
Method Summary
Modifier and TypeMethodDescriptionabs()GenExteriorPolynomial absolute value, i.e.Coefficient.Iterator over coefficients.GenExteriorPolynomial coefficient primitive part.intGenExteriorPolynomial comparison.copy()Copy this GenExteriorPolynomial.longdegree()Index degree.GenExteriorPolynomial division.GenExteriorPolynomial division.voiddoPutToMap(IndexList e, C c) Put a IndexList to coefficient entry into the internal map of this GenExteriorPolynomial.voiddoPutToMap(SortedMap<IndexList, C> vals) Put an a sorted map of index list to coefficients into the internal map of this GenExteriorPolynomial.voiddoRemoveFromMap(IndexList e, C c) Remove a IndexList to coefficient entry from the internal map of this GenExteriorPolynomial.GenExteriorPolynomial extended greatest common divisor.booleanComparison with any other object.factory()Get the corresponding element factory.form(long k) k-form part.GenExteriorPolynomial greatest common divisor.getMap()IndexList to coefficient map of GenExteriorPolynomial.inthashCode()Hash code for this polynomial.homogeneousPart(long tdeg) Homogeneous part.Iterator over index lists.GenExteriorPolynomial interior left multiplication.GenExteriorPolynomial interior right multiplication.inverse()GenExteriorPolynomial inverse.booleanIs GenExteriorPolynomial<C> a constant.booleanIs GenExteriorPolynomial<C> homogeneous.booleanisONE()Is GenExteriorPolynomial<C> one.booleanisUnit()Is GenExteriorPolynomial<C> a unit.booleanisZERO()Is GenExteriorPolynomial<C> zero.iterator()Iterator over monomials.Leading base coefficient.Leading index list.Leading monomial.intlength()Length of GenExteriorPolynomial.map(UnaryFunctor<? super C, C> f) Map a unary function to the coefficients.longIndex maximal degree.maxNorm()GenExteriorPolynomial maximum norm.monic()GenExteriorPolynomial monic, i.e.GenExteriorPolynomial multiplication.GenExteriorPolynomial multiplication.GenExteriorPolynomial multiplication.GenExteriorPolynomial left and right multiplication.GenExteriorPolynomial left and right multiplication.GenExteriorPolynomial multiplication.GenExteriorPolynomial left and right multiplication.GenExteriorPolynomial multiplication.GenExteriorPolynomial left and right multiplication.GenExteriorPolynomial multiplication.negate()GenExteriorPolynomial negation.intNumber of variables.GenExteriorPolynomial division with remainder.reductum()Reductum.GenExteriorPolynomial remainder.shiftIndex(int s) GenExteriorPolynomial shift index.intsignum()GenExteriorPolynomial signum.GenExteriorPolynomial subtract.GenExteriorPolynomial subtraction.GenExteriorPolynomial subtraction.GenExteriorPolynomial addition.GenExteriorPolynomial addition.GenExteriorPolynomial summation.sumNorm()GenExteriorPolynomial sum norm.toScript()Get a scripting compatible string representation.Get a scripting compatible string representation of the factory.toString()String representation of GenExteriorPolynomial.Trailing base coefficient.Trailing index list.Methods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface MonoidElem
leftDivide, leftRemainder, power, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
-
Field Details
-
ring
The factory for the polynomial ring. -
val
-
logger
private static final org.apache.logging.log4j.Logger logger -
debug
private static final boolean debug
-
-
Constructor Details
-
GenExteriorPolynomial
Private constructor for GenExteriorPolynomial.- Parameters:
r- polynomial ring factory.t- TreeMap with correct ordering.
-
GenExteriorPolynomial
Constructor for zero GenExteriorPolynomial.- Parameters:
r- polynomial ring factory.
-
GenExteriorPolynomial
Constructor for GenExteriorPolynomial c * xe.- Parameters:
r- polynomial ring factory.c- coefficient.e- word.
-
GenExteriorPolynomial
Constructor for GenExteriorPolynomial c * x0.- Parameters:
r- polynomial ring factory.c- coefficient.
-
GenExteriorPolynomial
Constructor for GenExteriorPolynomial xe.- Parameters:
r- polynomial ring factory.e- index list.
-
GenExteriorPolynomial
Constructor for GenExteriorPolynomial xe.- Parameters:
r- polynomial ring factory.e- exponent vector.
-
GenExteriorPolynomial
Constructor for GenExteriorPolynomial c * xe.- Parameters:
r- polynomial ring factory.c- coefficient.e- exponent vector.
-
GenExteriorPolynomial
Constructor for GenExteriorPolynomial.- Parameters:
r- polynomial ring factory.v- the SortedMap of some other polynomial.
-
-
Method Details
-
factory
-
copy
-
length
public int length()Length of GenExteriorPolynomial.- Returns:
- number of coefficients of this GenExteriorPolynomial.
-
getMap
-
doPutToMap
Put a IndexList to coefficient entry into the internal map of this GenExteriorPolynomial. Note: Do not use this method unless you are constructing a new polynomial. this is modified and breaks the immutability promise of this class.- Parameters:
e- index list.c- coefficient.
-
doRemoveFromMap
Remove a IndexList to coefficient entry from the internal map of this GenExteriorPolynomial. Note: Do not use this method unless you are constructing a new polynomial. this is modified and breaks the immutability promise of this class.- Parameters:
e- IndexList.c- expected coefficient, null for ignore.
-
doPutToMap
Put an a sorted map of index list to coefficients into the internal map of this GenExteriorPolynomial. Note: Do not use this method unless you are constructing a new polynomial. this is modified and breaks the immutability promise of this class.- Parameters:
vals- sorted map of index list and coefficients.
-
toString
-
toScript
-
toScriptFactory
-
isZERO
public boolean isZERO()Is GenExteriorPolynomial<C> zero.- Specified by:
isZEROin interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- If this is 0 then true is returned, else false.
- See Also:
-
isONE
public boolean isONE()Is GenExteriorPolynomial<C> one.- Specified by:
isONEin interfaceMonoidElem<C extends RingElem<C>>- Returns:
- If this is 1 then true is returned, else false.
- See Also:
-
isUnit
public boolean isUnit()Is GenExteriorPolynomial<C> a unit.- Specified by:
isUnitin interfaceMonoidElem<C extends RingElem<C>>- Returns:
- If this is a unit then true is returned, else false.
- See Also:
-
isConstant
public boolean isConstant()Is GenExteriorPolynomial<C> a constant.- Returns:
- If this is a constant polynomial then true is returned, else false.
-
isHomogeneous
public boolean isHomogeneous()Is GenExteriorPolynomial<C> homogeneous.- Returns:
- true, if this is homogeneous, else false.
-
form
k-form part.- Parameters:
k- requested k-form part.- Returns:
- k-form part of given degree of this.
-
homogeneousPart
Homogeneous part.- Parameters:
tdeg- requested degree of part.- Returns:
- polynomial part of given degree.
-
equals
-
hashCode
-
compareTo
-
signum
public int signum()GenExteriorPolynomial signum.- Specified by:
signumin interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- sign(ldcf(this)).
-
numberOfVariables
public int numberOfVariables()Number of variables.- Returns:
- ring.ixfac.length().
-
leadingMonomial
-
leadingIndexList
-
trailingIndexList
-
leadingBaseCoefficient
-
trailingBaseCoefficient
Trailing base coefficient.- Returns:
- coefficient of constant term.
-
coefficient
-
reductum
-
degree
public long degree()Index degree.- Returns:
- maximal length of indexes.
-
maxDegree
public long maxDegree()Index maximal degree.- Returns:
- maximal degree of indexes.
-
maxNorm
-
sumNorm
GenExteriorPolynomial sum norm.- Returns:
- sum of all absolute values of coefficients.
-
sum
GenExteriorPolynomial summation.- Specified by:
sumin interfaceAbelianGroupElem<C extends RingElem<C>>- Parameters:
S- GenExteriorPolynomial.- Returns:
- this+S.
-
sum
GenExteriorPolynomial addition. This method is not very efficient, since this is copied.- Parameters:
a- coefficient.e- index list.- Returns:
- this + a e.
-
sum
GenExteriorPolynomial addition. This method is not very efficient, since this is copied.- Parameters:
a- coefficient.- Returns:
- this + a x0.
-
subtract
GenExteriorPolynomial subtraction.- Specified by:
subtractin interfaceAbelianGroupElem<C extends RingElem<C>>- Parameters:
S- GenExteriorPolynomial.- Returns:
- this-S.
-
subtract
GenExteriorPolynomial subtraction. This method is not very efficient, since this is copied.- Parameters:
a- coefficient.e- index list.- Returns:
- this - a e.
-
subtract
GenExteriorPolynomial subtract. This method is not very efficient, since this is copied.- Parameters:
a- coefficient.- Returns:
- this + a x0.
-
negate
GenExteriorPolynomial negation.- Specified by:
negatein interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- -this.
-
abs
GenExteriorPolynomial absolute value, i.e. leadingCoefficient > 0.- Specified by:
absin interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- abs(this).
-
multiply
GenExteriorPolynomial multiplication.- Specified by:
multiplyin interfaceMonoidElem<C extends RingElem<C>>- Parameters:
S- GenExteriorPolynomial.- Returns:
- this /\\ S.
-
interiorLeftProduct
GenExteriorPolynomial interior left multiplication.- Parameters:
S- GenExteriorPolynomial.- Returns:
- this _| S.
-
interiorRightProduct
GenExteriorPolynomial interior right multiplication.- Parameters:
S- GenExteriorPolynomial.- Returns:
- this |_ S.
-
multiply
GenExteriorPolynomial left and right multiplication. Product with two polynomials.- Parameters:
S- GenExteriorPolynomial.T- GenExteriorPolynomial.- Returns:
- S*this*T.
-
multiply
GenExteriorPolynomial multiplication. Product with coefficient ring element.- Parameters:
s- coefficient.- Returns:
- this*s.
-
multiply
GenExteriorPolynomial multiplication. Product with coefficient ring element.- Parameters:
s- coefficient.t- coefficient.- Returns:
- s*this*t.
-
monic
GenExteriorPolynomial monic, i.e. leadingCoefficient == 1. If leadingCoefficient is not invertible returns this unmodified.- Returns:
- monic(this).
-
multiply
GenExteriorPolynomial multiplication. Product with ring element and index list.- Parameters:
s- coefficient.e- left index list.- Returns:
- this * s e.
-
multiply
GenExteriorPolynomial left and right multiplication. Product with ring element and two index lists.- Parameters:
e- left index list.f- right index list.- Returns:
- e * this * f.
-
multiply
GenExteriorPolynomial left and right multiplication. Product with ring element and two index lists.- Parameters:
s- coefficient.e- left index list.f- right index list.- Returns:
- e * this * s * f.
-
multiply
-
multiply
GenExteriorPolynomial multiplication. Product with index list.- Parameters:
e- index list (!= null).- Returns:
- this * e.
-
multiply
GenExteriorPolynomial multiplication. Product with 'monomial'.- Parameters:
m- 'monomial'.- Returns:
- this * m.
-
divide
GenExteriorPolynomial division. Division by coefficient ring element. Fails, if exact division is not possible.- Parameters:
s- coefficient.- Returns:
- this/s.
-
coeffPrimitivePart
GenExteriorPolynomial coefficient primitive part. Division by gcd of coefficients.- Returns:
- this/gcd(coeff(this)).
-
quotientRemainder
GenExteriorPolynomial 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.- Specified by:
quotientRemainderin interfaceMonoidElem<C extends RingElem<C>>- Parameters:
S- nonzero GenExteriorPolynomial with invertible leading coefficient.- Returns:
- [ quotient , remainder ] with this = quotient * S + remainder and deg(remainder) < deg(S) or remainder = 0.
- See Also:
-
divide
GenExteriorPolynomial division. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.- Specified by:
dividein interfaceMonoidElem<C extends RingElem<C>>- Parameters:
S- nonzero GenExteriorPolynomial with invertible leading coefficient.- Returns:
- quotient with this = quotient * S + remainder.
- See Also:
-
remainder
GenExteriorPolynomial remainder. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.- Specified by:
remainderin interfaceMonoidElem<C extends RingElem<C>>- Parameters:
S- nonzero GenExteriorPolynomial with invertible leading coefficient.- Returns:
- remainder with this = quotient * S + remainder.
- See Also:
-
gcd
GenExteriorPolynomial greatest common divisor. Note: not implemented. -
egcd
GenExteriorPolynomial extended greatest common divisor. Note: not implemented. -
inverse
GenExteriorPolynomial inverse. Required by RingElem. Throws not invertible exception.- Specified by:
inversein interfaceMonoidElem<C extends RingElem<C>>- Returns:
- x with this * x = 1, if it exists.
-
shiftIndex
GenExteriorPolynomial shift index. Add number to each index.- Parameters:
s- shift index by this number.- Returns:
- this.shift(s).
-
coefficientIterator
-
indexListIterator
-
iterator
-
map
Map a unary function to the coefficients.- Parameters:
f- evaluation functor.- Returns:
- new polynomial with coefficients f(this(e)).
-