diff --git a/Project.toml b/Project.toml index b7cd762..4295113 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ExtendableSparse" uuid = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3" -version = "2.3.0" +version = "2.3.1" authors = ["Juergen Fuhrmann ", "Daniel Runge"] [deps] @@ -23,7 +23,7 @@ ExtendableSparseLinearSolveExt = "LinearSolve" [compat] AMGCLWrap = "2" -AlgebraicMultigrid = "0.4, 0.5, 0.6, 1" +AlgebraicMultigrid = "0.4, 0.5, 0.6, 1, 2" Aqua = "0.8" BenchmarkTools = "1" ChunkSplitters = "2, 3" @@ -36,9 +36,9 @@ IncompleteLU = "^0.2.1" InteractiveUtils = "1.11.0" IterativeSolvers = "0.9" LinearAlgebra = "1.10" -LinearSolve = "2.36.0, 3.7.1" +LinearSolve = "2.36.0, 3.7.1,4" Metis = "1" -MultiFloats = "1, 2" +MultiFloats = "1, 2, 3" OhMyThreads = "0.6, 0.7, 0.8" Printf = "1.10" Random = "1.10" diff --git a/ext/ExtendableSparseIncompleteLUExt.jl b/ext/ExtendableSparseIncompleteLUExt.jl index 53df7ac..c3bf71e 100644 --- a/ext/ExtendableSparseIncompleteLUExt.jl +++ b/ext/ExtendableSparseIncompleteLUExt.jl @@ -1,8 +1,8 @@ module ExtendableSparseIncompleteLUExt using ExtendableSparse -using IncompleteLU +using IncompleteLU: IncompleteLU using LinearAlgebra: I -using SparseArrays: AbstractSparseMatrixCSC, SparseMatrixCSC, getcolptr, rowvals, nonzeros +using SparseArrays: AbstractSparseMatrixCSC, SparseMatrixCSC import ExtendableSparse: ILUTPreconBuilder diff --git a/ext/ExtendableSparseLinearSolveExt.jl b/ext/ExtendableSparseLinearSolveExt.jl index 66a0efd..58628ec 100644 --- a/ext/ExtendableSparseLinearSolveExt.jl +++ b/ext/ExtendableSparseLinearSolveExt.jl @@ -1,5 +1,5 @@ module ExtendableSparseLinearSolveExt -using LinearSolve +using LinearSolve: LinearSolve, LinearProblem, solve!, init import ExtendableSparse: LinearSolvePreconBuilder import LinearAlgebra using SparseArrays: AbstractSparseMatrixCSC diff --git a/test/alltests.jl b/test/alltests.jl index 99b4e84..2ce179d 100644 --- a/test/alltests.jl +++ b/test/alltests.jl @@ -21,13 +21,31 @@ end @test ExplicitImports.check_no_implicit_imports(ExtendableSparse) === nothing @test ExplicitImports.check_all_explicit_imports_via_owners(ExtendableSparse) === nothing @static if VERSION >= v"1.11.0" - @test ExplicitImports.check_all_explicit_imports_are_public(ExtendableSparse, ignore = (:AbstractSparseMatrixCSC, :getcolptr, :indtype)) === nothing + @test ExplicitImports.check_all_explicit_imports_are_public( + ExtendableSparse, + ignore = ( + :AbstractSparseMatrixCSC, + :getcolptr, + :indtype, + ) + ) === nothing end @test ExplicitImports.check_no_stale_explicit_imports(ExtendableSparse) === nothing @test ExplicitImports.check_all_qualified_accesses_via_owners(ExtendableSparse) === nothing @test ExplicitImports.check_all_qualified_accesses_are_public( ExtendableSparse, - ignore = (:AbstractSparseMatrixCSC, :AbstractTriangular, :getcolptr, :Forward, :USE_GPL_LIBS, :_checkbuffers, :print_array, :sparse!, :indtype) + ignore = ( + :AbstractSparseMatrixCSC, + :AbstractTriangular, + :getcolptr, + :Forward, + :USE_GPL_LIBS, + :_checkbuffers, + :print_array, + :sparse!, + :indtype, + :AbstractFactorization, + ) ) === nothing @test ExplicitImports.check_no_self_qualified_accesses(ExtendableSparse) === nothing end diff --git a/test/test_block.jl b/test/test_block.jl index f147cb3..c43dbec 100644 --- a/test/test_block.jl +++ b/test/test_block.jl @@ -2,7 +2,7 @@ module test_block using Test using ExtendableSparse using ExtendableSparse: BlockPreconditioner, jacobi -using ILUZero, AlgebraicMultigrid +using ILUZero using IterativeSolvers using LinearAlgebra using Sparspak diff --git a/test/test_prod.jl b/test/test_prod.jl index d4e9af7..26e287c 100644 --- a/test/test_prod.jl +++ b/test/test_prod.jl @@ -7,18 +7,12 @@ using LinearAlgebra using Random function main(; n = 100) - seed = 1340 + seed = 1341 Random.seed!(seed) A = fdrand(n, n) sol0 = ones(n^2) b = A * sol0 - # need to reinit random so the shadow residual is the same for all calls - Random.seed!(seed) - sol1, hist1 = bicgstabl(A, b, log = true) - @test sol1 ≈ sol0 rtol = 1.0e-5 - @show hist1 - IdB = IdentityPreconBuilder() IluB = ILUZeroPreconBuilder() @@ -26,12 +20,37 @@ function main(; n = 100) ProdB2 = ProductPreconBuilder(IluB, IdB) ProdB3 = ProductPreconBuilder(IluB, IluB) + + p1, _ = IluB(A, nothing) + pp, _ = ProdB3(A, nothing) + x0 = rand(n^2) + r0 = A * x0 - b + d0 = ldiv!(p1, r0) + x1 = x0 - d0 + r1 = A * x1 - b + d1 = ldiv!(p1, r1) + x2 = x1 - d1 + + rp0 = A * x0 - b + dp0 = ldiv!(pp, rp0) + y1 = x0 - dp0 + + @test norm(x2 - y1, Inf) ≈ 0 atol = 5.0e-14 + + # need to reinit random so the shadow residual is the same for all calls + Random.seed!(seed) + sol1, hist1 = bicgstabl(A, b, log = true) + @test sol1 ≈ sol0 rtol = 1.0e-5 + @show hist1 + + IdP, _ = IdB(A, 0) Random.seed!(seed) sol2, hist2 = bicgstabl(A, b, Pl = IdP, log = true) @test sol2 ≈ sol0 rtol = 1.0e-5 @show hist2 - @test hist2.iters ≈ hist1.iters atol = 5 + @test hist2.iters ≈ hist1.iters atol = 6 + IluP, _ = IluB(A, 0) Random.seed!(seed)