@Test public void testInterpolate() { System.out.println("interpolate"); double[][] x = {{0, 0}, {1, 1}}; double[] y = {0, 1}; RBFInterpolation instance = new RBFInterpolation(x, y, new GaussianRadialBasis()); double[] x1 = {0.5, 0.5}; assertEquals(0, instance.interpolate(x[0]), 1E-7); assertEquals(1, instance.interpolate(x[1]), 1E-7); assertEquals(0.569349, instance.interpolate(x1), 1E-6); }
public double interpolate(double... x) { if (x.length != this.x[0].length) { throw new IllegalArgumentException(String.format("Invalid input vector size: %d, expected: %d", x.length, this.x[0].length)); } double sum = 0.0, sumw = 0.0; for (int i = 0; i < this.x.length; i++) { double f = rbf.f(MathEx.distance(x, this.x[i])); sumw += w[i] * f; sum += f; } return normalized ? sumw / sum : sumw; }
RBFInterpolation { public double interpolate(double... x) { if (x.length != this.x[0].length) { throw new IllegalArgumentException(String.format("Invalid input vector size: %d, expected: %d", x.length, this.x[0].length)); } double sum = 0.0, sumw = 0.0; for (int i = 0; i < this.x.length; i++) { double f = rbf.f(MathEx.distance(x, this.x[i])); sumw += w[i] * f; sum += f; } return normalized ? sumw / sum : sumw; } }
RBFInterpolation { public double interpolate(double... x) { if (x.length != this.x[0].length) { throw new IllegalArgumentException(String.format("Invalid input vector size: %d, expected: %d", x.length, this.x[0].length)); } double sum = 0.0, sumw = 0.0; for (int i = 0; i < this.x.length; i++) { double f = rbf.f(MathEx.distance(x, this.x[i])); sumw += w[i] * f; sum += f; } return normalized ? sumw / sum : sumw; } RBFInterpolation(double[][] x, double[] y, RadialBasisFunction normalized);  RBFInterpolation(double[][] x, double[] y, RadialBasisFunction rbf, boolean normalized); }
RBFInterpolation { public double interpolate(double... x) { if (x.length != this.x[0].length) { throw new IllegalArgumentException(String.format("Invalid input vector size: %d, expected: %d", x.length, this.x[0].length)); } double sum = 0.0, sumw = 0.0; for (int i = 0; i < this.x.length; i++) { double f = rbf.f(MathEx.distance(x, this.x[i])); sumw += w[i] * f; sum += f; } return normalized ? sumw / sum : sumw; } RBFInterpolation(double[][] x, double[] y, RadialBasisFunction normalized);  RBFInterpolation(double[][] x, double[] y, RadialBasisFunction rbf, boolean normalized); double interpolate(double... x); @Override String toString(); }
RBFInterpolation { public double interpolate(double... x) { if (x.length != this.x[0].length) { throw new IllegalArgumentException(String.format("Invalid input vector size: %d, expected: %d", x.length, this.x[0].length)); } double sum = 0.0, sumw = 0.0; for (int i = 0; i < this.x.length; i++) { double f = rbf.f(MathEx.distance(x, this.x[i])); sumw += w[i] * f; sum += f; } return normalized ? sumw / sum : sumw; } RBFInterpolation(double[][] x, double[] y, RadialBasisFunction normalized);  RBFInterpolation(double[][] x, double[] y, RadialBasisFunction rbf, boolean normalized); double interpolate(double... x); @Override String toString();  }