Skip to content

Commit

Permalink
rmd copy of solve-function testset
Browse files Browse the repository at this point in the history
  • Loading branch information
vpuri3 committed Apr 6, 2022
1 parent a232e44 commit 6dd5925
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions test/basictests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,35 +318,4 @@ end
end
end

@testset "Solve Function" begin

A1 = rand(n) |> Diagonal; b1 = rand(n); x1 = zero(b1)
A2 = rand(n) |> Diagonal; b2 = rand(n); x2 = zero(b1)

function sol_func(A,b,u,p,newA,Pl,Pr,solverdata;verbose=true, kwargs...)
if verbose == true
println("out-of-place solve")
end
u = A \ b
end

function sol_func!(A,b,u,p,newA,Pl,Pr,solverdata;verbose=true, kwargs...)
if verbose == true
println("in-place solve")
end
ldiv!(u,A,b)
end

prob1 = LinearProblem(A1, b1; u0=x1)
prob2 = LinearProblem(A1, b1; u0=x1)

for alg in (
LinearSolveFunction(),
LinearSolveFunction(sol_func),
LinearSolveFunction(sol_func!),
)
test_interface(alg, prob1, prob2)
end
end

end # testset

0 comments on commit 6dd5925

Please sign in to comment.