Examples of PolynomialFunctionLagrangeForm


Examples of org.apache.commons.math.analysis.polynomials.PolynomialFunctionLagrangeForm

     * @return a function which interpolates the data set
     * @throws MathException if arguments are invalid
     */
    public PolynomialFunctionLagrangeForm interpolate(double x[], double y[])
        throws MathException {
        return new PolynomialFunctionLagrangeForm(x, y);
    }
View Full Code Here

Examples of org.apache.commons.math.analysis.polynomials.PolynomialFunctionLagrangeForm

     * @return a function which interpolates the data set
     * @throws MathException if arguments are invalid
     */
    public PolynomialFunctionLagrangeForm interpolate(double x[], double y[])
        throws MathException {
        return new PolynomialFunctionLagrangeForm(x, y);
    }
View Full Code Here

Examples of org.apache.commons.math.analysis.polynomials.PolynomialFunctionLagrangeForm

      throw new MathException("Could not get upper bound: index " + upperBound + " must be less than or equal to " + (n + 1));
    }
    final double[] x = Arrays.copyOfRange(keys, lowerBound, upperBound);
    final double[] y = Arrays.copyOfRange(values, lowerBound, upperBound);
    try {
      final PolynomialFunctionLagrangeForm lagrange = _interpolator.interpolate(x, y);
      return CommonsMathWrapper.unwrap(lagrange).evaluate(value);
    } catch (final org.apache.commons.math.MathException e) {
      throw new MathException(e);
    }
  }
View Full Code Here

Examples of org.apache.commons.math.analysis.polynomials.PolynomialFunctionLagrangeForm

    final double[] y = new double[n];
    for (int i = 0; i < n; i++) {
      x[i] = i;
      y[i] = OG_POLYNOMIAL.evaluate(x[i]);
    }
    final Function1D<Double, Double> unwrapped = CommonsMathWrapper.unwrap(new PolynomialFunctionLagrangeForm(x, y));
    for (int i = 0; i < 100; i++) {
      assertEquals(unwrapped.evaluate(i + 0.5), OG_POLYNOMIAL.evaluate(i + 0.5), 1e-9);
    }
  }
View Full Code Here

Examples of org.apache.commons.math3.analysis.polynomials.PolynomialFunctionLagrangeForm

     */
    public PolynomialFunctionLagrangeForm interpolate(double x[], double y[])
        throws DimensionMismatchException,
               NumberIsTooSmallException,
               NonMonotonicSequenceException {
        return new PolynomialFunctionLagrangeForm(x, y);
    }
View Full Code Here

Examples of org.apache.commons.math3.analysis.polynomials.PolynomialFunctionLagrangeForm

     * the number of points is less than 2.
     * @throws org.apache.commons.math3.exception.NonMonotonicSequenceException
     * if two abscissae have the same value.
     */
    public PolynomialFunctionLagrangeForm interpolate(double x[], double y[]) {
        return new PolynomialFunctionLagrangeForm(x, y);
    }
View Full Code Here

Examples of org.apache.commons.math3.analysis.polynomials.PolynomialFunctionLagrangeForm

     */
    public PolynomialFunctionLagrangeForm interpolate(double x[], double y[])
        throws DimensionMismatchException,
               NumberIsTooSmallException,
               NonMonotonicSequenceException {
        return new PolynomialFunctionLagrangeForm(x, y);
    }
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.