Skip to content

Commit 2a44808

Browse files
author
Julian
committed
Improved naming and return SMatrix (not MMatrix).
1 parent 90210b4 commit 2a44808

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/solve.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ end
2626
(a[1,1]*a[2,2] - a[1,2]*a[2,1])*b[3]) / d )
2727
end
2828

29-
for Dim in 2:3 # no improvements for Dim = 1 and if no specialized solve is available
29+
for Sa in 2:3 # not needed for Sa = 1;
3030
@eval begin
31-
@inline function solve(::Size{($Dim,$Dim)}, ::Size{Sb}, a::StaticMatrix{<:Any, <:Any, Ta}, b::StaticMatrix{<:Any, <:Any, Tb}) where {Sb, Ta, Tb}
31+
@inline function solve(::Size{($Sa,$Sa)}, ::Size{Sb}, a::StaticMatrix{<:Any, <:Any, Ta}, b::StaticMatrix{<:Any, <:Any, Tb}) where {Sb, Ta, Tb}
3232
d = det(a)
3333
T = typeof((one(Ta)*zero(Tb) + one(Ta)*zero(Tb))/d)
3434
c = similar(b, T)
3535
for col = 1:Sb[2]
36-
@inbounds c[:, col] = solve(Size($Dim,$Dim), Size($Dim,), a, b[:, col])
36+
@inbounds c[:, col] = solve(Size($Sa,$Sa), Size($Sa,), a, b[:, col])
3737
end
38-
return c
38+
return similar_type(b, T)(c)
3939
end
4040
end # @eval
4141
end

0 commit comments

Comments
 (0)