Skip to content

Commit 5145c99

Browse files
Update LinearSolveRecursiveFactorizationExt.jl
1 parent 9deb01e commit 5145c99

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/LinearSolveRecursiveFactorizationExt.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::ButterflyFactoriz
111111
kwargs...)
112112
cache_A = cache.A
113113
cache_A = convert(AbstractMatrix, cache_A)
114-
b = cache.b
114+
cache_b = cache.b
115115
M, N = size(cache_A)
116116
workspace = cache.cacheval[1]
117117
thread = alg.thread
118118

119119
if cache.isfresh
120120
@assert M==N "A must be square"
121121
if (size(workspace.A, 1) != M)
122-
workspace = RecursiveFactorization.🦋workspace(cache_A, b)
122+
workspace = RecursiveFactorization.🦋workspace(cache_A, cache_b)
123123
end
124124
(;A, b, ws, U, V, out, tmp, n) = workspace
125125
RecursiveFactorization.🦋mul!(A, ws)
@@ -130,6 +130,9 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::ButterflyFactoriz
130130

131131
workspace, F = cache.cacheval
132132
(;A, b, ws, U, V, out, tmp, n) = workspace
133+
for i in 1:M
134+
@inbounds b[i] = cache_b[i]
135+
end
133136
mul!(tmp, U', b)
134137
TriangularSolve.ldiv!(F, tmp, thread)
135138
mul!(b, V, tmp)

0 commit comments

Comments
 (0)