diff --git a/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java b/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java index 9515dde87..626d9addb 100644 --- a/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java +++ b/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java @@ -82,13 +82,13 @@ public class SplineInterpolator implements UnivariateInterpolator { MathArrays.checkOrder(x); // Differences between knot points - final double h[] = new double[n]; + final double[] h = new double[n]; for (int i = 0; i < n; i++) { h[i] = x[i + 1] - x[i]; } - final double mu[] = new double[n]; - final double z[] = new double[n + 1]; + final double[] mu = new double[n]; + final double[] z = new double[n + 1]; mu[0] = 0d; z[0] = 0d; double g = 0; @@ -100,9 +100,9 @@ public class SplineInterpolator implements UnivariateInterpolator { } // cubic spline coefficients -- b is linear, c quadratic, d is cubic (original y's are constants) - final double b[] = new double[n]; - final double c[] = new double[n + 1]; - final double d[] = new double[n]; + final double[] b = new double[n]; + final double[] c = new double[n + 1]; + final double[] d = new double[n]; z[n] = 0d; c[n] = 0d; @@ -113,8 +113,8 @@ public class SplineInterpolator implements UnivariateInterpolator { d[j] = (c[j + 1] - c[j]) / (3d * h[j]); } - final PolynomialFunction polynomials[] = new PolynomialFunction[n]; - final double coefficients[] = new double[4]; + final PolynomialFunction[] polynomials = new PolynomialFunction[n]; + final double[] coefficients = new double[4]; for (int i = 0; i < n; i++) { coefficients[0] = y[i]; coefficients[1] = b[i];