Skip to content

Commit

Permalink
Increase error tolerance for advanced mode (#410)
Browse files Browse the repository at this point in the history
* increase error tol to 1e-4 in some places I missed

* bump patch version
  • Loading branch information
vlandau authored Feb 16, 2024
1 parent 5d24d81 commit ed9a655
Show file tree
Hide file tree
Showing 2 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.2"
version = "5.13.3"

[deps]
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
Expand Down
6 changes: 3 additions & 3 deletions src/raster/advanced.jl
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ function multiple_solve(s::AMGSolver, matrix::SparseMatrixCSC{T,V}, sources::Vec
csinfo("Time taken to construct preconditioner = $t1 seconds", suppress_info)
t1 = @elapsed volt = solve_linear_system(matrix, sources, M)
# @assert norm(matrix*volt .- sources) < (eltype(sources) == Float64 ? TOL_DOUBLE : TOL_SINGLE)
@assert (norm(matrix*volt .- sources) / norm(sources)) < 1e-6
@assert (norm(matrix*volt .- sources) / norm(sources)) < 1e-4
csinfo("Time taken to solve linear system = $t1 seconds", suppress_info)
volt
end
Expand All @@ -319,7 +319,7 @@ function multiple_solve(s::CholmodSolver, matrix::SparseMatrixCSC{T,V}, sources:
factor = construct_cholesky_factor(matrix, s, suppress_info)
t1 = @elapsed volt = solve_linear_system(factor, matrix, sources)
# @assert norm(matrix*volt .- sources) < (eltype(sources) == Float64 ? TOL_DOUBLE : TOL_SINGLE)
@assert (norm(matrix*volt .- sources) / norm(sources)) < 1e-6
@assert (norm(matrix*volt .- sources) / norm(sources)) < 1e-4
csinfo("Time taken to solve linear system = $t1 seconds", suppress_info)
volt
end
Expand All @@ -328,7 +328,7 @@ function multiple_solve(s::MKLPardisoSolver, matrix::SparseMatrixCSC{T,V}, sourc
factor = construct_cholesky_factor(matrix, s, suppress_info)
t1 = @elapsed volt = solve_linear_system(factor, matrix, sources)
# @assert norm(matrix*volt .- sources) < (eltype(sources) == Float64 ? TOL_DOUBLE : TOL_SINGLE)
@assert (norm(matrix*volt .- sources) / norm(sources)) < 1e-6
@assert (norm(matrix*volt .- sources) / norm(sources)) < 1e-4
csinfo("Time taken to solve linear system = $t1 seconds", suppress_info)
volt
end
Expand Down

0 comments on commit ed9a655

Please sign in to comment.