Package org.apache.commons.math.analysis

Examples of org.apache.commons.math.analysis.DifferentiableUnivariateRealFunction


*/
public final class NewtonSolverTest extends TestCase {

    @Deprecated
    public void testDeprecated() throws MathException {
        DifferentiableUnivariateRealFunction f = new SinFunction();
        double result;

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


    /**
    *
    */
   public void testSinZero() throws MathException {
       DifferentiableUnivariateRealFunction f = new SinFunction();
       double result;

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

   /**
     *
     */
    public void testQuinticZero() throws MathException {
        DifferentiableUnivariateRealFunction f = new QuinticFunction();
        double result;

        UnivariateRealSolver solver = new NewtonSolver();
        result = solver.solve(f, -0.2, 0.2);
        assertEquals(result, 0, solver.getAbsoluteAccuracy());
View Full Code Here

    *   @throws IllegalArgumentException if the domain of the new segment overlaps with the domain of another one
    */
    @Override
    public synchronized boolean addSegmentFunction(SegmentFunction f){
        //this will throw the required class cast exception
        @SuppressWarnings("unused")
        DifferentiableUnivariateRealFunction func = (DifferentiableUnivariateRealFunction) f.func;
        for(SegmentFunction other : elements){
            if(f.domain.overlaps(other.domain) && ! f.equals(other)){
                throw new IllegalArgumentException("The domain of this SegmentFunction overlaps with that of another one.");
            }
View Full Code Here

                fHSpeed.addSegmentFunction(tmin, tmax, smooth(time, dist)
                        .derivative());
                fVSpeed.addSegmentFunction(tmin, tmax,
                        smooth(fEle.getSegmentFor(tmin), tmin, tmax, n)
                                .derivative());
                final DifferentiableUnivariateRealFunction latseg = smooth(
                        fLati.getSegmentFor(tmin), tmin, tmax, n);
                fBearing.addSegmentFunction(tmin, tmax, new BearingFunction(
                        smooth(fLongi.getSegmentFor(tmin), tmin, tmax, n)
                                .derivative(), latseg.derivative(), latseg));

                /* Calculate total ascent and total descent */
                List<Double> vpoints = getZeros(fVSpeed, time);
                vpoints.add(tmax);
                double z0 = fEle.value(tmin);
View Full Code Here

*/
public final class NewtonSolverTest extends TestCase {

    @Deprecated
    public void testDeprecated() throws MathException {
        DifferentiableUnivariateRealFunction f = new SinFunction();
        double result;

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

    /**
    *
    */
   public void testSinZero() throws MathException {
       DifferentiableUnivariateRealFunction f = new SinFunction();
       double result;

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

   /**
     *
     */
    public void testQuinticZero() throws MathException {
        DifferentiableUnivariateRealFunction f = new QuinticFunction();
        double result;

        UnivariateRealSolver solver = new NewtonSolver();
        result = solver.solve(f, -0.2, 0.2);
        assertEquals(result, 0, solver.getAbsoluteAccuracy());
View Full Code Here

*/
public final class NewtonSolverTest extends TestCase {

    @Deprecated
    public void testDeprecated() throws MathException {
        DifferentiableUnivariateRealFunction f = new SinFunction();
        double result;
       
        UnivariateRealSolver solver = new NewtonSolver(f);
        result = solver.solve(3, 4);
        assertEquals(result, Math.PI, solver.getAbsoluteAccuracy());
View Full Code Here

    /**
    *
    */
   public void testSinZero() throws MathException {
       DifferentiableUnivariateRealFunction f = new SinFunction();
       double result;
      
       UnivariateRealSolver solver = new NewtonSolver();
       result = solver.solve(f, 3, 4);
       assertEquals(result, Math.PI, solver.getAbsoluteAccuracy());
View Full Code Here

TOP

Related Classes of org.apache.commons.math.analysis.DifferentiableUnivariateRealFunction

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.