Fixed ignored method parameters in QRDecomposition protected methods.

JIRA: MATH-1191
This commit is contained in:
Luc Maisonobe 2015-04-10 21:36:04 +02:00
parent 8937821b5f
commit 8d210b4f84
2 changed files with 8 additions and 5 deletions

View File

@ -54,6 +54,9 @@ If the output is not quite correct, check for invisible trailing spaces!
</release> </release>
<release version="4.0" date="XXXX-XX-XX" description=""> <release version="4.0" date="XXXX-XX-XX" description="">
<action dev="luc" type="fix" issue="MATH-1191">
Fixed ignored method parameters in QRDecomposition protected methods.
</action>
<action dev="luc" type="fix" issue="MATH-1212"> <action dev="luc" type="fix" issue="MATH-1212">
Changed javadoc as the RandomDataGenerator class does not implement Changed javadoc as the RandomDataGenerator class does not implement
an interface anymore (the previous interface has been deprecated in an interface anymore (the previous interface has been deprecated in

View File

@ -109,8 +109,8 @@ public class QRDecomposition {
* @since 3.2 * @since 3.2
*/ */
protected void decompose(double[][] matrix) { protected void decompose(double[][] matrix) {
for (int minor = 0; minor < FastMath.min(qrt.length, qrt[0].length); minor++) { for (int minor = 0; minor < FastMath.min(matrix.length, matrix[0].length); minor++) {
performHouseholderReflection(minor, qrt); performHouseholderReflection(minor, matrix);
} }
} }
@ -121,7 +121,7 @@ public class QRDecomposition {
*/ */
protected void performHouseholderReflection(int minor, double[][] matrix) { 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. * Let x be the first column of the minor, and a^2 = |x|^2.
@ -162,8 +162,8 @@ public class QRDecomposition {
* |v|^2 = -2a*(qr[minor][minor]), so * |v|^2 = -2a*(qr[minor][minor]), so
* alpha = -<x,v>/(a*qr[minor][minor]) * alpha = -<x,v>/(a*qr[minor][minor])
*/ */
for (int col = minor+1; col < qrt.length; col++) { for (int col = minor+1; col < matrix.length; col++) {
final double[] qrtCol = qrt[col]; final double[] qrtCol = matrix[col];
double alpha = 0; double alpha = 0;
for (int row = minor; row < qrtCol.length; row++) { for (int row = minor; row < qrtCol.length; row++) {
alpha -= qrtCol[row] * qrtMinor[row]; alpha -= qrtCol[row] * qrtMinor[row];