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 forMonomialZp64
andMonomial
. 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 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 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:
dv
in 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 / oth
or 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 / oth
or 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 specifiedvar
to 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()
-
-