if (xLen == 0 || yLen == 0 || z.length == 0 || z[0].length == 0) {
throw MathRuntimeException.createIllegalArgumentException("no data");
}
if (xLen != z.length) {
throw new DimensionMismatchException(xLen, z.length);
}
if (xLen != dZdX.length) {
throw new DimensionMismatchException(xLen, dZdX.length);
}
if (xLen != dZdY.length) {
throw new DimensionMismatchException(xLen, dZdY.length);
}
if (xLen != dZdXdY.length) {
throw new DimensionMismatchException(xLen, dZdXdY.length);
}
MathUtils.checkOrder(x, 1, true);
MathUtils.checkOrder(y, 1, true);
xval = x.clone();
yval = y.clone();
final int lastI = xLen - 1;
final int lastJ = yLen - 1;
splines = new BicubicSplineFunction[lastI][lastJ];
for (int i = 0; i < lastI; i++) {
if (z[i].length != yLen) {
throw new DimensionMismatchException(z[i].length, yLen);
}
if (dZdX[i].length != yLen) {
throw new DimensionMismatchException(dZdX[i].length, yLen);
}
if (dZdY[i].length != yLen) {
throw new DimensionMismatchException(dZdY[i].length, yLen);
}
if (dZdXdY[i].length != yLen) {
throw new DimensionMismatchException(dZdXdY[i].length, yLen);
}
final int ip1 = i + 1;
for (int j = 0; j < lastJ; j++) {
final int jp1 = j + 1;
final double[] beta = new double[] {