ISDACompliantCurve extends DoublesCurve { public ISDACompliantCurve withRate(final double rate, final int index) { final int n = _t.length; ArgumentChecker.isTrue(index >= 0 && index < n, "index out of range"); final double[] t = _t.clone(); final double[] rt = _rt.clone(); rt[index] = rate * t[index]; return new ISDACompliantCurve(new double[][] {t, rt }); } protected  ISDACompliantCurve();  ISDACompliantCurve(final double t, final double r);  ISDACompliantCurve(final double[] t, final double[] r); protected  ISDACompliantCurve(final double[][] tAndRt); protected  ISDACompliantCurve(final ISDACompliantCurve from); protected  ISDACompliantCurve(final double[] timesFromBaseDate, final double[] r, final double newBaseFromOriginalBase); static ISDACompliantCurve makeFromForwardRates(final double[] t, final double[] fwd); static ISDACompliantCurve makeFromRT(final double[] t, final double[] rt); double[] getKnotTimes(); double[] getKnotZeroRates(); double getDiscountFactor(final double t); double getTimeAtIndex(final int index); double getZeroRateAtIndex(final int index); double getRTAtIndex(final int index); double getZeroRate(final double t); double getRT(final double t); double[] getRTandSensitivity(final double t, final int nodeIndex); double getForwardRate(final double t); int getNumberOfKnots(); double[] getNodeSensitivity(final double t); double getSingleNodeSensitivity(final double t, final int nodeIndex); double getSingleNodeRTSensitivity(final double t, final int nodeIndex); double getSingleNodeDiscountFactorSensitivity(final double t, final int nodeIndex); ISDACompliantCurve withOffset(final double newBaseFromOriginalBase); ISDACompliantCurve withRates(final double[] r); ISDACompliantCurve withRate(final double rate, final int index); void setRate(final double rate, final int index); ISDACompliantCurve withDiscountFactor(final double discountFactor, final int index); double[] getT(); double[] getRt(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override Double[] getYValueParameterSensitivity(final Double x); @Override double getDyDx(final double x); @Override Double[] getXData(); @Override Double[] getYData(); @Override int size(); @Override Double getYValue(final Double x); static ISDACompliantCurve.Meta meta(); @Override ISDACompliantCurve.Meta metaBean(); final Property<double[]> t(); final Property<double[]> rt(); @Override ISDACompliantCurve clone(); @Override String toString();  }
@Test public void withRateTest() { final double[] t = new double[] {0.1, 0.2, 0.5, 0.7, 1.0, 2.0, 3.0, 3.4, 10.0 }; final double[] r1 = new double[] {1.0, 0.8, 0.7, 1.2, 1.2, 1.3, 1.2, 1.0, 0.9 }; final double[] r2 = new double[] {1.0, 0.8, 0.7, 1.2, 1.2, 3.0, 1.2, 1.0, 0.9 }; final ISDACompliantCurve curve = new ISDACompliantCurve(t, r1); final ISDACompliantCurve newcurve = curve.withRate(3.0, 5); for (int i = 0; i < t.length; i++) { assertEquals("Node: " + i, newcurve.getZeroRate(t[i]), r2[i], EPS); assertEquals("Node: " + i, newcurve.getRT(t[i]), r2[i] * t[i], EPS); assertEquals("Node: " + i, newcurve.getDiscountFactor(t[i]), Math.exp(-r2[i] * t[i]), EPS); } }