@@ -146,20 +146,26 @@ mul_wrappers = [
146
146
@test m* transpose (n) === @SMatrix [8 14 ; 18 32 ]
147
147
@test transpose (m)* transpose (n) === @SMatrix [11 19 ; 16 28 ]
148
148
149
- for wrapper_m in mul_wrappers, wrapper_n in mul_wrappers
150
- wm = wrapper_m (m)
151
- wn = wrapper_n (n)
152
- res_structure = StaticArrays. mul_result_structure (wm, wn)
153
- expected_type = if res_structure == identity
154
- SMatrix{2 ,2 ,Int,4 }
155
- elseif res_structure == LowerTriangular
156
- LowerTriangular{Int,SMatrix{2 ,2 ,Int,4 }}
157
- elseif res_structure == UpperTriangular
158
- UpperTriangular{Int,SMatrix{2 ,2 ,Int,4 }}
159
- else
160
- error (" Unknown structure: " , res_structure)
149
+ # check different sizes because there are multiple implementations for matrices of different sizes
150
+ for (mm, nn) in [
151
+ (m, n),
152
+ # (SMatrix{10, 10}(collect(1:100)), SMatrix{10, 10}(collect(1:100))),
153
+ (SMatrix {15, 15} (collect (1 : 225 )), SMatrix {15, 15} (collect (1 : 225 )))]
154
+ for wrapper_m in mul_wrappers, wrapper_n in mul_wrappers
155
+ wm = wrapper_m (mm)
156
+ wn = wrapper_n (nn)
157
+ res_structure = StaticArrays. mul_result_structure (wm, wn)
158
+ expected_type = if res_structure == identity
159
+ typeof (mm)
160
+ elseif res_structure == LowerTriangular
161
+ LowerTriangular{Int,typeof (mm)}
162
+ elseif res_structure == UpperTriangular
163
+ UpperTriangular{Int,typeof (mm)}
164
+ else
165
+ error (" Unknown structure: " , res_structure)
166
+ end
167
+ @test (@inferred wm * wn):: expected_type == wrapper_m (Array (mm)) * wrapper_n (Array (nn))
161
168
end
162
- @test (@inferred wm * wn):: expected_type == wrapper_m (Array (m)) * wrapper_n (Array (n))
163
169
end
164
170
165
171
m = @MMatrix [1 2 ; 3 4 ]
0 commit comments