From 4e292befc435c992aac8a58249dbddb06d69f323 Mon Sep 17 00:00:00 2001 From: Nathan Baum Date: Sun, 25 Sep 2016 17:22:59 +0100 Subject: [PATCH] inv(::StaticMatrix) should always return StaticMatrix Currently, `inv(SMatrix{4, 4}(rand(Float32, 4, 4)))` returns an `Array{T, Float32}`. I think it should return a `SMatrix{4, 4}`. --- src/inv.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inv.jl b/src/inv.jl index 58e54171..0af3438d 100644 --- a/src/inv.jl +++ b/src/inv.jl @@ -40,7 +40,7 @@ else Ai = inv(lufact(AA)) end - return convert(typeof(parent(Ai)), Ai) + return convert($newtype, Ai) end end end