Replaced call to "max" with the already known result "m".


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1157342 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gilles Sadowski 2011-08-13 07:23:38 +00:00
parent 190b6716ee
commit 9edd2f24d7
1 changed files with 6 additions and 3 deletions

View File

@ -57,7 +57,10 @@ public class SingularValueDecompositionImpl implements SingularValueDecompositio
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 SingularValueDecompositionImpl implements SingularValueDecompositio
}
// 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);