Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increase solve error tolerance from 1e-6 to 1e-4 #407

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading