code: public static double interpolate(double[][] matrix, double tol) {
          return interpolate(matrix, tol, 2 * Math.max(matrix.length, matrix[0].length));
      }
docs: Laplace interpolation.
  @param matrix on input, values of NaN are deemed to be missing data.
  On output, they are refilled with the interpolated solution.
  @param tol the desired convergence tolerance.
  @return the estimated error.