Package com.opengamma.analytics.math.interpolation.data

Examples of com.opengamma.analytics.math.interpolation.data.Interpolator1DPiecewisePoynomialDataBundle


   */
  public Interpolator1DDataBundle getDataBundleFromSortedArrays(final double[] x, final double[] y, final double leftCond, final double rightCond) {
    if (!(_baseMethod.getPrimaryMethod() instanceof CubicSplineInterpolator)) {
      throw new IllegalArgumentException("No degrees of freedom at endpoints for this interpolation method");
    }
    return new Interpolator1DPiecewisePoynomialDataBundle(new ArrayInterpolator1DDataBundle(x, y, true), this._baseMethod, leftCond, rightCond);
  }
View Full Code Here


    super(new CubicSplineInterpolator());
  }

  @Override
  public Interpolator1DDataBundle getDataBundle(final double[] x, final double[] y) {
    return new Interpolator1DPiecewisePoynomialDataBundle(new ArrayInterpolator1DDataBundle(x, y, false), new CubicSplineInterpolator(), 0., 0.);
  }
View Full Code Here

    return new Interpolator1DPiecewisePoynomialDataBundle(new ArrayInterpolator1DDataBundle(x, y, false), new CubicSplineInterpolator(), 0., 0.);
  }

  @Override
  public Interpolator1DDataBundle getDataBundleFromSortedArrays(final double[] x, final double[] y) {
    return new Interpolator1DPiecewisePoynomialDataBundle(new ArrayInterpolator1DDataBundle(x, y, true), new CubicSplineInterpolator(), 0., 0.);
  }
View Full Code Here

    final double eps = 1e-10;

    Validate.notNull(value, "value");
    Validate.notNull(data, "data bundle");
    Validate.isTrue(data instanceof Interpolator1DPiecewisePoynomialDataBundle);
    final Interpolator1DPiecewisePoynomialDataBundle polyData = (Interpolator1DPiecewisePoynomialDataBundle) data;

    ArgumentChecker.isFalse(value < 0, "value must be zero or positive");
    if (value == 0) {
      return 0.0;
    }

    // TODO direct evaluation using coefficients
    final double t = Math.max(eps, value); // Avoid divide by zero
    final DoubleMatrix1D res = FUNC.evaluate(polyData.getPiecewisePolynomialResultsWithSensitivity(), t);
    return res.getEntry(0) / t;
  }
View Full Code Here

    final double eps = 1e-10;

    Validate.notNull(value, "value");
    Validate.notNull(data, "data bundle");
    Validate.isTrue(data instanceof Interpolator1DPiecewisePoynomialDataBundle);
    final Interpolator1DPiecewisePoynomialDataBundle polyData = (Interpolator1DPiecewisePoynomialDataBundle) data;

    ArgumentChecker.isFalse(value < 0, "value must be zero or positive");
    if (value == 0) {
      return 0.0;
    }

    final double t = Math.max(eps, value);
    final DoubleMatrix1D resValue = FUNC.evaluate(polyData.getPiecewisePolynomialResultsWithSensitivity(), t);
    final DoubleMatrix1D resDerivative = FUNC.differentiate(polyData.getPiecewisePolynomialResultsWithSensitivity(), t);
    return (resDerivative.getEntry(0) - resValue.getEntry(0) / t) / t;
  }
View Full Code Here

        xy[i] = x[i] * y[i];
      }
    }

    //    final PiecewisePolynomialResult poly = BASE.interpolate(xx, xy);
    return new Interpolator1DPiecewisePoynomialDataBundle(new ArrayInterpolator1DDataBundle(xx, xy, true), new PiecewiseCubicHermiteSplineInterpolatorWithSensitivity());
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.interpolation.data.Interpolator1DPiecewisePoynomialDataBundle

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.