Skip to content

Commit b43192c

Browse files
author
Andy Ferris
committed
Fixed type prediction issue in *(StaticMatrix, Vector)
1 parent e44a59b commit b43192c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/matrix_multiply.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ end
176176
s = (sA[1],)
177177
T = promote_op(matprod, TA, Tb)
178178

179-
if T == Tb
179+
if T == TA
180180
newtype = similar_type(A, s)
181181
else
182182
newtype = similar_type(A, T, s)
@@ -204,7 +204,7 @@ end
204204
s = (sA[1],)
205205
T = promote_op(matprod, TA, Tb)
206206

207-
if T == Tb
207+
if T == TA
208208
newtype = similar_type(A, s)
209209
else
210210
newtype = similar_type(A, T, s)

test/matrix_multiply.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
m5 = @SMatrix [1.0 2.0; 3.0 4.0]
2828
v7 = [1.0, 2.0]
2929
@test (m5*v7)::SVector @SVector [5.0, 11.0]
30+
31+
m6 = @SMatrix Float32[1.0 2.0; 3.0 4.0]
32+
v8 = Float64[1.0, 2.0]
33+
@test (m6*v8)::SVector{2,Float64} @SVector [5.0, 11.0]
34+
3035
end
3136

3237
@testset "Vector-matrix" begin

0 commit comments

Comments
 (0)