Package jmathexpr.util.pattern

Examples of jmathexpr.util.pattern.TerminationPattern.hit()


        TerminationPattern c = Numbers.constant("c");
        TerminationPattern n = Numbers.constant("n");
        ExpressionPattern cxn = new Multiplication(c, new Exponentiation(x, n));

        if (cxn.matches(term)) {
            coeffs.put((NaturalNumber) n.hit(), c.hit());
        } else {
            throw new IllegalArgumentException("Illegal polynomial term: " + term);
        }
       
        return new Polynomial(coeffs, x);
View Full Code Here


        for (Expression e : evaluated) {
            if (e.isConstant()) {
                if (e instanceof ANumber) { // 1 -> numbers
                    addToSelectionMap(selected, Naturals.one(), (ANumber) e);
                } else if (p.matches(e)) {
                    addToSelectionMap(selected, c.hit(), a.hit());
                } else {
                    addToSelectionMap(selected, e, Naturals.one());
                }
            }
        }
View Full Code Here

       
        for (Expression e : evaluated) {
            if (e.isConstant()) {
                continue;
            } else if (p.matches(e)) {
                addToSelectionMap(selected, f.hit(), c.hit());
            } else {
                addToSelectionMap(selected, e, Naturals.one());
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.