Author: erans
Date: Sat Aug 13 07:23:38 2011
New Revision: 1157342

URL: http://svn.apache.org/viewvc?rev=1157342&view=rev
Log:
MATH-601
Replaced call to "max" with the already known result "m".

Modified:
    
commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java?rev=1157342&r1=1157341&r2=1157342&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java
 Sat Aug 13 07:23:38 2011
@@ -57,7 +57,10 @@ public class SingularValueDecompositionI
     private final RealMatrix cachedV;
     /** Cached value of transposed V matrix. */
     private RealMatrix cachedVt;
-    /** Tolerance value for small singular values, calculated once we have 
populated singularValues **/
+    /**
+     * Tolerance value for small singular values, calculated once we have
+     * populated "singularValues".
+     **/
     private final double tol;
 
     /**
@@ -446,8 +449,8 @@ public class SingularValueDecompositionI
         }
 
         // Set the small value tolerance used to calculate rank and 
pseudo-inverse
-        tol = FastMath.max(FastMath.max(m, n) * singularValues[0] * EPS,
-                FastMath.sqrt( MathUtils.SAFE_MIN));
+        tol = FastMath.max(m * singularValues[0] * EPS,
+                           FastMath.sqrt(MathUtils.SAFE_MIN));
 
         if (!transposed) {
             cachedU = MatrixUtils.createRealMatrix(U);


Reply via email to