commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1189695 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java
Date Thu, 27 Oct 2011 09:59:34 GMT
Author: erans
Date: Thu Oct 27 09:59:34 2011
New Revision: 1189695

URL: http://svn.apache.org/viewvc?rev=1189695&view=rev
Log:
Code formatting.

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

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java?rev=1189695&r1=1189694&r2=1189695&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java
Thu Oct 27 09:59:34 2011
@@ -363,9 +363,12 @@ public class SingularValueDecomposition 
                 // Perform one qr step.
                 case 3: {
                     // Calculate the shift.
-                    final double scale = FastMath.max(FastMath.max(FastMath.max(FastMath.max(
-                            FastMath.abs(singularValues[p - 1]), FastMath.abs(singularValues[p
- 2])), FastMath.abs(e[p - 2])),
-                            FastMath.abs(singularValues[k])), FastMath.abs(e[k]));
+                    final double maxPm1Pm2 = FastMath.max(FastMath.abs(singularValues[p -
1]),
+                                                          FastMath.abs(singularValues[p -
2]));
+                    final double scale = FastMath.max(FastMath.max(FastMath.max(maxPm1Pm2,
+                                                                                FastMath.abs(e[p
- 2])),
+                                                                   FastMath.abs(singularValues[k])),
+                                                      FastMath.abs(e[k]));
                     final double sp = singularValues[p - 1] / scale;
                     final double spm1 = singularValues[p - 2] / scale;
                     final double epm1 = e[p - 2] / scale;



Mime
View raw message