File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 6767" 15"
6868]
6969
70+ { #category : #' instance creation' }
71+ PMMatrix class >> identity: anInteger [
72+ ^ PMSymmetricMatrix identity: anInteger
73+ ]
74+
7075{ #category : #' instance creation' }
7176PMMatrix class >> join: anArrayOfMatrices [
7277 " Inverse of the split operation."
Original file line number Diff line number Diff line change @@ -197,6 +197,20 @@ PMMatrixTest >> testFlattenRows [
197197 self assert: m flattenRows equals: #(1 2 3 4 5 6 7 8 9) asPMVector
198198]
199199
200+ { #category : #tests }
201+ PMMatrixTest >> testIdentityMatrix [
202+ |a a2 |
203+
204+ a := PMMatrix zerosRows: 3 cols: 3 .
205+
206+ a at: 1 at: 1 put: 1 .
207+ a at: 2 at: 2 put: 1 .
208+ a at: 3 at: 3 put: 1 .
209+
210+ a2 := PMMatrix identity: 3 .
211+ self assert: a2 equals: a.
212+ ]
213+
200214{ #category : #tests }
201215PMMatrixTest >> testIsRealOnComplexMatrix [
202216 | matrix |
Original file line number Diff line number Diff line change 11Class {
22 #name : #PMSymmetricMatrixTest ,
33 #superclass : #TestCase ,
4- #category : ' Math-Tests-Matrix'
4+ #category : # ' Math-Tests-Matrix'
55}
66
77{ #category : #tests }
@@ -38,6 +38,16 @@ PMSymmetricMatrixTest >> testEqual [
3838 self assert: b ~= a
3939]
4040
41+ { #category : #tests }
42+ PMSymmetricMatrixTest >> testIdentityMatrix [
43+ |a a1 |
44+
45+ a := PMSymmetricMatrix identity: 3 .
46+ a1 := PMSymmetricMatrix rows: #(#(1 0 0) #(0 1 0) #(0 0 1) ).
47+
48+ self assert: a equals: a1.
49+ ]
50+
4151{ #category : #tests }
4252PMSymmetricMatrixTest >> testInversePureLUP [
4353 | m i |
You can’t perform that action at this time.
0 commit comments