Package jmathexpr.util.parser

Examples of jmathexpr.util.parser.ExpressionParser


        assertEquals(roots, new FiniteSet(Naturals.getInstance().create(17)));
    }

    @Test(dependsOnMethods = { "oneRadical" })
    public void toIsolate() throws EquationSolveException {
        Equation req = (Equation) new ExpressionParser().parse("sqrt(x - 10) - 4 = 0");
        Variable x = req.variable();
        System.out.printf("%s : %s = ?%n", req, x);
       
        Set roots = req.solve();
        System.out.printf("  %s = %s%n", x, roots);
View Full Code Here


        assertEquals(roots, new FiniteSet(Naturals.getInstance().create(26)));
    }

    @Test(dependsOnMethods = { "toIsolate" })
    public void radicalAndLinear() throws EquationSolveException {
        Equation req = (Equation) new ExpressionParser().parse("sqrt(x + 1) - 3x = 1");
        Variable x = req.variable();
        System.out.printf("%s : %s = ?%n", req, x);
       
        Set roots = req.solve();
        System.out.printf("  %s = %s%n", x, roots);
View Full Code Here

        assertEquals(roots, new FiniteSet(Naturals.getInstance().create(0)));
    }

    @Test(dependsOnMethods = { "radicalAndLinear" })
    public void twoRadicals() throws EquationSolveException {
        Equation req = (Equation) new ExpressionParser().parse("sqrt(x) + sqrt(x - 5) = 1");
        Variable x = req.variable();
        System.out.printf("%s : %s = ?%n", req, x);
       
        Set roots = req.solve();
        System.out.printf("  %s = %s%n", x, roots);
View Full Code Here

        assertEquals(roots, new EmptySet());
    }

    @Test(dependsOnMethods = { "twoRadicals" })
    public void threeRadicals() throws EquationSolveException {
        Equation req = (Equation) new ExpressionParser().parse("sqrt(x + 8) + sqrt(x + 15) = sqrt(9x + 40)");
        Variable x = req.variable();
        System.out.printf("%s : %s = ?%n", req, x);
       
        Set roots = req.solve();
        System.out.printf("  %s = %s%n", x, roots);
View Full Code Here

TOP

Related Classes of jmathexpr.util.parser.ExpressionParser

Copyright © 2018 www.massapicom. 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.