Skip to content

Commit a29df05

Browse files
committed
Addition of the expectedHadamardProduct variable (which returns the result of the Hadamard product) to materialize intention revealing
1 parent d4f7ad6 commit a29df05

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/Math-Matrix/PMNDArrayTest.class.st

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,19 @@ PMNDArrayTest >> testFromNestedArray [
102102

103103
{ #category : #tests }
104104
PMNDArrayTest >> 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

0 commit comments

Comments
 (0)