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 for
MonomialZp64
and Monomial
.
Instances are immutable. Algebraic operations on monomials (multiplication and division) are specified in IMonomialAlgebra
.- 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 protected
AMonomial(int[] exponents)
protected
AMonomial(int[] exponents, int totalDegree)
protected
AMonomial(DegreeVector degreeVector)
-
Method Summary
Modifier and Type Method Description Term
divideOrNull(int[] divider)
Gives quotientthis / oth
or null if exact division is not possible (e.g.Term
divideOrNull(DegreeVector divider)
Gives quotientthis / oth
or null if exact division is not possible (e.g.Term
dropSelect(int[] variables)
Picks only specified exponentsDegreeVector
dv()
Drop the coefficientString
dvToString()
String
dvToString(String[] vars)
abstract Term
forceSetDegreeVector(int[] exponents, int totalDegree)
Sets the degree vectorTerm
insert(int variable)
Inserts new variable (with zero exponent)Term
insert(int variable, int count)
Inserts new variables (with zero exponent)Term
joinNewVariable()
Joins new variable (with zero exponent) to degree vectorTerm
joinNewVariables(int n)
Joins new variables (with zero exponents) to degree vectorTerm
joinNewVariables(int newNVariables, int[] mapping)
internal APITerm
map(int nVariables, int[] mapping)
Renames old variables to new according to mappingTerm
multiply(int[] oth)
Multiplies this by othTerm
multiply(DegreeVector oth)
Multiplies this by othTerm
range(int from, int to)
Selects range from thisTerm
select(int var)
Sets exponents of all variables except the specified variable to zeroTerm
select(int[] variables)
Set's exponents of all variables except specified variables to zeroTerm
set(int variable, int exponent)
Set's exponent of specified variable to specified valueabstract Term
setCoefficientFrom(Term oth)
Sets coefficient of this with coefficient of othTerm
setDegreeVector(int[] exponents)
Sets the degree vectorabstract Term
setDegreeVector(int[] exponents, int totalDegree)
Sets the degree vectorabstract Term
setDegreeVector(DegreeVector oth)
Sets the degree vectorTerm
setNVariables(int n)
Sets the number of variablesTerm
setZero(int var)
Set exponent of specifiedvar
to zeroTerm
setZero(int[] variables)
Set exponents of specified variables to zeroTerm
toZero()
Set all exponents to zeroTerm
without(int variable)
Drops specified variable (number of variables will be reduced)Term
without(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 Details
-
AMonomial
protected AMonomial(int[] exponents, int totalDegree)- Parameters:
exponents
- exponentstotalDegree
- total degree (sum of exponents)
-
AMonomial
protected AMonomial(int[] exponents)- Parameters:
exponents
- exponents
-
AMonomial
- Parameters:
degreeVector
- DegreeVector
-
-
Method Details
-
dv
Drop the coefficient- Overrides:
dv
in classDegreeVector
-
setCoefficientFrom
Sets coefficient of this with coefficient of oth -
setDegreeVector
Sets the degree vector -
setDegreeVector
Sets the degree vector -
forceSetDegreeVector
Sets the degree vector -
setDegreeVector
Sets the degree vector -
multiply
Multiplies this by oth -
multiply
Multiplies this by oth -
divideOrNull
Gives quotientthis / oth
or null if exact division is not possible (e.g. a^2*b^3 / a^3*b^5) -
divideOrNull
Gives quotientthis / oth
or null if exact division is not possible (e.g. a^2*b^3 / a^3*b^5) -
joinNewVariable
Joins new variable (with zero exponent) to degree vector -
joinNewVariables
Joins new variables (with zero exponents) to degree vector -
joinNewVariables
internal API -
setNVariables
Sets the number of variables -
select
Sets exponents of all variables except the specified variable to zero -
select
Set's exponents of all variables except specified variables to zero -
dropSelect
Picks only specified exponents -
range
Selects range from this- Parameters:
from
- from inclusiveto
- to exclusive
-
setZero
Set exponent of specifiedvar
to zero -
toZero
Set all exponents to zero -
setZero
Set exponents of specified variables to zero -
without
Drops specified variable (number of variables will be reduced) -
without
Drops specified variables (number of variables will be reduced) -
insert
Inserts new variable (with zero exponent) -
insert
Inserts new variables (with zero exponent) -
map
Renames old variables to new according to mapping- Parameters:
nVariables
- new total number of variablesmapping
- mapping from old variables to new variables
-
set
Set's exponent of specified variable to specified value- Parameters:
variable
- the variableexponent
- new exponent
-
dvToString
-
dvToString
-