Search in sources :

Example 6 with TermOrder

use of edu.jas.poly.TermOrder in project symja_android_library by axkr.

the class GroebnerBasis method evaluate.

@Override
public IExpr evaluate(final IAST ast, EvalEngine engine) {
    if (ast.size() >= 3) {
        if (ast.arg1().isVector() < 0 || ast.arg2().isVector() < 0) {
            return F.NIL;
        }
        TermOrder termOrder = TermOrderByName.Lexicographic;
        if (ast.size() > 3) {
            final Options options = new Options(ast.topHead(), ast, ast.size() - 1, engine);
            termOrder = options.getMonomialOrder(ast, termOrder);
        }
        IAST polys = (IAST) ast.arg1();
        IAST vars = (IAST) ast.arg2();
        if (vars.size() <= 1) {
            return F.NIL;
        }
        return computeGroebnerBasis(polys, vars, termOrder);
    }
    return F.NIL;
}
Also used : Options(org.matheclipse.core.eval.util.Options) TermOrder(edu.jas.poly.TermOrder) IAST(org.matheclipse.core.interfaces.IAST)

Aggregations

TermOrder (edu.jas.poly.TermOrder)6 IAST (org.matheclipse.core.interfaces.IAST)5 IExpr (org.matheclipse.core.interfaces.IExpr)4 JASConversionException (org.matheclipse.core.eval.exception.JASConversionException)3 Options (org.matheclipse.core.eval.util.Options)3 ExprTermOrder (org.matheclipse.core.polynomials.ExprTermOrder)3 BigRational (edu.jas.arith.BigRational)2 GenPolynomial (edu.jas.poly.GenPolynomial)2 JASIExpr (org.matheclipse.core.convert.JASIExpr)2 VariablesSet (org.matheclipse.core.convert.VariablesSet)2 IStringX (org.matheclipse.core.interfaces.IStringX)2 ExprPolynomial (org.matheclipse.core.polynomials.ExprPolynomial)2 ExprPolynomialRing (org.matheclipse.core.polynomials.ExprPolynomialRing)2 BigInteger (edu.jas.arith.BigInteger)1 ModLong (edu.jas.arith.ModLong)1 Complex (edu.jas.poly.Complex)1 ComplexRing (edu.jas.poly.ComplexRing)1 GenPolynomialRing (edu.jas.poly.GenPolynomialRing)1 FactorComplex (edu.jas.ufd.FactorComplex)1 ArrayList (java.util.ArrayList)1