diff --git a/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java b/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java index 38bac6c71..5f91636e6 100644 --- a/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java +++ b/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java @@ -24,8 +24,8 @@ package org.apache.commons.math.linear; * Singular Value Decomposition of a real matrix. *
The Singular Value Decomposition of matrix A is a set of three matrices: * U, Σ and V such that A = U × Σ × VT. - * Let A be an m × n matrix, then U is an m × m orthogonal matrix, - * Σ is a m × n diagonal matrix with positive diagonal elements, + * Let A be an m × n matrix, then U is an m × n orthogonal matrix, + * Σ is a n × n diagonal matrix with positive diagonal elements, * and V is an n × n orthogonal matrix.
*This interface is similar to the class with similar name from the * JAMA library, with the diff --git a/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java b/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java index a01cea377..0da87ab2a 100644 --- a/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java +++ b/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java @@ -24,8 +24,8 @@ import org.apache.commons.math.util.MathUtils; * Calculates the Singular Value Decomposition of a matrix. *
The Singular Value Decomposition of matrix A is a set of three matrices: * U, Σ and V such that A = U × Σ × VT. - * Let A be an m × n matrix, then U is an m × m orthogonal matrix, - * Σ is a m × n diagonal matrix with positive diagonal elements, + * Let A be an m × n matrix, then U is an m × n orthogonal matrix, + * Σ is a n × n diagonal matrix with positive diagonal elements, * and V is an n × n orthogonal matrix.
* * @version $Revision$ $Date$ @@ -361,10 +361,10 @@ public class SingularValueDecompositionImpl implements SingularValueDecompositio public double[] solve(final double[] b) throws IllegalArgumentException, InvalidMatrixException { - if (b.length != singularValues.length) { + if (b.length != uT.getColumnDimension()) { throw MathRuntimeException.createIllegalArgumentException( "vector length mismatch: got {0} but expected {1}", - b.length, singularValues.length); + b.length, uT.getColumnDimension()); } final double[] w = uT.operate(b); @@ -390,10 +390,10 @@ public class SingularValueDecompositionImpl implements SingularValueDecompositio public RealVector solve(final RealVector b) throws IllegalArgumentException, InvalidMatrixException { - if (b.getDimension() != singularValues.length) { + if (b.getDimension() != uT.getColumnDimension()) { throw MathRuntimeException.createIllegalArgumentException( "vector length mismatch: got {0} but expected {1}", - b.getDimension(), singularValues.length); + b.getDimension(), uT.getColumnDimension()); } final RealVector w = uT.operate(b); diff --git a/src/site/xdoc/changes.xml b/src/site/xdoc/changes.xml index 70c612e31..a72e7c193 100644 --- a/src/site/xdoc/changes.xml +++ b/src/site/xdoc/changes.xml @@ -39,6 +39,9 @@ The