public class ExponentInvExpr extends java.lang.Object implements ExponentExpr
ExponentExpr representing the multiplicative inversion of an exponent expression.| Modifier and Type | Field and Description |
|---|---|
protected ExponentExpr |
child
The exponent expression being inverted.
|
| Constructor and Description |
|---|
ExponentInvExpr(ExponentExpr child) |
| 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 |
getChild()
Retrieves the exponent expression being inverted.
|
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 child
public ExponentInvExpr(ExponentExpr child)
public ExponentExpr getChild()
public java.math.BigInteger evaluate()
Expressionevaluate in interface ExponentExprevaluate 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\)).public 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 Expression