@@ -189,61 +189,67 @@ PMSingularValueDecompositionTest >> testIsExampleOrthonormalV [
189189
190190{ #category : #tests }
191191PMSingularValueDecompositionTest >> testIsOrthonormalU [
192+
192193 " Verifying that matrix U is orthonormal. That is, all columns of U are unit vectors and orthogonal to each other."
193194
194195 | u m identity |
195- u := matrix decomposeSV leftSingularForm .
196+ u := matrix decomposeSV leftSingularMatrix .
196197 m := u numberOfRows.
197198 identity := PMSymmetricMatrix identity: m.
198199 self assert: u transpose * u closeTo: identity
199200]
200201
201202{ #category : #tests }
202203PMSingularValueDecompositionTest >> testIsOrthonormalV [
204+
203205 " Verifying that matrix U is orthonormal. That is, all columns of U are unit vectors and orthogonal to each other."
204206
205207 | v n identity |
206- v := matrix decomposeSV rightSingularForm .
208+ v := matrix decomposeSV rightSingularMatrix .
207209 n := v numberOfRows.
208210 identity := PMSymmetricMatrix identity: n.
209211 self assert: v transpose * v closeTo: identity
210212]
211213
212214{ #category : #tests }
213215PMSingularValueDecompositionTest >> testIsSquareU [
216+
214217 " U should be a square matrix"
215218
216219 | u |
217- u := matrix decomposeSV leftSingularForm .
220+ u := matrix decomposeSV leftSingularMatrix .
218221 self assert: u numberOfRows equals: u numberOfColumns
219222]
220223
221224{ #category : #tests }
222225PMSingularValueDecompositionTest >> testIsSquareV [
226+
223227 " V should be a square matrix"
224228
225229 | v |
226- v := matrix decomposeSV rightSingularForm .
230+ v := matrix decomposeSV rightSingularMatrix .
227231 self assert: v numberOfRows equals: v numberOfColumns
228232]
229233
230234{ #category : #tests }
231235PMSingularValueDecompositionTest >> testReconstruction [
236+
232237 | svd u v s reconstructed |
233238 svd := matrix decomposeSV.
234- u := svd leftSingularForm .
235- v := svd rightSingularForm .
236- s := svd sForm .
239+ u := svd leftSingularMatrix .
240+ v := svd rightSingularMatrix .
241+ s := svd diagonalSingularValueMatrix .
237242 reconstructed := u * s * v transpose.
238243 self assert: reconstructed closeTo: matrix
239244]
240245
241246{ #category : #tests }
242247PMSingularValueDecompositionTest >> testShapeS [
248+
243249 " If A is an (m x n) matrix, then S should be an (m x n) matrix"
244250
245251 | s m n |
246- s := matrix decomposeSV sForm .
252+ s := matrix decomposeSV diagonalSingularValueMatrix .
247253 m := matrix numberOfRows.
248254 n := matrix numberOfColumns.
249255 self assert: s numberOfRows equals: m.
@@ -252,49 +258,54 @@ PMSingularValueDecompositionTest >> testShapeS [
252258
253259{ #category : #tests }
254260PMSingularValueDecompositionTest >> testShapeU [
261+
255262 " If A is an (m x n) matrix, then U should be an (m x m) matrix"
256263
257264 | u m |
258- u := matrix decomposeSV leftSingularForm .
265+ u := matrix decomposeSV leftSingularMatrix .
259266 m := matrix numberOfRows.
260267 self assert: u numberOfRows equals: m.
261268 self assert: u numberOfColumns equals: m
262269]
263270
264271{ #category : #tests }
265272PMSingularValueDecompositionTest >> testShapeV [
273+
266274 " If A is an (m x n) matrix, then V should be an (n x n) matrix"
267275
268276 | v n |
269- v := matrix decomposeSV rightSingularForm .
277+ v := matrix decomposeSV rightSingularMatrix .
270278 n := matrix numberOfColumns.
271279 self assert: v numberOfRows equals: n.
272280 self assert: v numberOfColumns equals: n
273281]
274282
275283{ #category : #tests }
276284PMSingularValueDecompositionTest >> testValueS [
285+
277286 " Comparing S to its known value"
278287
279288 | s |
280- s := matrix decomposeSV sForm .
289+ s := matrix decomposeSV diagonalSingularValueMatrix .
281290 self assert: s closeTo: actualS
282291]
283292
284293{ #category : #tests }
285294PMSingularValueDecompositionTest >> testValueU [
295+
286296 " Comparing U to its known value"
287297
288298 | u |
289- u := matrix decomposeSV leftSingularForm .
299+ u := matrix decomposeSV leftSingularMatrix .
290300 self assert: u closeTo: actualU
291301]
292302
293303{ #category : #tests }
294304PMSingularValueDecompositionTest >> testValueV [
305+
295306 " Comparing V to its known value"
296307
297308 | v |
298- v := matrix decomposeSV rightSingularForm .
309+ v := matrix decomposeSV rightSingularMatrix .
299310 self assert: v closeTo: actualV
300311]
0 commit comments