Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Dec 31, 2022
1 parent b02562b commit 22511ca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/basictests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,18 @@ end

@testset "CHOLMOD" begin
# Create a posdef symmetric matrix
A = sprand(100,100,0.01); A = A + A' + 100*I;
A = sprand(100, 100, 0.01)
A = A + A' + 100 * I

# rhs
b=rand(100);
b = rand(100)

# Set the problem
prob = LinearProblem(A,b)
prob = LinearProblem(A, b)
sol = solve(prob)

# Enforce symmetry to use Cholesky, since A is symmetric and posdef
prob2 = LinearProblem(Symmetric(A),b)
prob2 = LinearProblem(Symmetric(A), b)
sol2 = solve(prob2)
@test abs(norm(A * sol2.u .- b) - norm(A * sol.u .- b)) < 1e-12
end
Expand Down

0 comments on commit 22511ca

Please sign in to comment.