data.add(new Double[] {xData[i], yData[i]});
}
result.put("summary", data);
if (mode == ConversionMode.FULL) {
NodalDoublesCurve detailedCurve = YieldCurveInterpolatingFunction.interpolateCurve(interpolatedCurve);
List<Double[]> detailedData = getData(detailedCurve);
result.put("detailed", detailedData);
}
return result;
} else if (value.getCurve() instanceof FunctionalDoublesCurve) {
FunctionalDoublesCurve curve = (FunctionalDoublesCurve) value.getCurve();
int n = 34;
List<Double[]> data = new ArrayList<Double[]>();
double[] xData = new double[n];
double[] yData = new double[n];
for (int i = 0; i < n; i++) {
if (i == 0) {
xData[0] = 1. / 12;
} else if (i == 1) {
xData[1] = 0.25;
} else if (i == 2) {
xData[2] = 0.5;
} else if (i == 3) {
xData[3] = 0.75;
} else {
xData[i] = i - 3;
}
yData[i] = curve.getYValue(xData[i]);
data.add(new Double[]{xData[i], yData[i]});
}
result.put("summary", data);
if (mode == ConversionMode.FULL) {
NodalDoublesCurve detailedCurve = YieldCurveInterpolatingFunction.interpolateCurve(curve);
List<Double[]> detailedData = getData(detailedCurve);
result.put("detailed", detailedData);
}
return result;
}