Package com.opengamma.analytics.math.curve

Examples of com.opengamma.analytics.math.curve.NodalDoublesCurve


    }
    return FORMATTING_ERROR;
  }
 
  private List<Double[]> formatExpanded(DoublesCurve value) {
    NodalDoublesCurve detailedCurve;
    if (value instanceof NodalDoublesCurve) {
      detailedCurve = (NodalDoublesCurve) value;
    } else if (value instanceof InterpolatedDoublesCurve) {
      InterpolatedDoublesCurve interpolatedCurve = (InterpolatedDoublesCurve) value;
      detailedCurve = NodalDoublesCurve.from(interpolatedCurve.getXDataAsPrimitive(), interpolatedCurve.getYDataAsPrimitive());
    } else {
      throw new OpenGammaRuntimeException("Cannot handle curves of type " + value.getClass());
    }
    List<Double[]> detailedData = new ArrayList<>();
    Double[] xs = detailedCurve.getXData();
    Double[] ys = detailedCurve.getYData();
    for (int i = 0; i < ys.length; i++) {
      detailedData.add(new Double[]{xs[i], ys[i]});
    }
    return detailedData;
  }
View Full Code Here


      return null;
    }
  }

  private List<Double[]> formatExpanded(PriceIndexCurve value) {
    NodalDoublesCurve detailedCurve = YieldCurveInterpolatingFunction.interpolateCurve(value.getCurve());
    List<Double[]> detailedData = new ArrayList<Double[]>();
    Double[] xs = detailedCurve.getXData();
    Double[] ys = detailedCurve.getYData();
    for (int i = 0; i < ys.length; i++) {
      detailedData.add(new Double[]{xs[i], ys[i]});
    }
    return detailedData;
  }
View Full Code Here

    s_logger.warn("Unable to format curve of type {}", value.getCurve().getClass());
    return null;
  }

  private List<Double[]> formatExpanded(ISDADateCurve value) {
    NodalDoublesCurve detailedCurve = YieldCurveInterpolatingFunction.interpolateCurve(value.getCurve());
    List<Double[]> detailedData = new ArrayList<>();
    Double[] xs = detailedCurve.getXData();
    Double[] ys = detailedCurve.getYData();
    for (int i = 0; i < ys.length; i++) {
      detailedData.add(new Double[]{xs[i], ys[i]});
    }
    return detailedData;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.curve.NodalDoublesCurve

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.