Examples of FiniteSet


Examples of jmathexpr.set.FiniteSet

        Set roots = quad.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        Expression x1 = parser.parse("(5 + sqrt(13)) / 2");
        Expression x2 = parser.parse("(5 - sqrt(13)) / 2");
        Expression expected = new FiniteSet(x1, x2);
        assertEquals(expected, roots);
    }
View Full Code Here

Examples of jmathexpr.set.FiniteSet

        System.out.printf("%s : %s = ?%n", quad, x);

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

Examples of jmathexpr.set.FiniteSet

        Set roots = quad.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        Expression x1 = parser.parse("16 + sqrt(266)");
        Expression x2 = parser.parse("16 - sqrt(266)");
        Expression expected = new FiniteSet(x1, x2);
        assertEquals(expected, roots);
    }
View Full Code Here

Examples of jmathexpr.set.FiniteSet

        Set roots = quad.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
        Expression x1 = parser.parse("(sqrt(15 + 144sqrt(3)) - sqrt(15)) / 6");
        Expression x2 = parser.parse("(-sqrt(15) - sqrt(15 + 144sqrt(3))) / 6");
        Expression expected = new FiniteSet(x1, x2);
        assertEquals(expected, roots);
    }
View Full Code Here

Examples of jmathexpr.set.FiniteSet

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

Examples of jmathexpr.set.FiniteSet

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

Examples of jmathexpr.set.FiniteSet

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

Examples of jmathexpr.set.FiniteSet

//        for (Equality s : req.getSteps()) {
//            System.out.printf("    %s%n", s);
//        }
       
        assertEquals(roots, new FiniteSet(Naturals.one()));
    }
View Full Code Here

Examples of jmathexpr.set.FiniteSet

                if (satisfies(e)) {
                    checked.add(e);
                }
            }
           
            return new FiniteSet(checked);
        } else if (result instanceof EmptySet) {
            return result;
        } else {
            throw new IllegalStateException("Set type not yet supported: " + result);
        }
View Full Code Here

Examples of jmathexpr.set.FiniteSet

        return Precedence.Multiplication;
    }

    @Override
    public Set domain() {
        return new CartesianProduct(Reals.getInstance(), new Difference(Reals.getInstance(), new FiniteSet(Naturals.zero())));
    }
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.