File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,6 +163,22 @@ PMMatrixTest >> testDimension [
163163
164164]
165165
166+ { #category : ' linear algebra' }
167+ PMMatrixTest >> testEigenForSingleValueMatrix [
168+
169+ | matrix expectedEigenvalues eigenvalues expectedEigenvectors eigenvectors |
170+ matrix := PMMatrix rows: #( #( 3 ) ).
171+
172+ expectedEigenvalues := #( 3 ) .
173+ expectedEigenvectors := PMVector with: (PMVector ones: 1 ).
174+
175+ eigenvalues := matrix eigen values.
176+ eigenvectors := matrix eigen vectors.
177+
178+ eigenvalues with: expectedEigenvalues do: [ :actual :expected | self assert: actual closeTo: expected ].
179+ eigenvectors with: expectedEigenvectors do: [ :actual :expected | self assert: actual closeTo: expected ]
180+ ]
181+
166182{ #category : ' linear algebra' }
167183PMMatrixTest >> testEigenvalues [
168184 " Code Example 8.15"
You can’t perform that action at this time.
0 commit comments