File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -102,16 +102,19 @@ PMNDArrayTest >> testFromNestedArray [
102102
103103{ #category : #tests }
104104PMNDArrayTest >> testHadamardProduct [
105- |t1 t2 |
105+ |t1 t2 expectedHadamardProduct |
106+
106107 t1 := PMNDArray fromNestedArray: #(
107108 #( 1 2 3 4 ) #( 5 6 7 8 )
108109 ).
109110 t2 := PMNDArray fromNestedArray: #(
110111 #( 4 3 2 9 ) #( 9 7 6 5 )
111112 ).
112- self assert: (t1 hadamardProduct: t2) equals: (PMNDArray fromNestedArray: #(
113- #( 4 6 6 36 ) #( 45 42 42 40 ) )
114- ).
113+ expectedHadamardProduct := PMNDArray fromNestedArray: #(
114+ #( 4 6 6 36 ) #( 45 42 42 40 )
115+ ).
116+
117+ self assert: (t1 hadamardProduct: t2) equals: expectedHadamardProduct.
115118
116119 t1 := PMNDArray fromNestedArray:
117120 #(
@@ -126,12 +129,14 @@ PMNDArrayTest >> testHadamardProduct [
126129 #( #( 0 6 ) #( 3 8) )
127130 #( #( 3 5) #( 1 10) )
128131 ).
129- self assert: (t1 hadamardProduct: t2) equals: (PMNDArray fromNestedArray:
130- #(
131- #( #( 1 6 ) #( 6 4 ) )
132- #( #( 0 36 ) #( 21 64 ) )
133- #( #( 27 50 ) #( 11 120 ) ))
134- ).
132+
133+ expectedHadamardProduct := PMNDArray fromNestedArray: #(
134+ #( #( 1 6 ) #( 6 4 ) )
135+ #( #( 0 36 ) #( 21 64 ) )
136+ #( #( 27 50 ) #( 11 120 ) )).
137+
138+
139+ self assert: (t1 hadamardProduct: t2) equals: expectedHadamardProduct
135140
136141
137142
You can’t perform that action at this time.
0 commit comments