Class SymExpr
SymContext.
This is the scalar the SYMBOLIC arm of the pfqn_gld family computes over.
It carries +, -, *, / and integer powers, and
NOTHING ELSE, which is exactly the operation set that arm uses: the recursion
is g = g + L*g/mu throughout, so its result is a polynomial over a
monomial denominator and every intermediate is exact.
WHAT IT DELIBERATELY DOES NOT CARRY IS A COMPARISON. L > 0 and
min(row) == 1 have no truth value on a symbol, which is the reason the
reference's symbolic arm skips its own load-independence scan and its
zero-demand guard rather than deciding them; the arms here do the same and
select on N, which is always concrete. An equals IS provided,
and is structural equality of the normal form Rings keeps, not a decision
about the values the variables might take.
NO TRANSCENDENTAL FUNCTION IS AVAILABLE, so there is no log. The
reference returns lG = log(G) as a symbolic expression and MATLAB,
sympy and the C++ SymEngine backend can all represent that; a field of
rational functions cannot. Ret.pfqnNcSym therefore carries
the FORMAL expression as text and leaves the value to be taken after
substitution. See _kb/07-cross-language-parity.md.
Copyright (c) 2012-2026, Imperial College London
All rights reserved.
-
Method Summary
Modifier and TypeMethodDescriptioncontext()booleandoubleThe value at a numeric assignment of every variable.inthashCode()booleanisOne()booleanisZero()pow(int k) toString()The expression printed with the context's own variable names.cc.redberry.rings.Rational<cc.redberry.rings.poly.multivar.MultivariatePolynomial<cc.redberry.rings.bigint.BigInteger>>value()
-
Method Details
-
context
- Returns:
- the context this expression belongs to
-
value
public cc.redberry.rings.Rational<cc.redberry.rings.poly.multivar.MultivariatePolynomial<cc.redberry.rings.bigint.BigInteger>> value()- Returns:
- the underlying Rings value
-
add
- Parameters:
other- the addend- Returns:
- this + other
-
subtract
- Parameters:
other- the subtrahend- Returns:
- this - other
-
multiply
- Parameters:
other- the multiplicand- Returns:
- this * other
-
divide
- Parameters:
other- the divisor, non-zero- Returns:
- this / other
-
pow
- Parameters:
k- a non-negative exponent- Returns:
- this raised to k
-
isZero
public boolean isZero()- Returns:
- whether this is identically zero
-
isOne
public boolean isOne()- Returns:
- whether this is identically one
-
evaluate
The value at a numeric assignment of every variable.This is how a symbolic result is checked against the numeric routine: substitute, then compare. Every variable of the context must be given a value, since a partially substituted rational function is still symbolic and has no double to return.
- Parameters:
at- variable name to value- Returns:
- the value as a double
-
toString
The expression printed with the context's own variable names. -
equals
-
hashCode
public int hashCode()
-