Skip to content

Commit aa0e360

Browse files
Extracted a computation to an intention revealing temporary variable.
1 parent c5c102e commit aa0e360

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Math-Matrix/PMQRDecomposition.class.st

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PMQRDecomposition class >> of: matrix [
2121
{ #category : #private }
2222
PMQRDecomposition >> decompose [
2323

24-
"
24+
"
2525
The method appears to be using Householder reflection. There is a wiki page
2626
that describes the mechanics:
2727
https://en.wikipedia.org/wiki/QR_decomposition#Using_Householder_reflections
@@ -32,14 +32,14 @@ https://en.wikipedia.org/wiki/QR_decomposition#Using_Householder_reflections
3232
q := self initialQMatrix.
3333
identityMatrix := PMSymmetricMatrix identity: colSize.
3434
1 to: self numberOfColumns do: [ :col |
35-
| columnVectorFromRMatrix |
35+
| columnVectorFromRMatrix householderMatrix |
3636
columnVectorFromRMatrix := r columnVectorAt: col size: colSize.
3737
householderVector := columnVectorFromRMatrix householder.
3838
i := (PMVector zeros: col - 1) , (householderVector at: 2).
39-
q := q
40-
*
41-
(identityMatrix
42-
- ((householderVector at: 1) * i tensorProduct: i)).
39+
householderMatrix := identityMatrix
40+
-
41+
((householderVector at: 1) * i tensorProduct: i).
42+
q := q * householderMatrix.
4343
i := PMMatrix rows:
4444
((r rows allButFirst: col - 1) collect: [ :aRow |
4545
aRow allButFirst: col - 1 ]).

0 commit comments

Comments
 (0)