commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1488015 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/interpolation/BicubicSplineInterpolatingFunction.java
Date Thu, 30 May 2013 21:22:45 GMT
Author: erans
Date: Thu May 30 21:22:45 2013
New Revision: 1488015

URL: http://svn.apache.org/r1488015
Log:
Hard-coded number.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/interpolation/BicubicSplineInterpolatingFunction.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/interpolation/BicubicSplineInterpolatingFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/interpolation/BicubicSplineInterpolatingFunction.java?rev=1488015&r1=1488014&r2=1488015&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/interpolation/BicubicSplineInterpolatingFunction.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/interpolation/BicubicSplineInterpolatingFunction.java
Thu May 30 21:22:45 2013
@@ -33,6 +33,8 @@ import org.apache.commons.math3.util.Mat
  */
 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 BicubicSplineInterpolatingF
      * @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;



Mime
View raw message