Skip to content

Commit cc34e5e

Browse files
committed
similar_type convert on all inv methods including >4 and 1
1 parent 3fbb854 commit cc34e5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/inv.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
_inv(Size(A),A,S)
55
end
66

7-
@inline _inv(::Size{(1,1)}, A, S::Type) = inv(A[1])
7+
@inline _inv(::Size{(1,1)}, A, S::Type) = similar_type(A,S)(inv(A[1]))
88

99
@inline function _inv(::Size{(2,2)}, A, S::Type)
1010
newtype = similar_type(A,S)
@@ -56,6 +56,6 @@ end
5656
return A = similar_type(A,S)(B)
5757
end
5858

59-
@inline function _inv(::Size, A ,::Type)
60-
inv(Matrix(A))
59+
@inline function _inv(::Size, A , S::Type)
60+
similar_type(A,S)(inv(Matrix(A)))
6161
end

0 commit comments

Comments
 (0)