commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r891436 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/linear/SingularValueDecomposition.java main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java site/xdoc/changes.xml
Date Wed, 16 Dec 2009 21:44:13 GMT
Author: luc
Date: Wed Dec 16 21:44:13 2009
New Revision: 891436

URL: http://svn.apache.org/viewvc?rev=891436&view=rev
Log:
Fixed a wrong dimension check in SVD solver
thanks to Dimitri for identifying and solving this

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecompositionImpl.java
    commons/proper/math/trunk/src/site/xdoc/changes.xml

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=891436&r1=891435&r2=891436&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
Wed Dec 16 21:44:13 2009
@@ -24,8 +24,8 @@
  * Singular Value Decomposition of a real matrix.
  * <p>The Singular Value Decomposition of matrix A is a set of three matrices:
  * U, &Sigma; and V such that A = U &times; &Sigma; &times; V<sup>T</sup>.
- * Let A be an m &times; n matrix, then U is an m &times; m orthogonal matrix,
- * &Sigma; is a m &times; n diagonal matrix with positive diagonal elements,
+ * Let A be an m &times; n matrix, then U is an m &times; n orthogonal matrix,
+ * &Sigma; is a n &times; n diagonal matrix with positive diagonal elements,
  * and V is an n &times; n orthogonal matrix.</p>
  * <p>This interface is similar to the class with similar name from the
  * <a href="http://math.nist.gov/javanumerics/jama/">JAMA</a> library, with the

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=891436&r1=891435&r2=891436&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
Wed Dec 16 21:44:13 2009
@@ -24,8 +24,8 @@
  * Calculates the Singular Value Decomposition of a matrix.
  * <p>The Singular Value Decomposition of matrix A is a set of three matrices:
  * U, &Sigma; and V such that A = U &times; &Sigma; &times; V<sup>T</sup>.
- * Let A be an m &times; n matrix, then U is an m &times; m orthogonal matrix,
- * &Sigma; is a m &times; n diagonal matrix with positive diagonal elements,
+ * Let A be an m &times; n matrix, then U is an m &times; n orthogonal matrix,
+ * &Sigma; is a n &times; n diagonal matrix with positive diagonal elements,
  * and V is an n &times; n orthogonal matrix.</p>
  *
  * @version $Revision$ $Date$
@@ -361,10 +361,10 @@
         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 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);

Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/changes.xml?rev=891436&r1=891435&r2=891436&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/changes.xml Wed Dec 16 21:44:13 2009
@@ -39,6 +39,9 @@
   </properties>
   <body>
     <release version="2.1" date="TBD" description="TBD">
+      <action dev="luc" type="fix" due-to="Dimitri Pourbaix">
+        Fixed a wrong dimension check in SVD solver.
+      </action>
       <action dev="luc" type="fix" issue="MATH-313" due-to="Jake Mannix">
         Added composition features for real functions.
       </action>



Mime
View raw message