@@ -383,6 +383,18 @@ PMMatrixTest >> testMatrixCloseToPrecision [
383383 self deny: (a closeTo: b precision: 0.2 )
384384]
385385
386+ { #category : #tests }
387+ PMMatrixTest >> testMatrixConversionWithBothDims [
388+
389+ | vect result expected |
390+ vect := #( 1 0.5 0.2 3 1 -1 7 3 2 12 13 3 ) asPMVector.
391+ result := vect reshapeWithDimensions: #( 6 2 ) .
392+
393+ expected := PMMatrix rows: #( #( 1 0.5 ) #( 0.2 3 ) #( 1 -1 ) #( 7 3 ) #( 2 12 ) #( 13 3 ) ).
394+
395+ self assert: result equals: expected
396+ ]
397+
386398{ #category : #comparing }
387399PMMatrixTest >> testMatrixCos [
388400 | a |
@@ -930,7 +942,7 @@ PMMatrixTest >> testSymmetricMatrixAdd3 [
930942 self assert: ((c rowAt: 3 ) at: 1 ) equals: 31
931943]
932944
933- { #category : #test }
945+ { #category : #tests }
934946PMMatrixTest >> testTake [
935947
936948 | m expected |
@@ -967,6 +979,18 @@ PMMatrixTest >> testVectorMatrixOperation [
967979 self assert: (v at: 2 ) equals: 4
968980]
969981
982+ { #category : #tests }
983+ PMMatrixTest >> testVectorToVectorConversion [
984+
985+ | vect result expected |
986+ vect := #( 1 0.5 0.2 3 1 -1 7 3 2 12 13 3 ) asPMVector.
987+ result := vect reshapeWithDimensions: #( 1 12 ) .
988+
989+ expected := PMMatrix rows: #( #( 1 0.5 0.2 3 1 -1 7 3 2 12 13 3 ) ).
990+
991+ self assert: result equals: expected
992+ ]
993+
970994{ #category : #' linear algebra' }
971995PMMatrixTest >> testVectorTransposeMatrixOperation [
972996 " Code Example 8.1"
0 commit comments