symja_android_library
symja_android_library copied to clipboard
Improve homogenization step in factoring
Improve the homogenization step in the factoring algorithm:
- https://www.research.ed.ac.uk/portal/files/413486/Solving_Symbolic_Equations_%20with_PRESS.pdf
See the homog_ methods in the Prolog repository:
- https://github.com/maths/PRESS/tree/master/pressdir/methods
Here you can find the current implementation:
- https://github.com/axkr/symja_android_library/blob/master/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/polynomials/PolynomialHomogenization.java
Usage:
...
PolynomialHomogenization substitutions =
new PolynomialHomogenization(eVar.getVarList(), engine);
IExpr subsPolynomial = substitutions.replaceForward(expr);
if (substitutions.size() == 0) {
// no substitution
return ... ;
}
if (subsPolynomial.isAST()) {
eVar.addAll(substitutions.substitutedVariablesSet());
IExpr factorization = ...;
if (factorization.isPresent()) {
return substitutions.replaceBackward(factorization);
}
}