Skip to content

Commit 0e2952f

Browse files
Made similar code even more similar.
1 parent df9874c commit 0e2952f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Math-Matrix/PMQRDecomposition.class.st

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ https://en.wikipedia.org/wiki/QR_decomposition#Using_Householder_reflections
4747
* (householderVector at: 2) * matrixOfMinor).
4848
matrixOfMinor rowsWithIndexDo: [ :aRow :index |
4949
aRow withIndexDo: [ :element :column |
50+
| rowNumber columnNumber |
51+
rowNumber := col + index - 1.
52+
columnNumber := col + column - 1.
5053
r
51-
rowAt: col + index - 1
52-
columnAt: col + column - 1
54+
rowAt: rowNumber
55+
columnAt: columnNumber
5356
put: ((element closeTo: 0)
5457
ifTrue: [ 0 ]
5558
ifFalse: [ element ]) ] ] ].
@@ -95,9 +98,12 @@ PMQRDecomposition >> decomposeWithPivot [
9598
* (householderVector at: 2) * matrixOfMinor).
9699
matrixOfMinor rowsWithIndexDo: [ :aRow :index |
97100
aRow withIndexDo: [ :element :column |
101+
| rowNumber columnNumber |
102+
rowNumber := rank + index - 1.
103+
columnNumber := rank + column - 1.
98104
r
99-
rowAt: rank + index - 1
100-
columnAt: rank + column - 1
105+
rowAt: rowNumber
106+
columnAt: columnNumber
101107
put: ((element closeTo: 0)
102108
ifTrue: [ 0 ]
103109
ifFalse: [ element ]) ] ].

0 commit comments

Comments
 (0)