File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ PMQRDecomposition class >> of: matrix [
21
21
{ #category : #private }
22
22
PMQRDecomposition >> decompose [
23
23
24
- "
24
+ "
25
25
The method appears to be using Householder reflection. There is a wiki page
26
26
that describes the mechanics:
27
27
https://en.wikipedia.org/wiki/QR_decomposition#Using_Householder_reflections
@@ -32,14 +32,14 @@ https://en.wikipedia.org/wiki/QR_decomposition#Using_Householder_reflections
32
32
q := self initialQMatrix.
33
33
identityMatrix := PMSymmetricMatrix identity: colSize.
34
34
1 to: self numberOfColumns do: [ :col |
35
- | columnVectorFromRMatrix |
35
+ | columnVectorFromRMatrix householderMatrix |
36
36
columnVectorFromRMatrix := r columnVectorAt: col size: colSize.
37
37
householderVector := columnVectorFromRMatrix householder.
38
38
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 .
43
43
i := PMMatrix rows:
44
44
((r rows allButFirst: col - 1 ) collect: [ :aRow |
45
45
aRow allButFirst: col - 1 ]).
You can’t perform that action at this time.
0 commit comments