public class ExponentMulExpr extends java.lang.Object implements ExponentExpr
ExponentExpr represening the multiplication of two exponent expressions.| Modifier and Type | Field and Description |
|---|---|
protected ExponentExpr |
lhs
The left hand side of this multiplication.
|
protected ExponentExpr |
rhs
The right hand side of this multiplication.
|
| Constructor and Description |
|---|
ExponentMulExpr(ExponentExpr lhs,
ExponentExpr rhs) |
| Modifier and Type | Method and Description |
|---|---|
java.math.BigInteger |
evaluate()
Evaluates the expression.
|
Zn.ZnElement |
evaluate(Zn zn)
Evaluates the expression in the given ring
Zn. |
void |
forEachChild(java.util.function.Consumer<Expression> action)
Calls action on every (direct) child of this expression.
|
ExponentExpr |
getLhs()
Retrieves the left hand side of this multiplication.
|
ExponentExpr |
getRhs()
Retrieves the right hand side of this multiplication.
|
ExponentSumExpr |
linearize()
Returns an equivalent expression of the form
y + f(variables), where y is constant (no variables),
and the expression f is linear. |
ExponentExpr |
substitute(Substitution substitutions)
Substitutes variables using the given function.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, add, add, add, add, evaluate, evaluate, invert, isEqualTo, isEqualTo, isEqualTo, mul, mul, mul, mul, mul, negate, pow, pow, pow, pow, pow, sub, sub, sub, sub, sub, substitute, substituteaccumulate, containsExprMatchingPredicate, containsVariables, getVariables, treeWalkprotected final ExponentExpr lhs
protected final ExponentExpr rhs
public ExponentMulExpr(ExponentExpr lhs, ExponentExpr rhs)
public ExponentExpr getLhs()
public ExponentExpr getRhs()
public java.math.BigInteger evaluate()
Expressionevaluate in interface ExponentExprevaluate in interface Expressionpublic void forEachChild(java.util.function.Consumer<Expression> action)
ExpressionGroupOpExpr, this would call action on the left- and right-hand-side and then return.forEachChild in interface Expressionpublic Zn.ZnElement evaluate(Zn zn)
ExponentExprZn.evaluate in interface ExponentExprzn - the Zn to evaluate inZn.ZnElementpublic ExponentExpr substitute(Substitution substitutions)
Expressionsubstitute in interface ExponentExprsubstitute in interface Expressionsubstitutions - a function mapping variable expressions to their replacement expressionspublic ExponentSumExpr linearize() throws java.lang.IllegalArgumentException
ExponentExpry + f(variables), where y is constant (no variables),
and the expression f is linear.
Linearity means that
f(variables) + f(variables2) = f(variables + variables2)The exact result is a
ExponentSumExpr where the left-hand-side y fulfills
y.containsVariables() == false and the right-hand side is linear.linearize in interface ExponentExprjava.lang.IllegalArgumentException - if it's not possible to form the desired output
(e.g., the input is something like \(g^{x_1 \cdot x_2}\) for variables \(x_1, x_2\)).