@@ -20,7 +20,7 @@ matrix := PMMatrix rows: #(
2020 (0 0 0 3)
2121 (0 0 0 0)).
2222
23- svd := matrix decompose .
23+ svd := matrix decomposeSV .
2424u := svd leftSingularForm.
2525v := svd rightSingularForm.
2626s := svd sForm.
@@ -32,15 +32,11 @@ Class {
3232 #name : #PMSingularValueDecomposition ,
3333 #superclass : #Object ,
3434 #instVars : [
35- ' m' ,
36- ' n' ,
3735 ' u' ,
3836 ' s' ,
39- ' v' ,
40- ' signU' ,
41- ' signV'
37+ ' v'
4238 ],
43- #category : ' Math-Matrix'
39+ #category : # ' Math-Matrix'
4440}
4541
4642{ #category : #' instance creation' }
@@ -50,7 +46,8 @@ PMSingularValueDecomposition class >> decompose: aMatrix [
5046
5147{ #category : #initialization }
5248PMSingularValueDecomposition >> initialize: aMatrix [
53- | symU symV eigenU eigenV diag |
49+
50+ | m n symU symV eigenU eigenV diag |
5451 m := aMatrix numberOfRows.
5552 n := aMatrix numberOfColumns.
5653 symU := aMatrix * aMatrix transpose.
@@ -62,8 +59,8 @@ PMSingularValueDecomposition >> initialize: aMatrix [
6259 u := (PMMatrix rows: eigenU vectors) transpose.
6360 v := (PMMatrix rows: eigenV vectors) transpose.
6461 diag := m < n
65- ifTrue: [ eigenU values ]
66- ifFalse: [ eigenV values ].
62+ ifTrue: [ eigenU values ]
63+ ifFalse: [ eigenV values ].
6764 s := PMMatrix rows: m columns: n random: 0 .
6865 s setDiagonal: diag sqrt
6966]
0 commit comments