Skip to content

Commit 0ea1ce6

Browse files
Extracted code to an intention-revealing message.
1 parent 2028b3c commit 0ea1ce6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Math-Matrix/PMQRDecomposition.class.st

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ PMQRDecomposition class >> of: matrix [
1818
^ self new of: matrix
1919
]
2020

21+
{ #category : #private }
22+
PMQRDecomposition >> columnVectorFrom: r startingAt: col [
23+
24+
^ (r columnAt: col) copyFrom: col to: colSize
25+
]
26+
2127
{ #category : #private }
2228
PMQRDecomposition >> decompose [
2329

@@ -27,11 +33,9 @@ PMQRDecomposition >> decompose [
2733
identityMatrix := PMSymmetricMatrix identity: colSize.
2834
1 to: self numberOfColumns do: [ :col |
2935
| columnVectorFromRMatrix |
30-
columnVectorFromRMatrix := (r columnAt: col)
31-
copyFrom: col
32-
to: colSize.
36+
columnVectorFromRMatrix := self columnVectorFrom: r startingAt: col.
3337
householderVector := columnVectorFromRMatrix householder.
34-
i := (PMVector new: col - 1 withAll: 0) , (householderVector at: 2).
38+
i := (PMVector zeros: col - 1) , (householderVector at: 2).
3539
q := q
3640
*
3741
(identityMatrix

0 commit comments

Comments
 (0)