Skip to content

Commit

Permalink
handle non-square case like LA
Browse files Browse the repository at this point in the history
  • Loading branch information
lxvm committed Jul 2, 2024
1 parent ea7594e commit 3847275
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/inv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,10 @@ end
end
end

inv(LUp::LU) = LUp.U \ (LUp.L \ typeof(LUp.L.data)(I)[LUp.p,:])
function inv(LUp::LU)
if !(LUp.L isa LowerTriangular)
checksquare(LUp.L)
checksquare(LUp.U)
end
LUp.U \ (LUp.L \ typeof(parent(LUp.L))(I)[LUp.p,:])
end

0 comments on commit 3847275

Please sign in to comment.