class ShepardInterpolatorND extends InterpolatorND {

  @Override
  public Double interpolate(final InterpolatorNDDataBundle data, final double[] x) {
    validateInput(data, x);

    final List<Pair<double[], Double>> rawData = data.getData();

    final int n = rawData.size();
    double sum = 0;
    double normSum = 0;
    double[] xi;
    double yi;
    double phi;
    double dist;
    Pair<double[], Double> temp;
    for (int i = 0; i < n; i++) {
      temp = rawData.get(i);
      xi = temp.getFirst();
      yi = temp.getSecond();
      dist = DistanceCalculator.getDistance(x, xi);
      if (dist == 0.0) {
        return yi;
      }
      phi = _basisFunction.evaluate(dist);
      sum += yi * phi;
      normSum += phi;
    }

    return sum / normSum;
  }

  public  ShepardInterpolatorND(final double power);

}