public double interp(final double[] pt) {
    double fval, sum=0., sumw=0.;
    if (pt.length != dim) throw new IllegalArgumentException("RBF_interp bad pt size");
    for (int i=0;i<n;i++) {
      fval = fn.rbf(rad(pt,pts[i]));
      sumw += w[i]*fval;
      sum += fval;
    }
    return norm ? sumw/sum : sumw;
  }