Skip to content

Commit 074d53e

Browse files
Merge pull request #278 from olekscode/277-Run-tests-and-apply-Deprewriter-transformations
Fixed #277. Updated all references to deprecated method with Deprewriter
2 parents 81fe788 + 28b4595 commit 074d53e

File tree

4 files changed

+33
-18
lines changed

4 files changed

+33
-18
lines changed

src/Math-AutomaticDifferenciation/PMDualNumber.class.st

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ PMDualNumber >> closeTo: aDualNumber [
142142

143143
{ #category : #'mathematical functions' }
144144
PMDualNumber >> conjugated [
145+
145146
^ self class
146-
value: self value conjugated
147-
eps: self eps asComplex complexConjugate
147+
value: self value complexConjugate
148+
eps: self eps asComplex complexConjugate
148149
]
149150

150151
{ #category : #'mathematical functions' }

src/Math-PrincipalComponentAnalysis/PMPrincipalComponentAnalyserSVD.class.st

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ d1 scatterplotMatrix.
3737

3838
{ #category : #accessing }
3939
PMPrincipalComponentAnalyserSVD >> fit: aPMMatrix [
40+
4041
svd := aPMMatrix decomposeSV.
41-
u := svd leftSingularForm.
42-
v := svd rightSingularForm.
42+
u := svd leftSingularMatrix.
43+
v := svd rightSingularMatrix.
4344
self flipEigenvectorsSign
4445
]
4546

src/Math-Tests-AutomaticDifferenciation/PMDualNumberTest.class.st

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ PMDualNumberTest >> testArcTan [
8686

8787
{ #category : #test }
8888
PMDualNumberTest >> testConjugated [
89+
8990
| a z |
9091
z := PMDualNumber value: 1.0 + 1.0 i eps: 1.0.
9192
a := z absSquared.
9293
self assert: a value equals: z value absSquared.
9394
self
9495
assert: a eps
95-
equals: z eps asComplex complexConjugate * z value + (z value asComplex conjugated * z eps)
96+
equals: z eps asComplex complexConjugate * z value
97+
+ (z value asComplex complexConjugate * z eps)
9698
]
9799

98100
{ #category : #tests }

src/Math-Tests-Matrix/PMSingularValueDecompositionTest.class.st

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,61 +189,67 @@ PMSingularValueDecompositionTest >> testIsExampleOrthonormalV [
189189

190190
{ #category : #tests }
191191
PMSingularValueDecompositionTest >> 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 }
202203
PMSingularValueDecompositionTest >> 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 }
213215
PMSingularValueDecompositionTest >> 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 }
222225
PMSingularValueDecompositionTest >> 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 }
231235
PMSingularValueDecompositionTest >> 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 }
242247
PMSingularValueDecompositionTest >> 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 }
254260
PMSingularValueDecompositionTest >> 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 }
265272
PMSingularValueDecompositionTest >> 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 }
276284
PMSingularValueDecompositionTest >> 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 }
285294
PMSingularValueDecompositionTest >> 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 }
294304
PMSingularValueDecompositionTest >> 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

Comments
 (0)