Skip to content
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
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ExtendableSparse"
uuid = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
version = "2.3.0"
version = "2.3.1"
authors = ["Juergen Fuhrmann <juergen.fuhrmann@wias-berlin.de>", "Daniel Runge"]

[deps]
Expand All @@ -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"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions ext/ExtendableSparseIncompleteLUExt.jl
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion ext/ExtendableSparseLinearSolveExt.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ExtendableSparseLinearSolveExt
using LinearSolve
using LinearSolve: LinearSolve, LinearProblem, solve!, init
import ExtendableSparse: LinearSolvePreconBuilder
import LinearAlgebra
using SparseArrays: AbstractSparseMatrixCSC
Expand Down
22 changes: 20 additions & 2 deletions test/alltests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/test_block.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 27 additions & 8 deletions test/test_prod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,50 @@ 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()
ProdB1 = ProductPreconBuilder(IdB, IluB)
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)
Expand Down
Loading