|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.jas.poly.GenPolynomial<C>
C
- coefficient typepublic class GenPolynomial<C extends RingElem<C>>
GenPolynomial generic polynomials implementing RingElem. n-variate ordered polynomials over C. Objects of this class are intended to be immutable. The implementation is based on TreeMap respectively SortedMap from exponents to coefficients. Only the coefficients are modeled with generic types, the exponents are fixed to ExpVector with long entries (this will eventually be changed in the future). C can also be a non integral domain, e.g. a ModInteger, i.e. it may contain zero divisors, since multiply() does now check for zeros. Note: multiply() now checks for wrong method dispatch for GenSolvablePolynomial.
Field Summary | |
---|---|
GenPolynomialRing<C> |
ring
The factory for the polynomial ring. |
protected java.util.SortedMap<ExpVector,C> |
val
The data structure for polynomials. |
Constructor Summary | |
---|---|
|
GenPolynomial(GenPolynomialRing<C> r)
Constructor for zero GenPolynomial. |
|
GenPolynomial(GenPolynomialRing<C> r,
C c)
Constructor for GenPolynomial c * x0. |
|
GenPolynomial(GenPolynomialRing<C> r,
C c,
ExpVector e)
Constructor for GenPolynomial c * xe. |
protected |
GenPolynomial(GenPolynomialRing<C> r,
java.util.SortedMap<ExpVector,C> v)
Constructor for GenPolynomial. |
Method Summary | |
---|---|
GenPolynomial<C> |
abs()
GenPolynomial absolute value, i.e. leadingCoefficient > 0. |
GenPolynomial<C> |
clone()
Clone this GenPolynomial. |
C |
coefficient(ExpVector e)
Coefficient. |
java.util.Iterator<C> |
coefficientIterator()
Iterator over coefficients. |
int |
compareTo(GenPolynomial<C> b)
GenPolynomial comparison. |
java.util.Map<ExpVector,GenPolynomial<C>> |
contract(GenPolynomialRing<C> pfac)
Contract variables. |
GenPolynomial<C> |
contractCoeff(GenPolynomialRing<C> pfac)
Contract variables to coefficient polynomial. |
long |
degree()
Maximal degree. |
long |
degree(int i)
Degree in variable i. |
ExpVector |
degreeVector()
Maximal degree vector. |
GenPolynomial<C> |
divide(C s)
GenPolynomial division. |
GenPolynomial<C> |
divide(GenPolynomial<C> S)
GenPolynomial division. |
GenPolynomial<C>[] |
divideAndRemainder(GenPolynomial<C> S)
Deprecated. use quotientRemainder() |
void |
doPutToMap(ExpVector e,
C c)
Put an ExpVector to coefficient entry into the internal map of this GenPolynomial. |
void |
doPutToMap(java.util.SortedMap<ExpVector,C> vals)
Put an a sorted map of exponents to coefficients into the internal map of this GenPolynomial. |
GenPolynomial<C>[] |
egcd(GenPolynomial<C> S)
GenPolynomial extended greatest comon divisor. |
boolean |
equals(java.lang.Object B)
Comparison with any other object. |
java.util.Iterator<ExpVector> |
exponentIterator()
Iterator over exponents. |
GenPolynomial<C> |
extend(GenPolynomialRing<C> pfac,
int j,
long k)
Extend variables. |
GenPolynomial<C> |
extendLower(GenPolynomialRing<C> pfac,
int j,
long k)
Extend lower variables. |
GenPolynomial<C> |
extendUnivariate(GenPolynomialRing<C> pfac,
int i)
Extend univariate to multivariate polynomial. |
GenPolynomialRing<C> |
factory()
Get the corresponding element factory. |
GenPolynomial<C> |
gcd(GenPolynomial<C> S)
GenPolynomial greatest common divisor. |
java.util.SortedMap<ExpVector,C> |
getMap()
ExpVector to coefficient map of GenPolynomial. |
int |
hashCode()
Hash code for this polynomial. |
GenPolynomial<C>[] |
hegcd(GenPolynomial<C> S)
GenPolynomial half extended greatest comon divisor. |
GenPolynomial<C> |
inverse()
GenPolynomial inverse. |
boolean |
isConstant()
Is GenPolynomial<C> a constant. |
boolean |
isONE()
Is GenPolynomial<C> one. |
boolean |
isUnit()
Is GenPolynomial<C> a unit. |
boolean |
isZERO()
Is GenPolynomial<C> zero. |
java.util.Iterator<Monomial<C>> |
iterator()
Iterator over monomials. |
C |
leadingBaseCoefficient()
Leading base coefficient. |
ExpVector |
leadingExpVector()
Leading exponent vector. |
java.util.Map.Entry<ExpVector,C> |
leadingMonomial()
Leading monomial. |
int |
length()
Length of GenPolynomial. |
GenPolynomial<C> |
map(UnaryFunctor<? super C,C> f)
Map a unary function to the coefficients. |
C |
maxNorm()
GenPolynomial maximum norm. |
GenPolynomial<C> |
modInverse(GenPolynomial<C> m)
GenPolynomial modular inverse. |
GenPolynomial<C> |
monic()
GenPolynomial monic, i.e. leadingCoefficient == 1. |
GenPolynomial<C> |
multiply(C s)
GenPolynomial multiplication. |
GenPolynomial<C> |
multiply(C s,
ExpVector e)
GenPolynomial multiplication. |
GenPolynomial<C> |
multiply(ExpVector e)
GenPolynomial multiplication. |
GenPolynomial<C> |
multiply(GenPolynomial<C> S)
GenPolynomial multiplication. |
GenPolynomial<C> |
multiply(java.util.Map.Entry<ExpVector,C> m)
GenPolynomial multiplication. |
GenPolynomial<C> |
negate()
GenPolynomial negation. |
int |
numberOfVariables()
Number of variables. |
GenPolynomial<C>[] |
quotientRemainder(GenPolynomial<C> S)
GenPolynomial division with remainder. |
GenPolynomial<C> |
reductum()
Reductum. |
GenPolynomial<C> |
remainder(GenPolynomial<C> S)
GenPolynomial remainder. |
GenPolynomial<C> |
reverse(GenPolynomialRing<C> oring)
Reverse variables. |
int |
signum()
GenPolynomial signum. |
GenPolynomial<C> |
subtract(C a)
GenPolynomial subtract. |
GenPolynomial<C> |
subtract(C a,
ExpVector e)
GenPolynomial subtraction. |
GenPolynomial<C> |
subtract(GenPolynomial<C> S)
GenPolynomial subtraction. |
GenPolynomial<C> |
sum(C a)
GenPolynomial addition. |
GenPolynomial<C> |
sum(C a,
ExpVector e)
GenPolynomial addition. |
GenPolynomial<C> |
sum(GenPolynomial<C> S)
GenPolynomial summation. |
C |
sumNorm()
GenPolynomial sum norm. |
java.lang.String |
toScript()
Get a scripting compatible string representation. |
java.lang.String |
toScriptFactory()
Get a scripting compatible string representation of the factory. |
java.lang.String |
toString()
String representation of GenPolynomial. |
java.lang.String |
toString(java.lang.String[] v)
String representation of GenPolynomial. |
C |
trailingBaseCoefficient()
Trailing base coefficient. |
ExpVector |
trailingExpVector()
Trailing exponent vector. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final GenPolynomialRing<C extends RingElem<C>> ring
protected final java.util.SortedMap<ExpVector,C extends RingElem<C>> val
Constructor Detail |
---|
public GenPolynomial(GenPolynomialRing<C> r)
r
- polynomial ring factory.public GenPolynomial(GenPolynomialRing<C> r, C c, ExpVector e)
r
- polynomial ring factory.c
- coefficient.e
- exponent.public GenPolynomial(GenPolynomialRing<C> r, C c)
r
- polynomial ring factory.c
- coefficient.protected GenPolynomial(GenPolynomialRing<C> r, java.util.SortedMap<ExpVector,C> v)
r
- polynomial ring factory.v
- the SortedMap of some other polynomial.Method Detail |
---|
public GenPolynomialRing<C> factory()
factory
in interface Element<GenPolynomial<C extends RingElem<C>>>
Element.factory()
public GenPolynomial<C> clone()
clone
in class java.lang.Object
Object.clone()
public int length()
public java.util.SortedMap<ExpVector,C> getMap()
public void doPutToMap(ExpVector e, C c)
c
- coefficient.e
- exponent.public void doPutToMap(java.util.SortedMap<ExpVector,C> vals)
vals
- sorted map of exponents and coefficients.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toString(java.lang.String[] v)
v
- names for variables.Object.toString()
public java.lang.String toScript()
toScript
in interface Element<GenPolynomial<C extends RingElem<C>>>
Element.toScript()
public java.lang.String toScriptFactory()
toScriptFactory
in interface Element<GenPolynomial<C extends RingElem<C>>>
Element.toScriptFactory()
public boolean isZERO()
isZERO
in interface AbelianGroupElem<GenPolynomial<C extends RingElem<C>>>
AbelianGroupElem.isZERO()
public boolean isONE()
isONE
in interface MonoidElem<GenPolynomial<C extends RingElem<C>>>
MonoidElem.isONE()
public boolean isUnit()
isUnit
in interface MonoidElem<GenPolynomial<C extends RingElem<C>>>
MonoidElem.isUnit()
public boolean isConstant()
public boolean equals(java.lang.Object B)
equals
in interface Element<GenPolynomial<C extends RingElem<C>>>
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in interface Element<GenPolynomial<C extends RingElem<C>>>
hashCode
in class java.lang.Object
Object.hashCode()
public int compareTo(GenPolynomial<C> b)
compareTo
in interface Element<GenPolynomial<C extends RingElem<C>>>
compareTo
in interface java.lang.Comparable<GenPolynomial<C extends RingElem<C>>>
b
- GenPolynomial.
public int signum()
signum
in interface AbelianGroupElem<GenPolynomial<C extends RingElem<C>>>
public int numberOfVariables()
public java.util.Map.Entry<ExpVector,C> leadingMonomial()
public ExpVector leadingExpVector()
public ExpVector trailingExpVector()
public C leadingBaseCoefficient()
public C trailingBaseCoefficient()
public C coefficient(ExpVector e)
e
- exponent.
public GenPolynomial<C> reductum()
public long degree(int i)
public long degree()
public ExpVector degreeVector()
public C maxNorm()
public C sumNorm()
public GenPolynomial<C> sum(GenPolynomial<C> S)
sum
in interface AbelianGroupElem<GenPolynomial<C extends RingElem<C>>>
S
- GenPolynomial.
public GenPolynomial<C> sum(C a, ExpVector e)
a
- coefficient.e
- exponent.
public GenPolynomial<C> sum(C a)
a
- coefficient.
public GenPolynomial<C> subtract(GenPolynomial<C> S)
subtract
in interface AbelianGroupElem<GenPolynomial<C extends RingElem<C>>>
S
- GenPolynomial.
public GenPolynomial<C> subtract(C a, ExpVector e)
a
- coefficient.e
- exponent.
public GenPolynomial<C> subtract(C a)
a
- coefficient.
public GenPolynomial<C> negate()
negate
in interface AbelianGroupElem<GenPolynomial<C extends RingElem<C>>>
public GenPolynomial<C> abs()
abs
in interface AbelianGroupElem<GenPolynomial<C extends RingElem<C>>>
public GenPolynomial<C> multiply(GenPolynomial<C> S)
multiply
in interface MonoidElem<GenPolynomial<C extends RingElem<C>>>
S
- GenPolynomial.
public GenPolynomial<C> multiply(C s)
s
- coefficient.
public GenPolynomial<C> monic()
public GenPolynomial<C> multiply(C s, ExpVector e)
s
- coefficient.e
- exponent.
public GenPolynomial<C> multiply(ExpVector e)
e
- exponent (!= null).
public GenPolynomial<C> multiply(java.util.Map.Entry<ExpVector,C> m)
m
- 'monomial'.
public GenPolynomial<C> divide(C s)
s
- coefficient.
public GenPolynomial<C>[] quotientRemainder(GenPolynomial<C> S)
S
- nonzero GenPolynomial with invertible leading coefficient.
.
@Deprecated public GenPolynomial<C>[] divideAndRemainder(GenPolynomial<C> S)
S
- nonzero GenPolynomial with invertible leading coefficient.
.
public GenPolynomial<C> divide(GenPolynomial<C> S)
divide
in interface MonoidElem<GenPolynomial<C extends RingElem<C>>>
S
- nonzero GenPolynomial with invertible leading coefficient.
.
public GenPolynomial<C> remainder(GenPolynomial<C> S)
remainder
in interface MonoidElem<GenPolynomial<C extends RingElem<C>>>
S
- nonzero GenPolynomial with invertible leading coefficient.
.
public GenPolynomial<C> gcd(GenPolynomial<C> S)
gcd
in interface RingElem<GenPolynomial<C extends RingElem<C>>>
S
- GenPolynomial.
public GenPolynomial<C>[] egcd(GenPolynomial<C> S)
egcd
in interface RingElem<GenPolynomial<C extends RingElem<C>>>
S
- GenPolynomial.
public GenPolynomial<C>[] hegcd(GenPolynomial<C> S)
S
- GenPolynomial.
public GenPolynomial<C> inverse()
inverse
in interface MonoidElem<GenPolynomial<C extends RingElem<C>>>
public GenPolynomial<C> modInverse(GenPolynomial<C> m)
m
- GenPolynomial.
public GenPolynomial<C> extend(GenPolynomialRing<C> pfac, int j, long k)
pfac
- extended polynomial ring factory (by i variables).j
- index of variable to be used for multiplication.k
- exponent for x_j.
public GenPolynomial<C> extendLower(GenPolynomialRing<C> pfac, int j, long k)
pfac
- extended polynomial ring factory (by i variables).j
- index of variable to be used for multiplication.k
- exponent for x_j.
public java.util.Map<ExpVector,GenPolynomial<C>> contract(GenPolynomialRing<C> pfac)
pfac
- contracted polynomial ring factory (by i variables).
public GenPolynomial<C> contractCoeff(GenPolynomialRing<C> pfac)
pfac
- contracted polynomial ring factory (by i variables).
public GenPolynomial<C> extendUnivariate(GenPolynomialRing<C> pfac, int i)
pfac
- extended polynomial ring factory.i
- index of the variable of this polynomial in pfac.
public GenPolynomial<C> reverse(GenPolynomialRing<C> oring)
public java.util.Iterator<C> coefficientIterator()
public java.util.Iterator<ExpVector> exponentIterator()
public java.util.Iterator<Monomial<C>> iterator()
iterator
in interface java.lang.Iterable<Monomial<C extends RingElem<C>>>
public GenPolynomial<C> map(UnaryFunctor<? super C,C> f)
f
- evaluation functor.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |