Examples of Sin


Examples of org.apache.commons.math3.analysis.function.Sin

    /**
     *
     */
    @Test
    public void testSinZero() {
        DifferentiableUnivariateFunction f = new Sin();
        double result;

        NewtonSolver solver = new NewtonSolver();
        result = solver.solve(100, f, 3, 4);
        Assert.assertEquals(result, FastMath.PI, solver.getAbsoluteAccuracy());
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Sin

/**
*/
public final class BisectionSolverTest {
    @Test
    public void testSinZero() {
        UnivariateFunction f = new Sin();
        double result;

        BisectionSolver solver = new BisectionSolver();
        result = solver.solve(100, f, 3, 4);
        Assert.assertEquals(result, FastMath.PI, solver.getAbsoluteAccuracy());
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Sin

        Assert.assertTrue(solver.getEvaluations() > 0);
    }

    @Test
    public void testMath369() {
        UnivariateFunction f = new Sin();
        BisectionSolver solver = new BisectionSolver();
        Assert.assertEquals(FastMath.PI, solver.solve(100, f, 3.0, 3.2, 3.1), solver.getAbsoluteAccuracy());
    }
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Sin

    /**
     * Test of solver for the sine function.
     */
    @Test
    public void testSinFunction() {
        UnivariateFunction f = new Sin();
        UnivariateSolver solver = new RiddersSolver();
        double min, max, expected, result, tolerance;

        min = 3.0; max = 4.0; expected = FastMath.PI;
        tolerance = FastMath.max(solver.getAbsoluteAccuracy(),
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Sin

    /**
     * Test of parameters for the solver.
     */
    @Test
    public void testParameters() {
        UnivariateFunction f = new Sin();
        UnivariateSolver solver = new RiddersSolver();

        try {
            // bad interval
            solver.solve(100, f, 1, -1);
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Sin

    /**
     * Test of solver for the sine function.
     */
    @Test
    public void testSinFunction() {
        UnivariateFunction f = new Sin();
        UnivariateSolver solver = new MullerSolver2();
        double min, max, expected, result, tolerance;

        min = 3.0; max = 4.0; expected = FastMath.PI;
        tolerance = FastMath.max(solver.getAbsoluteAccuracy(),
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Sin

    /**
     * Test of parameters for the solver.
     */
    @Test
    public void testParameters() {
        UnivariateFunction f = new Sin();
        UnivariateSolver solver = new MullerSolver2();

        try {
            // bad interval
            solver.solve(100, f, 1, -1);
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Sin

*/
public final class BrentOptimizerTest {

    @Test
    public void testSinMin() {
        UnivariateFunction f = new Sin();
        UnivariateOptimizer optimizer = new BrentOptimizer(1e-10, 1e-14);
        Assert.assertEquals(3 * Math.PI / 2, optimizer.optimize(new MaxEval(200),
                                                                new UnivariateObjectiveFunction(f),
                                                                GoalType.MINIMIZE,
                                                                new SearchInterval(4, 5)).getPoint(), 1e-8);
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Sin

        }
    }

    @Test
    public void testSinMinWithValueChecker() {
        final UnivariateFunction f = new Sin();
        final ConvergenceChecker<UnivariatePointValuePair> checker = new SimpleUnivariateValueChecker(1e-5, 1e-14);
        // The default stopping criterion of Brent's algorithm should not
        // pass, but the search will stop at the given relative tolerance
        // for the function value.
        final UnivariateOptimizer optimizer = new BrentOptimizer(1e-10, 1e-14, checker);
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Sin

        }
    }

    @Test
    public void testMinEndpoints() {
        UnivariateFunction f = new Sin();
        UnivariateOptimizer optimizer = new BrentOptimizer(1e-8, 1e-14);

        // endpoint is minimum
        double result = optimizer.optimize(new MaxEval(50),
                                           new UnivariateObjectiveFunction(f),
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.