Package com.opengamma.analytics.math.interpolation.data

Examples of com.opengamma.analytics.math.interpolation.data.InterpolatorNDDataBundle


    return sum / normSum;
  }

  @Override
  public InterpolatorNDDataBundle getDataBundle(final double[] x, final double[] y, final double[] z, final double[] values) {
    return new InterpolatorNDDataBundle(transformData(x, y, z, values));
  }
View Full Code Here


    return new InterpolatorNDDataBundle(transformData(x, y, z, values));
  }

  @Override
  public InterpolatorNDDataBundle getDataBundle(final List<Pair<double[], Double>> data) {
    return new InterpolatorNDDataBundle(data);
  }
View Full Code Here

*/
public class InterpolatorNDDataBundleTest {

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNullData() {
    new InterpolatorNDDataBundle(null);
  }
View Full Code Here

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testEmptyData() {
    final List<Pair<double[], Double>> data = new ArrayList<>();
    new InterpolatorNDDataBundle(data);
  }
View Full Code Here

  public void testEmptyData2() {
    final List<Pair<double[], Double>> data = new ArrayList<>();
    final double[] temp = new double[] {};
    final Pair<double[], Double> pair = Pair.of(temp, 0.0);
    data.add(pair);
    new InterpolatorNDDataBundle(data);
  }
View Full Code Here

      return x[2];
    }

    @Override
    public InterpolatorNDDataBundle getDataBundle(final double[] x, final double[] y, final double[] z, final double[] values) {
      return new InterpolatorNDDataBundle(transformData(x, y, z, values));
    }
View Full Code Here

      return new InterpolatorNDDataBundle(transformData(x, y, z, values));
    }

    @Override
    public InterpolatorNDDataBundle getDataBundle(final List<Pair<double[], Double>> data) {
      return new InterpolatorNDDataBundle(data);
    }
View Full Code Here

  @Test
  public void testFlat() {
    final double r0 = 1.0;
    final InterpolatorND interpolator = new RadialBasisFunctionInterpolatorND(new GaussianRadialBasisFunction(r0), false);

    final InterpolatorNDDataBundle dataBundle = interpolator.getDataBundle(FLAT_DATA);
    final double[] point = FLAT_DATA.get(5).getFirst();
    final Map<double[], Double> res = interpolator.getNodeSensitivitiesForValue(dataBundle, point);
    assertEquals(1.0, res.get(point), 0.0);
    res.remove(point);
View Full Code Here

  @Test
  public void testInverseMultiquadraticRadialBasisFunction() {
    final double r0 = 2;
    final InterpolatorND interpolator = new RadialBasisFunctionInterpolatorND(new InverseMultiquadraticRadialBasisFunction(r0), true);
    final InterpolatorNDDataBundle dataBundle = interpolator.getDataBundle(COS_EXP_DATA);
    final double[] point = COS_EXP_DATA.get(3).getFirst();
    final Map<double[], Double> res = interpolator.getNodeSensitivitiesForValue(dataBundle, point);
    assertEquals(1.0, res.get(point), 1e-13);
    res.remove(point);
View Full Code Here

  }

  protected void assertFlat(final InterpolatorND interpolator, final double tol) {
    double x1, x2, x3;
    double[] x;
    final InterpolatorNDDataBundle dataBundle = interpolator.getDataBundle(FLAT_DATA);
    for (int i = 0; i < 10; i++) {
      x1 = 10 * getRandom().nextDouble();
      x2 = 10 * getRandom().nextDouble();
      x3 = 10 * getRandom().nextDouble();
      x = new double[] {x1, x2, x3};
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.interpolation.data.InterpolatorNDDataBundle

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.