Skip to content

Commit 2dee537

Browse files
committed
Cleanup
1 parent 9c5e61b commit 2dee537

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/jama2/QRDecomposition.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,11 @@ else if (!this.isFullRank())
221221
}
222222

223223
// Copy right hand side
224-
final int nx = B.getColumnDimension();
225-
final double[][] X = B.getArrayCopy();
224+
final Matrix M = new Matrix(B);
225+
final double[][] X = M.getArray();
226226

227227
// Compute Y = transpose(Q)*B
228+
final int nx = B.getColumnDimension();
228229
for (int k = 0; k < this.n; k++)
229230
{
230231
for (int j = 0; j < nx; j++)
@@ -256,6 +257,6 @@ else if (!this.isFullRank())
256257
}
257258
}
258259
}
259-
return new Matrix(this.n, nx, X).getMatrix(0, this.n - 1, 0, nx - 1);
260+
return M.getMatrix(0, this.n - 1, 0, nx - 1);
260261
}
261262
}

0 commit comments

Comments
 (0)