Package com.opengamma.analytics.math.function

Examples of com.opengamma.analytics.math.function.DoubleFunction1D.derivative()


        polynomials[i] = Pair.of(getOne(), getZero());
      } else if (i == 1) {
        polynomials[i] = Pair.of(getX(), getOne());
      } else {
        p = (polynomials[i - 1].getFirst().multiply(getX()).multiply(2 * i - 1).subtract(polynomials[i - 2].getFirst().multiply(i - 1))).multiply(1. / i);
        dp = p.derivative();
        polynomials[i] = Pair.of(p, dp);
      }
    }
    return polynomials;
  }
View Full Code Here


  public Double getRoot(final Function1D<Double, Double> function, final Double x) {
    Validate.notNull(function, "function");
    Validate.notNull(x, "x");
    final DoubleFunction1D f = DoubleFunction1D.from(function);
    return getRoot(f, f.derivative(), x);
  }

  /**
   * Uses the {@link com.opengamma.analytics.math.function.DoubleFunction1D#derivative()} method. <i>x<sub>1</sub></i> and <i>x<sub>2</sub></i> do not have to be increasing.
   * @param function The function, not null
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.