commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject [math] Fixed ignored method parameters in QRDecomposition protected methods.
Date Fri, 10 Apr 2015 19:32:20 GMT
Repository: commons-math
Updated Branches:
  refs/heads/MATH_3_X aa43eca83 -> beb4d1ce6


Fixed ignored method parameters in QRDecomposition protected methods.

JIRA: MATH-1191

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/beb4d1ce
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/beb4d1ce
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/beb4d1ce

Branch: refs/heads/MATH_3_X
Commit: beb4d1ce66d1715887e62abafa88bec235f4f22e
Parents: aa43eca
Author: Luc Maisonobe <luc@apache.org>
Authored: Fri Apr 10 21:32:07 2015 +0200
Committer: Luc Maisonobe <luc@apache.org>
Committed: Fri Apr 10 21:32:07 2015 +0200

----------------------------------------------------------------------
 src/changes/changes.xml                                   |  3 +++
 .../org/apache/commons/math3/linear/QRDecomposition.java  | 10 +++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/beb4d1ce/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a89c8cb..b7d3edc 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -51,6 +51,9 @@ If the output is not quite correct, check for invisible trailing spaces!
   </properties>
   <body>
     <release version="3.5" date="TBD" description="TBD">
+      <action dev="luc" type="fix" issue="MATH-1191">
+        Fixed ignored method parameters in QRDecomposition protected methods.
+      </action>    
       <action dev="luc" type="fix" issue="MATH-1211" due-to="Mike Zimmerman">
         Fixed wrong selection of line/polyhedron intersection point.
       </action>    

http://git-wip-us.apache.org/repos/asf/commons-math/blob/beb4d1ce/src/main/java/org/apache/commons/math3/linear/QRDecomposition.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/linear/QRDecomposition.java b/src/main/java/org/apache/commons/math3/linear/QRDecomposition.java
index 6db821a..29bbe68 100644
--- a/src/main/java/org/apache/commons/math3/linear/QRDecomposition.java
+++ b/src/main/java/org/apache/commons/math3/linear/QRDecomposition.java
@@ -108,8 +108,8 @@ public class QRDecomposition {
      * @since 3.2
      */
     protected void decompose(double[][] matrix) {
-        for (int minor = 0; minor < FastMath.min(qrt.length, qrt[0].length); minor++)
{
-            performHouseholderReflection(minor, qrt);
+        for (int minor = 0; minor < FastMath.min(matrix.length, matrix[0].length); minor++)
{
+            performHouseholderReflection(minor, matrix);
         }
     }
 
@@ -120,7 +120,7 @@ public class QRDecomposition {
      */
     protected void performHouseholderReflection(int minor, double[][] matrix) {
 
-        final double[] qrtMinor = qrt[minor];
+        final double[] qrtMinor = matrix[minor];
 
         /*
          * Let x be the first column of the minor, and a^2 = |x|^2.
@@ -161,8 +161,8 @@ public class QRDecomposition {
              * |v|^2 = -2a*(qr[minor][minor]), so
              * alpha = -<x,v>/(a*qr[minor][minor])
              */
-            for (int col = minor+1; col < qrt.length; col++) {
-                final double[] qrtCol = qrt[col];
+            for (int col = minor+1; col < matrix.length; col++) {
+                final double[] qrtCol = matrix[col];
                 double alpha = 0;
                 for (int row = minor; row < qrtCol.length; row++) {
                     alpha -= qrtCol[row] * qrtMinor[row];


Mime
View raw message