Package jmathexpr.set

Examples of jmathexpr.set.FiniteSet


        System.out.printf("%s : %s = ?%n", abs, x);
       
        Set roots = abs.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        Expression expected = new FiniteSet(Naturals.getInstance().create(3), Integers.getInstance().create(-2));
        assertEquals(expected, roots);
    }
View Full Code Here


        System.out.printf("%s : %s = ?%n", abs, x);
       
        Set roots = abs.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        Expression expected = new FiniteSet(Rationals.getInstance().create(13, 5), Rationals.getInstance().create(-1, 5));
        assertEquals(expected, roots);
    }
View Full Code Here

        System.out.printf("%s : %s = ?%n", abs, x);
       
        Set roots = abs.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        Expression expected = new FiniteSet(Integers.getInstance().create(-2), Rationals.getInstance().create(-1, 3));
        assertEquals(expected, roots);
    }
View Full Code Here

        Set roots = abs.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        Expression x1 = parser.parse("(15 + sqrt(249)) / 4");
        Expression x2 = parser.parse("(15 - sqrt(249)) / 4");
        Expression expected = new FiniteSet(x1, x2, Rationals.getInstance().create(7, 2), Naturals.one());
        assertEquals(expected, roots);
    }
View Full Code Here

        Set roots = abs.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        Expression x1 = parser.parse("sqrt(3)");
        Expression x2 = Integers.getInstance().create("-3");
        Expression expected = new FiniteSet(x1, x2);
        assertEquals(expected, roots);
    }
View Full Code Here

        System.out.printf("%s : %s = ?%n", lineq, x);
       
        Set    roots = lineq.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        assertEquals(roots, new FiniteSet(Naturals.getInstance().create(8)));
    }
View Full Code Here

        System.out.printf("%s : %s = ?%n", lineq, x);
       
        Set    roots = lineq.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        assertEquals(roots, new FiniteSet(Rationals.getInstance().create(-21, 4)));
    }
View Full Code Here

        System.out.printf("%s : %s = ?%n", lineq, x);
       
        Set    roots = lineq.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        assertEquals(roots, new FiniteSet(Naturals.getInstance().create(10)));
    }
View Full Code Here

        System.out.printf("%s : %s = ?%n", lineq, x);
       
        Set    roots = lineq.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        assertEquals(roots, new FiniteSet(Naturals.getInstance().create(3)));
    }
View Full Code Here

//            System.out.printf("    %s%n", e);
//        }
       
        Expression expected = new ExpressionParser().parse("(sqrt(5) + sqrt(3)) / sqrt(2)");
       
        assertEquals(roots, new FiniteSet(expected));
    }
View Full Code Here

TOP

Related Classes of jmathexpr.set.FiniteSet

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.