Package cc.redberry.rings.poly.multivar
Class AMonomial<Term extends AMonomial<Term>>
- java.lang.Object
-
- cc.redberry.rings.poly.multivar.DegreeVector
-
- cc.redberry.rings.poly.multivar.AMonomial<Term>
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Monomial,MonomialZp64
public abstract class AMonomial<Term extends AMonomial<Term>> extends DegreeVector
Abstract monomial (degree vector + coefficient). The parent class forMonomialZp64andMonomial. Instances are immutable. Algebraic operations on monomials (multiplication and division) are specified inIMonomialAlgebra.- Since:
- 2.3
- See Also:
DegreeVector,IMonomialAlgebra, Serialized Form
-
-
Field Summary
-
Fields inherited from class cc.redberry.rings.poly.multivar.DegreeVector
exponents, totalDegree
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAMonomial(int[] exponents)protectedAMonomial(int[] exponents, int totalDegree)protectedAMonomial(DegreeVector degreeVector)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TermdivideOrNull(int[] divider)Gives quotientthis / othor null if exact division is not possible (e.g.TermdivideOrNull(DegreeVector divider)Gives quotientthis / othor null if exact division is not possible (e.g.TermdropSelect(int[] variables)Picks only specified exponentsDegreeVectordv()Drop the coefficientStringdvToString()StringdvToString(String[] vars)abstract TermforceSetDegreeVector(int[] exponents, int totalDegree)Sets the degree vectorTerminsert(int variable)Inserts new variable (with zero exponent)Terminsert(int variable, int count)Inserts new variables (with zero exponent)TermjoinNewVariable()Joins new variable (with zero exponent) to degree vectorTermjoinNewVariables(int n)Joins new variables (with zero exponents) to degree vectorTermjoinNewVariables(int newNVariables, int[] mapping)internal APITermmap(int nVariables, int[] mapping)Renames old variables to new according to mappingTermmultiply(int[] oth)Multiplies this by othTermmultiply(DegreeVector oth)Multiplies this by othTermrange(int from, int to)Selects range from thisTermselect(int var)Sets exponents of all variables except the specified variable to zeroTermselect(int[] variables)Set's exponents of all variables except specified variables to zeroTermset(int variable, int exponent)Set's exponent of specified variable to specified valueabstract TermsetCoefficientFrom(Term oth)Sets coefficient of this with coefficient of othTermsetDegreeVector(int[] exponents)Sets the degree vectorabstract TermsetDegreeVector(int[] exponents, int totalDegree)Sets the degree vectorabstract TermsetDegreeVector(DegreeVector oth)Sets the degree vectorTermsetNVariables(int n)Sets the number of variablesTermsetZero(int var)Set exponent of specifiedvarto zeroTermsetZero(int[] variables)Set exponents of specified variables to zeroTermtoZero()Set all exponents to zeroTermwithout(int variable)Drops specified variable (number of variables will be reduced)Termwithout(int[] variables)Drops specified variables (number of variables will be reduced)-
Methods inherited from class cc.redberry.rings.poly.multivar.DegreeVector
dvDivideExact, dvDivideExact, dvDivideOrNull, dvDivideOrNull, dvDivideOrNull, dvDivisibleBy, dvDivisibleBy, dvDropSelect, dvEquals, dvInsert, dvInsert, dvJoinNewVariable, dvJoinNewVariables, dvJoinNewVariables, dvMap, dvMultiply, dvMultiply, dvMultiply, dvRange, dvSelect, dvSelect, dvSet, dvSetNVariables, dvSetZero, dvSetZero, dvTotalDegree, dvWithout, dvWithout, equals, hashCode, isZeroVector, nVariables, toString, toString, toStringArray
-
-
-
-
Constructor Detail
-
AMonomial
protected AMonomial(int[] exponents, int totalDegree)- Parameters:
exponents- exponentstotalDegree- total degree (sum of exponents)
-
AMonomial
protected AMonomial(int[] exponents)
- Parameters:
exponents- exponents
-
AMonomial
protected AMonomial(DegreeVector degreeVector)
- Parameters:
degreeVector- DegreeVector
-
-
Method Detail
-
dv
public final DegreeVector dv()
Drop the coefficient- Overrides:
dvin classDegreeVector
-
setCoefficientFrom
public abstract Term setCoefficientFrom(Term oth)
Sets coefficient of this with coefficient of oth
-
setDegreeVector
public abstract Term setDegreeVector(DegreeVector oth)
Sets the degree vector
-
setDegreeVector
public abstract Term setDegreeVector(int[] exponents, int totalDegree)
Sets the degree vector
-
forceSetDegreeVector
public abstract Term forceSetDegreeVector(int[] exponents, int totalDegree)
Sets the degree vector
-
setDegreeVector
public final Term setDegreeVector(int[] exponents)
Sets the degree vector
-
multiply
public final Term multiply(DegreeVector oth)
Multiplies this by oth
-
multiply
public final Term multiply(int[] oth)
Multiplies this by oth
-
divideOrNull
public final Term divideOrNull(DegreeVector divider)
Gives quotientthis / othor null if exact division is not possible (e.g. a^2*b^3 / a^3*b^5)
-
divideOrNull
public final Term divideOrNull(int[] divider)
Gives quotientthis / othor null if exact division is not possible (e.g. a^2*b^3 / a^3*b^5)
-
joinNewVariable
public final Term joinNewVariable()
Joins new variable (with zero exponent) to degree vector
-
joinNewVariables
public final Term joinNewVariables(int n)
Joins new variables (with zero exponents) to degree vector
-
joinNewVariables
public final Term joinNewVariables(int newNVariables, int[] mapping)
internal API
-
setNVariables
public final Term setNVariables(int n)
Sets the number of variables
-
select
public final Term select(int var)
Sets exponents of all variables except the specified variable to zero
-
select
public final Term select(int[] variables)
Set's exponents of all variables except specified variables to zero
-
dropSelect
public final Term dropSelect(int[] variables)
Picks only specified exponents
-
range
public final Term range(int from, int to)
Selects range from this- Parameters:
from- from inclusiveto- to exclusive
-
setZero
public final Term setZero(int var)
Set exponent of specifiedvarto zero
-
toZero
public final Term toZero()
Set all exponents to zero
-
setZero
public final Term setZero(int[] variables)
Set exponents of specified variables to zero
-
without
public final Term without(int variable)
Drops specified variable (number of variables will be reduced)
-
without
public final Term without(int[] variables)
Drops specified variables (number of variables will be reduced)
-
insert
public final Term insert(int variable)
Inserts new variable (with zero exponent)
-
insert
public final Term insert(int variable, int count)
Inserts new variables (with zero exponent)
-
map
public final Term map(int nVariables, int[] mapping)
Renames old variables to new according to mapping- Parameters:
nVariables- new total number of variablesmapping- mapping from old variables to new variables
-
set
public final Term set(int variable, int exponent)
Set's exponent of specified variable to specified value- Parameters:
variable- the variableexponent- new exponent
-
dvToString
public final String dvToString()
-
-