Skip to content

Commit a657582

Browse files
committed
fix test, interface
1 parent fccec10 commit a657582

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/butterflylu.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ struct 🦋workspace{T}
2424
U::Matrix{T}
2525
V::Matrix{T}
2626
out::Vector{T}
27+
n::Int
2728
function 🦋workspace(A, b, ::Val{SEED} = Val(888)) where {SEED}
28-
M = size(A, 1)
29-
out = similar(b, M)
29+
N = size(A, 1)
30+
out = similar(b, N)
3031
if (M % 4 != 0)
3132
A = pad!(A)
3233
xn = 4 - M % 4
@@ -35,20 +36,20 @@ struct 🦋workspace{T}
3536
U, V = (similar(A), similar(A))
3637
ws = 🦋generate_random!(A)
3738
materializeUV(U, V, ws)
38-
new{eltype(A)}(A, b, ws, U, V, out)
39+
new{eltype(A)}(A, b, ws, U, V, out, N)
3940
end
4041
end
4142

42-
function 🦋solve!(workspace::🦋workspace, M, thread)
43-
(;A, b, ws, U, V, out) = workspace
43+
function 🦋solve!(workspace::🦋workspace, thread)
44+
(;A, b, ws, U, V, out, N) = workspace
4445
🦋mul!(A, ws)
4546
F = RecursiveFactorization.lu!(A, Val(false), thread)
4647

4748
mul!(b, U', b)
4849
ldiv!(b, UnitLowerTriangular(F.factors), b, thread)
4950
ldiv!(b, UpperTriangular(F.factors), b, thread)
5051
mul!(b, V, b)
51-
out .= @view b[1:M]
52+
out .= @view b[1:N]
5253
out
5354
end
5455

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ end
8282
A = wilkinson(i)
8383
b = rand(i)
8484
ws = RecursiveFactorization.🦋workspace(copy(A), copy(b))
85-
out = RecursiveFactorization.🦋lu!(ws, i, Val(true))
85+
out = RecursiveFactorization.🦋solve!(ws, Val(true))
8686
@test norm(A * out .- b) <= 1e-10
8787
end
8888
end

0 commit comments

Comments
 (0)