Skip to content

Commit c0e674e

Browse files
committed
Fix bug in 1x1 solve
1 parent 7cc7f9d commit c0e674e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/solve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@inline solve(::Size, ::Size, a, b) = inv(a) * b
55

66
@inline function solve(::Size{(1,1)}, ::Size{(1,)}, a::StaticMatrix{<:Any, <:Any, Ta}, b::StaticVector{<:Any, Tb}) where {Ta, Tb}
7-
@inbounds return similar_type(b, typeof(b[1] \ a[1]))(b[1] \ a[1])
7+
@inbounds return similar_type(b, typeof(a[1] \ b[1]))(a[1] \ b[1])
88
end
99

1010
@inline function solve(::Size{(2,2)}, ::Size{(2,)}, a::StaticMatrix{<:Any, <:Any, Ta}, b::StaticVector{<:Any, Tb}) where {Ta, Tb}

test/solve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using StaticArrays, Base.Test
66
elty in (Float64, Int)
77

88
A = elty.(rand(-99:2:99,n,n))
9-
b = A*ones(elty,n)
9+
b = 2*A*ones(elty,n)
1010
@test m(A)\v(b) A\b
1111
end
1212

0 commit comments

Comments
 (0)