Skip to content

Commit fccec10

Browse files
committed
Use TriangularSolve for Butterfly factorization
1 parent 7d78703 commit fccec10

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/butterflylu.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ struct 🦋workspace{T}
3939
end
4040
end
4141

42-
function 🦋lu!(workspace::🦋workspace, M, thread)
42+
function 🦋solve!(workspace::🦋workspace, M, thread)
4343
(;A, b, ws, U, V, out) = workspace
4444
🦋mul!(A, ws)
4545
F = RecursiveFactorization.lu!(A, Val(false), thread)
46-
sol = V * (F \ (U' * b))
47-
out .= @view sol[1:M]
46+
47+
mul!(b, U', b)
48+
ldiv!(b, UnitLowerTriangular(F.factors), b, thread)
49+
ldiv!(b, UpperTriangular(F.factors), b, thread)
50+
mul!(b, V, b)
51+
out .= @view b[1:M]
4852
out
4953
end
5054

0 commit comments

Comments
 (0)