Package com.opengamma.analytics.math.curve

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


    assertFalse(other.equals(curve));
  }

  @Test
  public void testParallel() {
    final InterpolatedCurveShiftFunction f = new InterpolatedCurveShiftFunction();
    final VolatilityCurve vol = new VolatilityCurve(CURVE);
    VolatilityCurve shifted1 = vol.withParallelShift(3);
    InterpolatedDoublesCurve shifted2 = f.evaluate(CURVE, 3.);
    assertArrayEquals(shifted1.getCurve().getXData(), shifted2.getXData());
    assertArrayEquals(shifted1.getCurve().getYData(), shifted2.getYData());
    shifted1 = vol.withSingleShift(1, 3);
    shifted2 = f.evaluate(CURVE, 1, 3.);
    assertArrayEquals(shifted1.getCurve().getXData(), shifted2.getXData());
    assertArrayEquals(shifted1.getCurve().getYData(), shifted2.getYData());
    shifted1 = vol.withMultipleShifts(new double[] {1, 2}, new double[] {3, 4});
    shifted2 = f.evaluate(CURVE, new double[] {1, 2}, new double[] {3, 4});
    assertArrayEquals(shifted1.getCurve().getXData(), shifted2.getXData());
    assertArrayEquals(shifted1.getCurve().getYData(), shifted2.getYData());
  }
View Full Code Here

TOP

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

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.