Package org.oristool.math.expression
Class Exmonomial
java.lang.Object
org.oristool.math.expression.Exmonomial
A constant term multiplied by a set of
AtomicTerm.-
Constructor Summary
ConstructorsConstructorDescriptionExmonomial(BigDecimal constantTerm) Exmonomial(Exmonomial exmon) Builds a copy of the input instance.Exmonomial(OmegaBigDecimal constantTerm) Builds a constant instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAtomicTerm(AtomicTerm term) Adds a new atomic term to the product.voiddivide(BigDecimal k) Divides by a constant and normalizes.Evaluates the exmonomial.evaluate(Variable base, Boolean sign1, Variable offset1, Boolean sign2, Variable offset2, BigDecimal constant) Replacesbasewith +/-offset1+/-offset2+constant.evaluate(Variable base, Boolean sign, Variable offset, BigDecimal constant) Replacesbasewith +/-offset+constant.evaluate(Variable var, OmegaBigDecimal value) Replaces a variable with its value.Gets the variable atomic terms of the exmonomial.Gets the constant multiplier of the term.Collects the variable names of the exmonomial.Computes the primitive function of this exmonomial.integrate(Variable var, OmegaBigDecimal lower, OmegaBigDecimal upper) Integrates this exmonomial over an interval.booleanisSameForm(Exmonomial exmon) Checks whether the input exmonomial has the same set of terms.voidmultiply(Exmonomial exmon) Multiplies this term by an input exmonomial.voidMultiplies this exmonomial by a constant.voidNormalizes the exmonomial to avoid multiple powers (or exponentials) for the same variable.voidsetConstantTerm(OmegaBigDecimal constantTerm) Sets the constant multiplier of the term.Replacesbasewithbase+offset.voidsubstitute(Variable oldVar, Variable newVar) ReplacesoldVarwithnewVar.toString()
-
Constructor Details
-
Exmonomial
Builds a constant instance.- Parameters:
constantTerm- the constant value
-
Exmonomial
-
Exmonomial
Builds a copy of the input instance.- Parameters:
exmon- input instance
-
-
Method Details
-
getConstantTerm
Gets the constant multiplier of the term.- Returns:
- constant multiplier
-
setConstantTerm
Sets the constant multiplier of the term.- Parameters:
constantTerm- constant multiplier to set
-
getAtomicTerms
Gets the variable atomic terms of the exmonomial.- Returns:
- the atomic terms
-
addAtomicTerm
Adds a new atomic term to the product.- Parameters:
term- the atomic term to be added
-
getVariables
Collects the variable names of the exmonomial.- Returns:
- variable names of all terms
-
normalize
public void normalize()Normalizes the exmonomial to avoid multiple powers (or exponentials) for the same variable. -
multiply
Multiplies this term by an input exmonomial.- Parameters:
exmon- input exmonomial
-
multiply
Multiplies this exmonomial by a constant.- Parameters:
c- constant
-
isSameForm
Checks whether the input exmonomial has the same set of terms.Both exmonomials must be normalized first.
- Parameters:
exmon- input exmonomial- Returns:
- true if both exmonomials have the same set of terms.
-
divide
Divides by a constant and normalizes.- Parameters:
k- constant
-
substitute
ReplacesoldVarwithnewVar.- Parameters:
oldVar- variable to be replacednewVar- new variable
-
integrate
Computes the primitive function of this exmonomial.- Parameters:
var- integration variable- Returns:
- primitive function
-
integrate
Integrates this exmonomial over an interval.- Parameters:
var- integration variablelower- lower boundupper- upper bound- Returns:
- definite integral value
-
shift
Replacesbasewithbase+offset.- Parameters:
base- variable to be replacedoffset- offset to be applied- Returns:
- resulting expolynomial
-
evaluate
Evaluates the exmonomial.- Parameters:
m- map with values for all the variables- Returns:
- exmonomial value
-
evaluate
Replaces a variable with its value.- Parameters:
var- variable to be replacedvalue- value of the variable- Returns:
- exmonomial after the substitution
-
evaluate
Replacesbasewith +/-offset+constant.- Parameters:
base- variable to be replacedsign- true if sign of the offset is positiveoffset- offset to be addedconstant- constant to be added- Returns:
- resulting
Expolynomial
-
evaluate
public Expolynomial evaluate(Variable base, Boolean sign1, Variable offset1, Boolean sign2, Variable offset2, BigDecimal constant) Replacesbasewith +/-offset1+/-offset2+constant.- Parameters:
base- variable to be replacedsign1- true if sign of the first offset is positiveoffset1- first offset to be addedsign2- true if sign of the second offset is positiveoffset2- second offset to be addedconstant- constant to be added- Returns:
- resulting
Expolynomial
-
toString
-