Package edu.jas.poly
Class GenPolynomialRing<C extends RingElem<C>>
- java.lang.Object
-
- edu.jas.poly.GenPolynomialRing<C>
-
- Type Parameters:
C
- coefficient type
- All Implemented Interfaces:
AbelianGroupFactory<GenPolynomial<C>>
,ElemFactory<GenPolynomial<C>>
,MonoidFactory<GenPolynomial<C>>
,RingFactory<GenPolynomial<C>>
,java.io.Serializable
,java.lang.Iterable<GenPolynomial<C>>
- Direct Known Subclasses:
GenSolvablePolynomialRing
public class GenPolynomialRing<C extends RingElem<C>> extends java.lang.Object implements RingFactory<GenPolynomial<C>>, java.lang.Iterable<GenPolynomial<C>>
GenPolynomialRing generic polynomial factory. It implements RingFactory for n-variate ordered polynomials over coefficients C. The variables commute with each other and with the coefficients. For non-commutative coefficients some care is taken to respect the multiplication order. Almost immutable object, except variable names.- Author:
- Heinz Kredel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description RingFactory<C>
coFac
The factory for the coefficients.ExpVector
evzero
The constant exponent vector 0 for this ring.protected int
isField
Indicator if this ring is a field.int
nvar
The number of variables.GenPolynomial<C>
ONE
The constant polynomial 1 for this ring.protected boolean
partial
True for partially reversed variables.protected static java.util.Random
random
A default random sequence generator.TermOrder
tord
The term order.protected java.lang.String[]
vars
The names of the variables.GenPolynomial<C>
ZERO
The constant polynomial 0 for this ring.
-
Constructor Summary
Constructors Constructor Description GenPolynomialRing(GenPolynomialRing<C> o, TermOrder to)
The constructor creates a polynomial factory object with the the same coefficient factory, number of variables and variable names as the given polynomial factory, only the term order differs.GenPolynomialRing(RingFactory<C> cf, int n)
The constructor creates a polynomial factory object with the default term order.GenPolynomialRing(RingFactory<C> cf, int n, TermOrder t)
The constructor creates a polynomial factory object.GenPolynomialRing(RingFactory<C> cf, int n, TermOrder t, java.lang.String[] v)
The constructor creates a polynomial factory object.GenPolynomialRing(RingFactory<C> cf, int n, java.lang.String[] v)
The constructor creates a polynomial factory object.GenPolynomialRing(RingFactory<C> cf, GenPolynomialRing o)
The constructor creates a polynomial factory object with the the same term order, number of variables and variable names as the given polynomial factory, only the coefficient factories differ.GenPolynomialRing(RingFactory<C> cf, TermOrder t, java.lang.String[] v)
The constructor creates a polynomial factory object.GenPolynomialRing(RingFactory<C> cf, java.lang.String[] v)
The constructor creates a polynomial factory object.GenPolynomialRing(RingFactory<C> cf, java.lang.String[] v, TermOrder t)
The constructor creates a polynomial factory object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigInteger
characteristic()
Characteristic of this ring.GenPolynomial<C>
charPolynomial(GenMatrix<C> A)
Characteristic polynomial of matrix.GenPolynomialRing<C>
contract(int i)
Contract variables.GenPolynomialRing<C>
copy()
Copy this factory.GenPolynomial<C>
copy(GenPolynomial<C> c)
Copy polynomial c.java.util.List<GenPolynomial<C>>
copy(java.util.List<GenPolynomial<C>> L)
Copy polynomial list.C
determinant(GenMatrix<C> A)
Determinant of matrix via characteristic polynomial.C
determinantFromCharPol(GenPolynomial<C> P)
Determinant of matrix from characteristic polynomial.GenPolynomialRing<C>
distribute()
Distributive representation as polynomial with all main variables.boolean
equals(java.lang.Object other)
Comparison with any other object.GenPolynomialRing<C>
extend(int i)
Extend variables.GenPolynomialRing<C>
extend(int i, boolean top)
Extend variables.GenPolynomialRing<C>
extend(java.lang.String[] vn)
Extend variables.GenPolynomialRing<C>
extend(java.lang.String[] vn, boolean top)
Extend variables.GenPolynomialRing<C>
extendLower(int i)
Extend lower variables.GenPolynomialRing<C>
extendLower(java.lang.String[] vn)
Extend lower variables.GenPolynomialRing<C>
extendLower(java.lang.String[] vn, boolean top)
Extend lower variables.GenPolynomial<C>
fromInteger(long a)
Get a (constant) GenPolynomial<C> element from a long value.GenPolynomial<C>
fromInteger(java.math.BigInteger a)
Get a (constant) GenPolynomial<C> element from a BigInteger value.GenPolynomial<C>
fromVector(GenVector<C> a)
Get a GenPolynomial<C> from a GenVector<C>.java.util.List<GenPolynomial<C>>
generators()
Get a list of the generating elements.java.util.List<GenPolynomial<C>>
generators(int modv)
Get a list of the generating elements excluding the module variables.PolynomialComparator<C>
getComparator()
Get PolynomialComparator.PolynomialComparator<C>
getComparator(boolean rev)
Get PolynomialComparator.int
getCreations()
Get the number of polynomial creations.java.util.List<GenPolynomial<C>>
getGenerators()
Get the generating elements excluding the generators for the coefficient ring.GenPolynomial<C>
getONE()
Get the one element.C
getONECoefficient()
Get the one element from the coefficients.java.lang.String[]
getVars()
Get the variable names.GenPolynomial<C>
getZERO()
Get the zero element.C
getZEROCoefficient()
Get the zero element from the coefficients.int
hashCode()
Hash code for this polynomial ring.boolean
isAssociative()
Query if this ring is associative.boolean
isCommutative()
Query if this ring is commutative.boolean
isField()
Query if this ring is a field.boolean
isFinite()
Is this structure finite or infinite.java.util.Iterator<GenPolynomial<C>>
iterator()
Get a GenPolynomial iterator.java.lang.String[]
newVars()
New variable names.static java.lang.String[]
newVars(int n)
New variable names.java.lang.String[]
newVars(java.lang.String prefix)
New variable names.static java.lang.String[]
newVars(java.lang.String prefix, int n)
New variable names.GenPolynomial<C>
parse(java.io.Reader r)
Parse a polynomial with the use of GenPolynomialTokenizer.GenPolynomial<C>
parse(java.lang.String s)
Parse a polynomial with the use of GenPolynomialTokenizer.GenPolynomialRing<C>
permutation(java.util.List<java.lang.Integer> P)
Permutation of polynomial ring variables.static java.lang.String[]
permuteVars(java.util.List<java.lang.Integer> P, java.lang.String[] vars)
Permute variable names.GenPolynomial<C>
random(int n)
Random polynomial.GenPolynomial<C>
random(int k, int l, int d, float q)
Generate a random polynomial.GenPolynomial<C>
random(int k, int l, int d, float q, java.util.Random rnd)
Generate a random polynomial.GenPolynomial<C>
random(int n, java.util.Random rnd)
Random polynomial.GenPolynomialRing<GenPolynomial<C>>
recursive(int i)
Recursive representation as polynomial with i main variables.GenPolynomialRing<C>
reverse()
Reverse variables.GenPolynomialRing<C>
reverse(boolean partial)
Reverse variables.java.lang.String[]
setVars(java.lang.String[] v)
Set the variable names.java.lang.String
toScript()
Get a scripting compatible string representation.java.lang.String
toScript(ExpVector e)
Get a scripting compatible string representation of an ExpVector of this ring.java.lang.String
toString()
Get the String representation.C
traceFromCharPol(GenPolynomial<C> P)
Trace of matrix from characteristic polynomial.GenPolynomial<C>
univariate(int i)
Generate univariate polynomial in a given variable.GenPolynomial<C>
univariate(int modv, int i, long e)
Generate univariate polynomial in a given variable with given exponent.GenPolynomial<C>
univariate(int i, long e)
Generate univariate polynomial in a given variable with given exponent.GenPolynomial<C>
univariate(java.lang.String x)
Generate univariate polynomial in a given variable with given exponent.GenPolynomial<C>
univariate(java.lang.String x, long e)
Generate univariate polynomial in a given variable with given exponent.java.util.List<? extends GenPolynomial<C>>
univariateList()
Generate list of univariate polynomials in all variables.java.util.List<? extends GenPolynomial<C>>
univariateList(int modv)
Generate list of univariate polynomials in all variables.java.util.List<? extends GenPolynomial<C>>
univariateList(int modv, long e)
Generate list of univariate polynomials in all variables with given exponent.GenPolynomial<C>
valueOf(C a)
Get a (constant) GenPolynomial<C> element from a coefficient value.GenPolynomial<C>
valueOf(C a, ExpVector e)
Get a GenPolynomial<C> element from a coefficient and an exponent vector.GenPolynomial<C>
valueOf(ExpVector e)
Get a GenPolynomial<C> element from an exponent vector.GenPolynomial<C>
valueOf(Monomial<C> m)
Get a GenPolynomial<C> element from a monomial.java.util.List<GenPolynomial<C>>
valueOf(java.lang.Iterable<ExpVector> E)
Get a GenPolynomial<C> element from a list of exponent vectors.java.lang.String
varsToString()
Get a String representation of the variable names.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.jas.structure.ElemFactory
valueOf
-
-
-
-
Field Detail
-
coFac
public final RingFactory<C extends RingElem<C>> coFac
The factory for the coefficients.
-
nvar
public final int nvar
The number of variables.
-
partial
protected boolean partial
True for partially reversed variables.
-
vars
protected java.lang.String[] vars
The names of the variables. This value can be modified.
-
ZERO
public GenPolynomial<C extends RingElem<C>> ZERO
The constant polynomial 0 for this ring.
-
ONE
public GenPolynomial<C extends RingElem<C>> ONE
The constant polynomial 1 for this ring.
-
random
protected static final java.util.Random random
A default random sequence generator.
-
isField
protected int isField
Indicator if this ring is a field.
-
-
Constructor Detail
-
GenPolynomialRing
public GenPolynomialRing(RingFactory<C> cf, int n)
The constructor creates a polynomial factory object with the default term order.- Parameters:
cf
- factory for coefficients of type C.n
- number of variables.
-
GenPolynomialRing
public GenPolynomialRing(RingFactory<C> cf, int n, TermOrder t)
The constructor creates a polynomial factory object.- Parameters:
cf
- factory for coefficients of type C.n
- number of variables.t
- a term order.
-
GenPolynomialRing
public GenPolynomialRing(RingFactory<C> cf, java.lang.String[] v)
The constructor creates a polynomial factory object.- Parameters:
cf
- factory for coefficients of type C.v
- names for the variables.
-
GenPolynomialRing
public GenPolynomialRing(RingFactory<C> cf, int n, java.lang.String[] v)
The constructor creates a polynomial factory object.- Parameters:
cf
- factory for coefficients of type C.n
- number of variables.v
- names for the variables.
-
GenPolynomialRing
public GenPolynomialRing(RingFactory<C> cf, TermOrder t, java.lang.String[] v)
The constructor creates a polynomial factory object.- Parameters:
cf
- factory for coefficients of type C.t
- a term order.v
- names for the variables.
-
GenPolynomialRing
public GenPolynomialRing(RingFactory<C> cf, java.lang.String[] v, TermOrder t)
The constructor creates a polynomial factory object.- Parameters:
cf
- factory for coefficients of type C.v
- names for the variables.t
- a term order.
-
GenPolynomialRing
public GenPolynomialRing(RingFactory<C> cf, int n, TermOrder t, java.lang.String[] v)
The constructor creates a polynomial factory object.- Parameters:
cf
- factory for coefficients of type C.n
- number of variables.t
- a term order.v
- names for the variables.
-
GenPolynomialRing
public GenPolynomialRing(RingFactory<C> cf, GenPolynomialRing o)
The constructor creates a polynomial factory object with the the same term order, number of variables and variable names as the given polynomial factory, only the coefficient factories differ.- Parameters:
cf
- factory for coefficients of type C.o
- other polynomial ring.
-
GenPolynomialRing
public GenPolynomialRing(GenPolynomialRing<C> o, TermOrder to)
The constructor creates a polynomial factory object with the the same coefficient factory, number of variables and variable names as the given polynomial factory, only the term order differs.- Parameters:
to
- term order.o
- other polynomial ring.
-
-
Method Detail
-
copy
public GenPolynomialRing<C> copy()
Copy this factory.- Returns:
- a clone of this.
-
toString
public java.lang.String toString()
Get the String representation.- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
toScript
public java.lang.String toScript()
Get a scripting compatible string representation.- Specified by:
toScript
in interfaceElemFactory<C extends RingElem<C>>
- Returns:
- script compatible representation for this Element.
- See Also:
Element.toScript()
-
toScript
public java.lang.String toScript(ExpVector e)
Get a scripting compatible string representation of an ExpVector of this ring.- Parameters:
e
- exponent vector- Returns:
- script compatible representation for the ExpVector.
-
equals
public boolean equals(java.lang.Object other)
Comparison with any other object.- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Hash code for this polynomial ring.- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
getCreations
public int getCreations()
Get the number of polynomial creations.- Returns:
- creations.
-
getVars
public java.lang.String[] getVars()
Get the variable names.- Returns:
- vars.
-
setVars
public java.lang.String[] setVars(java.lang.String[] v)
Set the variable names.- Returns:
- old vars.
-
varsToString
public java.lang.String varsToString()
Get a String representation of the variable names.- Returns:
- names separated by commas.
-
getZEROCoefficient
public C getZEROCoefficient()
Get the zero element from the coefficients.- Returns:
- 0 as C.
-
getONECoefficient
public C getONECoefficient()
Get the one element from the coefficients.- Returns:
- 1 as C.
-
getZERO
public GenPolynomial<C> getZERO()
Get the zero element.- Specified by:
getZERO
in interfaceAbelianGroupFactory<C extends RingElem<C>>
- Returns:
- 0 as GenPolynomial
.
-
getONE
public GenPolynomial<C> getONE()
Get the one element.- Specified by:
getONE
in interfaceMonoidFactory<C extends RingElem<C>>
- Returns:
- 1 as GenPolynomial
.
-
isCommutative
public boolean isCommutative()
Query if this ring is commutative.- Specified by:
isCommutative
in interfaceMonoidFactory<C extends RingElem<C>>
- Returns:
- true if this ring is commutative, else false.
-
isAssociative
public boolean isAssociative()
Query if this ring is associative.- Specified by:
isAssociative
in interfaceMonoidFactory<C extends RingElem<C>>
- Returns:
- true if this ring is associative, else false.
-
isField
public boolean isField()
Query if this ring is a field.- Specified by:
isField
in interfaceRingFactory<C extends RingElem<C>>
- Returns:
- false.
-
characteristic
public java.math.BigInteger characteristic()
Characteristic of this ring.- Specified by:
characteristic
in interfaceRingFactory<C extends RingElem<C>>
- Returns:
- characteristic of this ring.
-
valueOf
public GenPolynomial<C> valueOf(C a)
Get a (constant) GenPolynomial<C> element from a coefficient value.- Parameters:
a
- coefficient.- Returns:
- a GenPolynomial<C>.
-
valueOf
public GenPolynomial<C> valueOf(ExpVector e)
Get a GenPolynomial<C> element from an exponent vector.- Parameters:
e
- exponent vector.- Returns:
- a GenPolynomial<C>.
-
valueOf
public java.util.List<GenPolynomial<C>> valueOf(java.lang.Iterable<ExpVector> E)
Get a GenPolynomial<C> element from a list of exponent vectors.- Parameters:
E
- list of exponent vector.- Returns:
- a GenPolynomial<C>.
-
valueOf
public GenPolynomial<C> valueOf(C a, ExpVector e)
Get a GenPolynomial<C> element from a coefficient and an exponent vector.- Parameters:
a
- coefficient.e
- exponent vector.- Returns:
- a GenPolynomial<C>.
-
valueOf
public GenPolynomial<C> valueOf(Monomial<C> m)
Get a GenPolynomial<C> element from a monomial.- Parameters:
m
- monomial.- Returns:
- a GenPolynomial<C>.
-
fromInteger
public GenPolynomial<C> fromInteger(long a)
Get a (constant) GenPolynomial<C> element from a long value.- Specified by:
fromInteger
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
a
- long.- Returns:
- a GenPolynomial<C>.
-
fromInteger
public GenPolynomial<C> fromInteger(java.math.BigInteger a)
Get a (constant) GenPolynomial<C> element from a BigInteger value.- Specified by:
fromInteger
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
a
- BigInteger.- Returns:
- a GenPolynomial<C>.
-
fromVector
public GenPolynomial<C> fromVector(GenVector<C> a)
Get a GenPolynomial<C> from a GenVector<C>.- Parameters:
a
- GenVector<C>.- Returns:
- a GenPolynomial<C>.
-
random
public GenPolynomial<C> random(int n)
Random polynomial. Generates a random polynomial with k = 5, l = n, d = (nvar == 1) ? n : 3, q = (nvar == 1) ? 0.7 : 0.3.- Specified by:
random
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
n
- number of terms.- Returns:
- a random polynomial.
-
random
public GenPolynomial<C> random(int n, java.util.Random rnd)
Random polynomial. Generates a random polynomial with k = 5, l = n, d = n, q = (nvar == 1) ? 0.5 : 0.3.- Specified by:
random
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
n
- number of terms.rnd
- is a source for random bits.- Returns:
- a random polynomial.
-
random
public GenPolynomial<C> random(int k, int l, int d, float q)
Generate a random polynomial.- Parameters:
k
- bitsize of random coefficients.l
- number of terms.d
- maximal degree in each variable.q
- density of nozero exponents.- Returns:
- a random polynomial.
-
random
public GenPolynomial<C> random(int k, int l, int d, float q, java.util.Random rnd)
Generate a random polynomial.- Parameters:
k
- bitsize of random coefficients.l
- number of terms.d
- maximal degree in each variable.q
- density of nozero exponents.rnd
- is a source for random bits.- Returns:
- a random polynomial.
-
copy
public GenPolynomial<C> copy(GenPolynomial<C> c)
Copy polynomial c.- Specified by:
copy
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
c
-- Returns:
- a copy of c.
-
copy
public java.util.List<GenPolynomial<C>> copy(java.util.List<GenPolynomial<C>> L)
Copy polynomial list.- Parameters:
L
- polynomial list- Returns:
- a copy of L in this ring.
-
parse
public GenPolynomial<C> parse(java.lang.String s)
Parse a polynomial with the use of GenPolynomialTokenizer.- Specified by:
parse
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
s
- String.- Returns:
- GenPolynomial from s.
-
parse
public GenPolynomial<C> parse(java.io.Reader r)
Parse a polynomial with the use of GenPolynomialTokenizer.- Specified by:
parse
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
r
- Reader.- Returns:
- next GenPolynomial from r.
-
univariate
public GenPolynomial<C> univariate(java.lang.String x)
Generate univariate polynomial in a given variable with given exponent.- Parameters:
x
- the name of a variable.- Returns:
- x as univariate polynomial.
-
univariate
public GenPolynomial<C> univariate(java.lang.String x, long e)
Generate univariate polynomial in a given variable with given exponent.- Parameters:
x
- the name of the variable.e
- the exponent of the variable.- Returns:
- x^e as univariate polynomial.
-
univariate
public GenPolynomial<C> univariate(int i)
Generate univariate polynomial in a given variable.- Parameters:
i
- the index of the variable.- Returns:
- X_i as univariate polynomial.
-
univariate
public GenPolynomial<C> univariate(int i, long e)
Generate univariate polynomial in a given variable with given exponent.- Parameters:
i
- the index of the variable.e
- the exponent of the variable.- Returns:
- X_i^e as univariate polynomial.
-
univariate
public GenPolynomial<C> univariate(int modv, int i, long e)
Generate univariate polynomial in a given variable with given exponent.- Parameters:
modv
- number of module variables.i
- the index of the variable.e
- the exponent of the variable.- Returns:
- X_i^e as univariate polynomial.
-
getGenerators
public java.util.List<GenPolynomial<C>> getGenerators()
Get the generating elements excluding the generators for the coefficient ring.- Returns:
- a list of generating elements for this ring.
-
generators
public java.util.List<GenPolynomial<C>> generators()
Get a list of the generating elements.- Specified by:
generators
in interfaceElemFactory<C extends RingElem<C>>
- Returns:
- list of generators for the algebraic structure.
- See Also:
ElemFactory.generators()
-
generators
public java.util.List<GenPolynomial<C>> generators(int modv)
Get a list of the generating elements excluding the module variables.- Parameters:
modv
- number of module variables- Returns:
- list of generators for the polynomial ring.
-
isFinite
public boolean isFinite()
Is this structure finite or infinite.- Specified by:
isFinite
in interfaceElemFactory<C extends RingElem<C>>
- Returns:
- true if this structure is finite, else false.
- See Also:
ElemFactory.isFinite()
-
univariateList
public java.util.List<? extends GenPolynomial<C>> univariateList()
Generate list of univariate polynomials in all variables.- Returns:
- List(X_1,...,X_n) a list of univariate polynomials.
-
univariateList
public java.util.List<? extends GenPolynomial<C>> univariateList(int modv)
Generate list of univariate polynomials in all variables.- Parameters:
modv
- number of module variables.- Returns:
- List(X_1,...,X_n) a list of univariate polynomials.
-
univariateList
public java.util.List<? extends GenPolynomial<C>> univariateList(int modv, long e)
Generate list of univariate polynomials in all variables with given exponent.- Parameters:
modv
- number of module variables.e
- the exponent of the variables.- Returns:
- List(X_1^e,...,X_n^e) a list of univariate polynomials.
-
extend
public GenPolynomialRing<C> extend(int i)
Extend variables. Used e.g. in module embedding. Extend number of variables by i.- Parameters:
i
- number of variables to extend.- Returns:
- extended polynomial ring factory.
-
extend
public GenPolynomialRing<C> extend(int i, boolean top)
Extend variables. Used e.g. in module embedding. Extend number of variables by i.- Parameters:
i
- number of variables to extend.top
- true for TOP term order, false for POT term order.- Returns:
- extended polynomial ring factory.
-
extend
public GenPolynomialRing<C> extend(java.lang.String[] vn)
Extend variables. Used e.g. in module embedding. Extend number of variables by length(vn).- Parameters:
vn
- names for extended variables.- Returns:
- extended polynomial ring factory.
-
extend
public GenPolynomialRing<C> extend(java.lang.String[] vn, boolean top)
Extend variables. Used e.g. in module embedding. Extend number of variables by length(vn).- Parameters:
vn
- names for extended variables.top
- true for TOP term order, false for POT term order.- Returns:
- extended polynomial ring factory.
-
extendLower
public GenPolynomialRing<C> extendLower(int i)
Extend lower variables. Extend number of variables by i.- Parameters:
i
- number of variables to extend.- Returns:
- extended polynomial ring factory.
-
extendLower
public GenPolynomialRing<C> extendLower(java.lang.String[] vn)
Extend lower variables. Extend number of variables by length(vn).- Parameters:
vn
- names for extended lower variables.- Returns:
- extended polynomial ring factory.
-
extendLower
public GenPolynomialRing<C> extendLower(java.lang.String[] vn, boolean top)
Extend lower variables. Extend number of variables by length(vn).- Parameters:
vn
- names for extended lower variables.top
- true for TOP term order, false for POT term order.- Returns:
- extended polynomial ring factory.
-
contract
public GenPolynomialRing<C> contract(int i)
Contract variables. Used e.g. in module embedding. Contract number of variables by i.- Parameters:
i
- number of variables to remove.- Returns:
- contracted polynomial ring factory.
-
recursive
public GenPolynomialRing<GenPolynomial<C>> recursive(int i)
Recursive representation as polynomial with i main variables.- Parameters:
i
- number of main variables.- Returns:
- recursive polynomial ring factory.
-
distribute
public GenPolynomialRing<C> distribute()
Distributive representation as polynomial with all main variables.- Returns:
- distributive polynomial ring factory.
-
reverse
public GenPolynomialRing<C> reverse()
Reverse variables. Used e.g. in opposite rings.- Returns:
- polynomial ring factory with reversed variables.
-
reverse
public GenPolynomialRing<C> reverse(boolean partial)
Reverse variables. Used e.g. in opposite rings. The coefficient ring must be commuative.- Parameters:
partial
- true for partially reversed term orders.- Returns:
- polynomial ring factory with reversed variables.
-
getComparator
public PolynomialComparator<C> getComparator()
Get PolynomialComparator.- Returns:
- polynomial comparator.
-
getComparator
public PolynomialComparator<C> getComparator(boolean rev)
Get PolynomialComparator.- Parameters:
rev
- for reverse comparator.- Returns:
- polynomial comparator.
-
newVars
public static java.lang.String[] newVars(java.lang.String prefix, int n)
New variable names. Generate new names for variables,- Parameters:
prefix
- name prefix.n
- number of variables.- Returns:
- new variable names.
-
newVars
public java.lang.String[] newVars(java.lang.String prefix)
New variable names. Generate new names for variables,- Parameters:
prefix
- name prefix.- Returns:
- new variable names.
-
newVars
public static java.lang.String[] newVars(int n)
New variable names. Generate new names for variables,- Parameters:
n
- number of variables.- Returns:
- new variable names.
-
newVars
public java.lang.String[] newVars()
New variable names. Generate new names for variables,- Returns:
- new variable names.
-
permuteVars
public static java.lang.String[] permuteVars(java.util.List<java.lang.Integer> P, java.lang.String[] vars)
Permute variable names.- Parameters:
vars
- variable names.P
- permutation.- Returns:
- P(vars).
-
permutation
public GenPolynomialRing<C> permutation(java.util.List<java.lang.Integer> P)
Permutation of polynomial ring variables.- Parameters:
P
- permutation.- Returns:
- P(this).
-
charPolynomial
public GenPolynomial<C> charPolynomial(GenMatrix<C> A)
Characteristic polynomial of matrix. Note: using Faddeev–LeVerrier algorithm- Parameters:
A
- a square matrix.- Returns:
- characteristic polynomial of A.
-
determinantFromCharPol
public C determinantFromCharPol(GenPolynomial<C> P)
Determinant of matrix from characteristic polynomial. Note: using Faddeev–LeVerrier algorithm- Parameters:
P
- characteristic polynomial of a matrix.- Returns:
- determinant from characteristic polynomial.
-
determinant
public C determinant(GenMatrix<C> A)
Determinant of matrix via characteristic polynomial. Note: using Faddeev–LeVerrier algorithm- Parameters:
A
- square matrix.- Returns:
- determinant of A from characteristic polynomial of A.
-
traceFromCharPol
public C traceFromCharPol(GenPolynomial<C> P)
Trace of matrix from characteristic polynomial.- Parameters:
P
- characteristic polynomial of a matrix.- Returns:
- trace from characteristic polynomial.
-
-