Skip to content

Commit 3129487

Browse files
authored
Infrastructure for factorizations including Pardiso
Infrastructure for factorizations including Pardiso * Reusable LU factorization * infrastructure for Pardiso, AlgebraicMultigrid, IncompleteLU etc. based on Require.jl * minmal julia version -> 1.5 (because of lu!) * Unittests for packages loaded via require * Documentation update * Define generic default methods for factorizations, specialize only if necessary.
1 parent 7890449 commit 3129487

22 files changed

+609
-165
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
version:
18-
- '1.3' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
18+
- '1.5' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
1919
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
2020
# - 'nightly'
2121
os:

Project.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
name = "ExtendableSparse"
22
uuid = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
33
authors = ["Juergen Fuhrmann <juergen.fuhrmann@wias-berlin.de>"]
4-
version = "0.4.2"
4+
version = "0.5.0"
55

66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
88
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
99
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
10+
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1011
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
12+
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
1113
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1214

1315
[compat]
1416
DocStringExtensions = "^0.8.0"
15-
julia = "1"
17+
Requires = "^1.1.3"
18+
julia = "^1.5"
1619

1720
[extras]
1821
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"

docs/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[deps]
2+
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
23
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
34
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
45
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
56
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
67
ExtendableSparse = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
7-
8+
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
9+
Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2"

docs/make.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
push!(LOAD_PATH,"../src/")
2-
using Documenter, ExtendableSparse
3-
2+
using Documenter, ExtendableSparse,Pardiso,AlgebraicMultigrid,IncompleteLU
43

54
makedocs(sitename="ExtendableSparse.jl",
65
modules = [ExtendableSparse],
@@ -13,6 +12,7 @@ makedocs(sitename="ExtendableSparse.jl",
1312
"example.md",
1413
"extsparse.md",
1514
"iter.md",
15+
"internal.md",
1616
"changes.md",
1717
])
1818

docs/src/changes.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changes
2-
2+
## v0.5, April 10, 2021
3+
- Introduce lu/lu! , factorize/factorize!, unifying LU factorizations and preconditioners
4+
- Interface packages: Pardiso, AlgebraicMultigrid, IncompleteLU via Requires.jl
5+
## v0.4, March 2021
6+
- Fix handling of Symmetrix matrices
7+
- `rawupdateindex` does not check for entering zeros
8+
- Compare with `COO` method
9+
- Benchmarks in documentation
310
## v0.3.7, March 20, 2021
411
- Added parallel jacobi preconditioner (thanks, @jkr)
512
- Fixes ldiv

docs/src/extsparse.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Sparse matrix handling
22

3+
## Matrix creation and update API
34
```@autodocs
45
Modules = [ExtendableSparse]
5-
Pages = ["sparsematrixlnk.jl","sparsematrixcsc.jl","extendable.jl", "sprand.jl"]
6+
Pages = ["extendable.jl"]
7+
```
8+
9+
## Test matrix creation
10+
```@autodocs
11+
Modules = [ExtendableSparse]
12+
Pages = ["sprand.jl"]
613
```
714

docs/src/internal.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Internal API
2+
3+
4+
## Linked List Sparse Matrix format
5+
```@autodocs
6+
Modules = [ExtendableSparse]
7+
Pages = ["sparsematrixlnk.jl"]
8+
```
9+
10+
## Some methods for SparseMatrixCSC
11+
```@autodocs
12+
Modules = [ExtendableSparse]
13+
Pages = ["sparsematrixcsc.jl"]
14+
```
15+

docs/src/iter.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1-
# Preconditioners
1+
# Factorizations & Preconditioners
2+
3+
## Factorizations
4+
5+
In this package, preconditioners and LU factorizations are subcategories are both seen
6+
as complete or approximate _factorizations_. Correspondingly there is a common API for
7+
their creation.
8+
9+
Factorizations from these package know the matrices which have been factorized.
10+
211
```@autodocs
312
Modules = [ExtendableSparse]
4-
Pages = ["preconditioners.jl", "ilu0.jl", "jacobi.jl", "parallel_jacobi.jl","simple_iteration.jl"]
13+
Pages = ["factorizations.jl"]
514
```
15+
16+
## LU Factorizations
17+
```@autodocs
18+
Modules = [ExtendableSparse]
19+
Pages = ["umfpack_lu.jl", "pardiso_lu.jl"]
20+
```
21+
22+
## Preconditioners
23+
```@autodocs
24+
Modules = [ExtendableSparse]
25+
Pages = ["jacobi.jl","ilu0.jl","parallel_jacobi.jl","ilut.jl","amg.jl"]
26+
```
27+

src/ExtendableSparse.jl

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,41 @@
11
module ExtendableSparse
2-
using DocStringExtensions
32
using SparseArrays
43
using LinearAlgebra
4+
using SuiteSparse
5+
using Requires
6+
7+
using DocStringExtensions
8+
9+
510

611
include("sparsematrixcsc.jl")
712
include("sparsematrixlnk.jl")
813
include("extendable.jl")
14+
915
export SparseMatrixLNK,ExtendableSparseMatrix,flush!,nnz, updateindex!, rawupdateindex!, colptrs
1016

11-
include("preconditioners.jl")
17+
include("factorizations.jl")
1218
export JacobiPreconditioner, ILU0Preconditioner, ParallelJacobiPreconditioner
19+
export issolver
20+
export factorize,factorize!, update!
21+
export ILUTPreconditioner, AMGPreconditioner
1322

1423
include("simple_iteration.jl")
1524
export simple,simple!
1625

26+
27+
28+
1729
include("sprand.jl")
1830
export sprand!,sprand_sdd!, fdrand,fdrand!,fdrand_coo
31+
32+
33+
function __init__()
34+
@require Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" include("pardiso_lu.jl")
35+
@require IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895" include("ilut.jl")
36+
@require AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c" include("amg.jl")
37+
end
38+
39+
40+
1941
end # module

src/amg.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""
2+
$(TYPEDEF)
3+
4+
"""
5+
mutable struct AMGPreconditioner{Tv, Ti} <: AbstractExtendableSparsePreconditioner{Tv,Ti}
6+
A::ExtendableSparseMatrix{Tv,Ti}
7+
fact
8+
end
9+
10+
"""
11+
```
12+
AMGPreconditioner(extmatrix)
13+
```
14+
"""
15+
function AMGPreconditioner(A::ExtendableSparseMatrix{Tv,Ti}) where {Tv,Ti}
16+
@inbounds flush!(A)
17+
p=AlgebraicMultigrid.aspreconditioner(AlgebraicMultigrid.ruge_stuben(A.cscmatrix))
18+
AMGPreconditioner{Tv,Ti}(A,p)
19+
end
20+
21+
function update!(precon::AMGPreconditioner{Tv,Ti}) where {Tv,Ti}
22+
@inbounds flush!(precon.A)
23+
precon.fact=AlgebraicMultigrid.aspreconditioner(AlgebraicMultigrid.ruge_stuben(precon.A.cscmatrix))
24+
end
25+
26+

0 commit comments

Comments
 (0)