From 8543a0056a90f06bcc69d0052fcafea7131e689b Mon Sep 17 00:00:00 2001 From: Gilles Sadowski Date: Thu, 30 May 2013 21:22:45 +0000 Subject: [PATCH] Hard-coded number. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1488015 13f79535-47bb-0310-9956-ffa450edef68 --- .../interpolation/BicubicSplineInterpolatingFunction.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/math3/analysis/interpolation/BicubicSplineInterpolatingFunction.java b/src/main/java/org/apache/commons/math3/analysis/interpolation/BicubicSplineInterpolatingFunction.java index 41ae8c145..c412f6fc5 100644 --- a/src/main/java/org/apache/commons/math3/analysis/interpolation/BicubicSplineInterpolatingFunction.java +++ b/src/main/java/org/apache/commons/math3/analysis/interpolation/BicubicSplineInterpolatingFunction.java @@ -33,6 +33,8 @@ import org.apache.commons.math3.util.MathArrays; */ public class BicubicSplineInterpolatingFunction implements BivariateFunction { + /** Number of coefficients. */ + private static final int NUM_COEFF = 16; /** * Matrix to compute the spline coefficients from the function values * and function derivatives values @@ -342,12 +344,12 @@ public class BicubicSplineInterpolatingFunction * @return the spline coefficients. */ private double[] computeSplineCoefficients(double[] beta) { - final double[] a = new double[16]; + final double[] a = new double[NUM_COEFF]; - for (int i = 0; i < 16; i++) { + for (int i = 0; i < NUM_COEFF; i++) { double result = 0; final double[] row = AINV[i]; - for (int j = 0; j < 16; j++) { + for (int j = 0; j < NUM_COEFF; j++) { result += row[j] * beta[j]; } a[i] = result;