From ed9a655c6a907fb5e2fc8261031e87ef80c58cf5 Mon Sep 17 00:00:00 2001 From: Vincent Landau Date: Fri, 16 Feb 2024 13:51:43 -0700 Subject: [PATCH] Increase error tolerance for advanced mode (#410) * increase error tol to 1e-4 in some places I missed * bump patch version --- Project.toml | 2 +- src/raster/advanced.jl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index b38d620..a14392c 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/raster/advanced.jl b/src/raster/advanced.jl index b205e7e..27f7b90 100644 --- a/src/raster/advanced.jl +++ b/src/raster/advanced.jl @@ -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 @@ -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 @@ -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