Skip to content

Commit

Permalink
increase solve error tolerance from 1e-6 to 1e-4 (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
vlandau authored Jan 29, 2024
1 parent e798886 commit 8eb3f87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Circuitscape"
uuid = "2b7a1792-8151-5239-925d-e2b8fdfa3201"
version = "5.13.1"
version = "5.13.2"

[deps]
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
Expand Down
2 changes: 1 addition & 1 deletion lib/CircuitscapeMKLPardiso/src/CircuitscapeMKLPardiso.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function solve_linear_system(factor::MKLPardisoFactorize, matrix, rhs)
x = zeros(eltype(matrix), size(matrix, 1))
for i = 1:size(lhs, 2)
factor(x, mat, rhs[:,i])
@assert (norm(mat*x .- rhs[:,i]) / norm(rhs[:,i])) < 1e-6
@assert (norm(mat*x .- rhs[:,i]) / norm(rhs[:,i])) < 1e-4
lhs[:,i] .= x
end
lhs
Expand Down
4 changes: 2 additions & 2 deletions src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -610,15 +610,15 @@ function solve_linear_system(
G::SparseMatrixCSC{T,V},
curr::Vector{T}, M)::Vector{T} where {T,V}
v = cg(G, curr, Pl = M, reltol = T(1e-6), maxiter = 100_000)
@assert norm(G*v .- curr) / norm(curr) < 1e-6
@assert norm(G*v .- curr) / norm(curr) < 1e-4
v
end


function solve_linear_system(factor::SuiteSparse.CHOLMOD.Factor, matrix, rhs)
lhs = factor \ rhs
for i = 1:size(rhs, 2)
@assert (norm(matrix*lhs[:,i] .- rhs[:,i]) / norm(rhs[:,i])) < 1e-6
@assert (norm(matrix*lhs[:,i] .- rhs[:,i]) / norm(rhs[:,i])) < 1e-4
end
lhs
end
Expand Down

0 comments on commit 8eb3f87

Please sign in to comment.