Skip to content

Commit 0266ebf

Browse files
simeonschaubc42f
authored andcommitted
fix #629 (#630)
* fix #629 * test `dot(::SMatrix, ::SMatrix)`
1 parent 85f2b6f commit 0266ebf

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/linalg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ end
214214
@inbounds return similar_type(a, typeof(Signed(a[2]*b[3])-Signed(a[3]*b[2])))(((Signed(a[2]*b[3])-Signed(a[3]*b[2]), Signed(a[3]*b[1])-Signed(a[1]*b[3]), Signed(a[1]*b[2])-Signed(a[2]*b[1]))))
215215
end
216216

217-
@inline dot(a::StaticVector, b::StaticVector) = _vecdot(same_size(a, b), a, b, dot)
217+
@inline dot(a::StaticArray, b::StaticArray) = _vecdot(same_size(a, b), a, b, dot)
218218
@inline bilinear_vecdot(a::StaticArray, b::StaticArray) = _vecdot(same_size(a, b), a, b, *)
219219

220220
@inline function _vecdot(::Size{S}, a::StaticArray, b::StaticArray, product) where {S}

test/linalg.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ using StaticArrays, Test, LinearAlgebra
120120
@test @inferred(dot(@SVector[[1,2],[3,4]], @SVector[[1,2],[3,4]])) === 30
121121
@test @inferred(@SVector[[1,2],[3,4]]' * @SVector[[1,2],[3,4]]) === 30
122122

123+
m1 = reshape(v1, Size(2,2))
124+
m2 = reshape(v2, Size(2,2))
125+
@test @inferred(dot(m1, m2)) === dot(v1, v2)
123126
end
124127

125128
@testset "transpose() and conj()" begin

0 commit comments

Comments
 (0)