Package com.opengamma.analytics.math.interpolation

Examples of com.opengamma.analytics.math.interpolation.LinearExtrapolator1D


  public static void interpolatorExtrapolatorDoublesCurveDemo(PrintStream out) {
    double[] xdata = {1.0, 2.0, 3.0};
    double[] ydata = {2.0, 4.0, 6.0};

    Interpolator1D interpolator = new LinearInterpolator1D();
    Interpolator1D leftExtrapolator = new LinearExtrapolator1D(interpolator);
    Interpolator1D rightExtrapolator = new LinearExtrapolator1D(interpolator);
    Interpolator1D combined = new CombinedInterpolatorExtrapolator(interpolator, leftExtrapolator, rightExtrapolator);

    Curve<Double, Double> curve = new InterpolatedDoublesCurve(xdata, ydata, combined, true);

    out.println(curve.getYValue(1.0));
View Full Code Here


    private Interpolator1D getExtrapolator(final String extrapolatorName, final Interpolator1D interpolator) {
      if (extrapolatorName.equals(Interpolator1DFactory.FLAT_EXTRAPOLATOR)) {
        return new FlatExtrapolator1D();
      }
      if (extrapolatorName.equals(Interpolator1DFactory.LINEAR_EXTRAPOLATOR)) {
        return new LinearExtrapolator1D(interpolator);
      }
      return Interpolator1DFactory.getInterpolator(extrapolatorName);
      //return null;
    }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.interpolation.LinearExtrapolator1D

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.