commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r927249 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math: analysis/interpolation/BicubicSplineInterpolatingFunction.java analysis/interpolation/SmoothingBicubicSplineInterpolator.java util/MathUtils.java
Date Thu, 25 Mar 2010 01:06:51 GMT
Author: psteitz
Date: Thu Mar 25 01:06:51 2010
New Revision: 927249

URL: http://svn.apache.org/viewvc?rev=927249&view=rev
Log:
Checkstyle fixes, @since tags.

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

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/BicubicSplineInterpolatingFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/BicubicSplineInterpolatingFunction.java?rev=927249&r1=927248&r2=927249&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/BicubicSplineInterpolatingFunction.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/BicubicSplineInterpolatingFunction.java
Thu Mar 25 01:06:51 2010
@@ -28,6 +28,7 @@ import org.apache.commons.math.analysis.
  * bicubic spline interpolation</a>.
  *
  * @version $Revision$ $Date$
+ * @since 2.1
  */
 public class BicubicSplineInterpolatingFunction
     implements BivariateRealFunction {
@@ -35,7 +36,7 @@ public class BicubicSplineInterpolatingF
      * Matrix to compute the spline coefficients from the function values
      * and function derivatives values
      */
-    private final static double[][] aInv = {
+    private static final double[][] AINV = {
         { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
         { 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0 },
         { -3,3,0,0,-2,-1,0,0,0,0,0,0,0,0,0,0 },
@@ -82,7 +83,7 @@ public class BicubicSplineInterpolatingF
                                               double[][] dZdX,
                                               double[][] dZdY,
                                               double[][] dZdXdY)
-        throws MathException {
+        throws DimensionMismatchException {
         final int xLen = x.length;
         final int yLen = y.length;
 
@@ -173,7 +174,8 @@ public class BicubicSplineInterpolatingF
             return -1;
         }
 
-        for (int i = 1, max = val.length; i < max; i++) {
+        int max = val.length;
+        for (int i = 1; i < max; i++) {
             if (c <= val[i]) {
                 return i - 1;
             }
@@ -213,7 +215,7 @@ public class BicubicSplineInterpolatingF
 
         for (int i = 0; i < 16; i++) {
             double result = 0;
-            final double[] row = aInv[i];
+            final double[] row = AINV[i];
             for (int j = 0; j < 16; j++) {
                 result += row[j] * beta[j];
             }
@@ -226,6 +228,8 @@ public class BicubicSplineInterpolatingF
 
 /**
  * 2D-spline function.
+ * 
+ * @version $Revision$ $Date$
  */
 class BicubicSplineFunction
     implements BivariateRealFunction {
@@ -278,9 +282,9 @@ class BicubicSplineFunction
         final double y2 = y * y;
         final double y3 = y2 * y;
 
-        return a00 + a01 * y + a02 * y2 + a03 * y3
-            + a10 * x + a11 * x * y + a12 * x * y2 + a13 * x * y3
-            + a20 * x2 + a21 * x2 * y + a22 * x2 * y2 + a23 * x2 * y3
-            + a30 * x3 + a31 * x3 * y + a32 * x3 * y2 + a33 * x3 * y3;
+        return a00 + a01 * y + a02 * y2 + a03 * y3 +
+            a10 * x + a11 * x * y + a12 * x * y2 + a13 * x * y3 +
+            a20 * x2 + a21 * x2 * y + a22 * x2 * y2 + a23 * x2 * y3 +
+            a30 * x3 + a31 * x3 * y + a32 * x3 * y2 + a33 * x3 * y3;
     }
 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/SmoothingBicubicSplineInterpolator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/SmoothingBicubicSplineInterpolator.java?rev=927249&r1=927248&r2=927249&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/SmoothingBicubicSplineInterpolator.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/SmoothingBicubicSplineInterpolator.java
Thu Mar 25 01:06:51 2010
@@ -32,6 +32,7 @@ import org.apache.commons.math.analysis.
  * chapter 2.
  *
  * @version $Revision$ $Date$
+ * @since 2.1
  */
 public class SmoothingBicubicSplineInterpolator
     implements BivariateRealGridInterpolator {
@@ -132,9 +133,9 @@ public class SmoothingBicubicSplineInter
             for (int j = 0; j < yLen; j++) {
                 final int nJ = nextIndex(j, yLen);
                 final int pJ = previousIndex(j);
-                dZdXdY[i][j] =  (zY_2[nI][nJ] - zY_2[nI][pJ]
-                                 - zY_2[pI][nJ] + zY_2[pI][pJ])
-                    / ((xval[nI] - xval[pI]) * (yval[nJ] - yval[pJ])) ;
+                dZdXdY[i][j] =  (zY_2[nI][nJ] - zY_2[nI][pJ] -
+                                 zY_2[pI][nJ] + zY_2[pI][pJ]) /
+                    ((xval[nI] - xval[pI]) * (yval[nJ] - yval[pJ])) ;
             }
         }
 
@@ -160,7 +161,6 @@ public class SmoothingBicubicSplineInter
      * It is assumed (but not checked) that {@code i} is smaller than the size of the array.
      *
      * @param i Index
-     * @param max Upper limit of the array
      * @return the previous index
      */
     private int previousIndex(int i) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java?rev=927249&r1=927248&r2=927249&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java Thu
Mar 25 01:06:51 2010
@@ -1799,7 +1799,8 @@ public final class MathUtils {
     public static void checkOrder(double[] val, int dir, boolean strict) {
         double previous = val[0];
 
-        for (int i = 1, max = val.length; i < max; i++) {
+        int max = val.length;
+        for (int i = 1; i < max; i++) {
             if (dir > 0) {
                 if (strict) {
                     if (val[i] <= previous) {



Mime
View raw message