Skip to content

Commit 5efa48e

Browse files
committed
Documentation fixes
1 parent 3385cae commit 5efa48e

File tree

12 files changed

+117
-32
lines changed

12 files changed

+117
-32
lines changed

docs/Project.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
55
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
66
ExtendableSparse = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
77

8-
[compat]
9-
DocStringExtensions = "^0.8"
10-
DocumenterTools = "^0.1"
11-
Documenter = "^0.25"

docs/make.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ using Documenter, ExtendableSparse
44
makedocs(sitename="ExtendableSparse.jl",
55
modules = [ExtendableSparse],
66
doctest = true,
7-
clean = true,
7+
clean = false,
88
authors = "J. Fuhrmann",
99
repo="https://github.com/j-fu/ExtendableSparse.jl",
1010
pages=[
1111
"Home"=>"index.md",
1212
"example.md",
13+
"extsparse.md",
14+
"iter.md",
1315
"changes.md",
14-
"api.md"
1516
])
1617

1718
deploydocs(repo = "github.com/j-fu/ExtendableSparse.jl.git")

docs/src/api.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

docs/src/changes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# Changes
2+
3+
## v0.3.7, March 20, 2021
4+
- Added parallel jacobi preconditioner (thanks, @jkr)
5+
- Fixes ldiv
6+
- Added simple iterative solver
7+
- Documentation update
8+
- Tests for precondioners, fdrand
9+
210
## v0.3.0, April 10, 2020
311
- Don't create new entry if the value to be assigned is zero, making things consistent with SparseMatrixCSC and ForwardDiff
412
as suggested by @MaximilianJHuber

docs/src/example.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ using BenchmarkTools # hide
7373
A=fdrand(30,30,30, matrixtype=SparseMatrixCSC);
7474
@benchmark fdrand!(A,30,30,30, update=(A,v,i,j)-> A[i,j]+=v);
7575
```
76+
7677
```@example
7778
using ExtendableSparse # hide
7879
using SparseArrays # hide
@@ -90,6 +91,7 @@ using BenchmarkTools # hide
9091
A=fdrand(30,30,30, matrixtype=ExtendableSparseMatrix);
9192
@benchmark fdrand!(A,30,30,30, update=(A,v,i,j)-> A[i,j]+=v);
9293
```
94+
9395
```@example
9496
using ExtendableSparse # hide
9597
using BenchmarkTools # hide

docs/src/extsparse.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Sparse matrix handling
2+
3+
```@autodocs
4+
Modules = [ExtendableSparse]
5+
Pages = ["sparsematrixlnk.jl","sparsematrixcsc.jl","extendable.jl", "sprand.jl"]
6+
```
7+

docs/src/iter.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Preconditioners
2+
```@autodocs
3+
Modules = [ExtendableSparse]
4+
Pages = ["preconditioners.jl", "ilu0.jl", "jacobi.jl", "parallel_jacobi.jl","simple_iteration.jl"]
5+
```

src/ExtendableSparse.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using LinearAlgebra
66
include("sparsematrixcsc.jl")
77
include("sparsematrixlnk.jl")
88
include("extendable.jl")
9-
export SparseMatrixLNK,ExtendableSparseMatrix,flush!,nnz, updateindex, colptrs
9+
export SparseMatrixLNK,ExtendableSparseMatrix,flush!,nnz, updateindex!, colptrs
1010

1111
include("preconditioners.jl")
1212
export JacobiPreconditioner, ILU0Preconditioner, ParallelJacobiPreconditioner

src/ilu0.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
"""
2+
$(TYPEDEF)
3+
4+
ILU(0) Preconditioner
5+
"""
16
mutable struct ILU0Preconditioner{Tv, Ti} <: AbstractExtendablePreconditioner{Tv,Ti}
27
extmatrix::ExtendableSparseMatrix{Tv,Ti}
38
xdiag::Array{Tv,1}
49
idiag::Array{Ti,1}
510
pattern_timestamp::Float64
611
end
712

13+
"""
14+
$(SIGNATURES)
815
16+
Constructor for ILU(0) preconditioner
17+
"""
918
function ILU0Preconditioner(extmatrix::ExtendableSparseMatrix{Tv,Ti}) where {Tv,Ti}
1019
@assert size(extmatrix,1)==size(extmatrix,2)
1120
flush!(extmatrix)
@@ -16,9 +25,19 @@ function ILU0Preconditioner(extmatrix::ExtendableSparseMatrix{Tv,Ti}) where {Tv,
1625
update!(precon)
1726
end
1827

28+
"""
29+
$(SIGNATURES)
30+
31+
Constructor for ILU(0) preconditioner
32+
"""
1933
ILU0Preconditioner(cscmatrix::SparseMatrixCSC{Tv,Ti}) where {Tv,Ti}=ILU0Preconditioner(ExtendableSparseMatrix(cscmatrix))
2034

2135

36+
"""
37+
$(SIGNATURES)
38+
39+
Update ILU(0) preconditioner
40+
"""
2241
function update!(precon::ILU0Preconditioner{Tv,Ti}) where {Tv,Ti}
2342
cscmatrix=precon.extmatrix.cscmatrix
2443
colptr=cscmatrix.colptr
@@ -59,6 +78,11 @@ function update!(precon::ILU0Preconditioner{Tv,Ti}) where {Tv,Ti}
5978
end
6079

6180

81+
"""
82+
$(SIGNATURES)
83+
84+
Solve preconditioning system for ILU(0)
85+
"""
6286
function LinearAlgebra.ldiv!(u::AbstractArray{T,1}, precon::ILU0Preconditioner, v::AbstractArray{T,1}) where T
6387
cscmatrix=precon.extmatrix.cscmatrix
6488
colptr=cscmatrix.colptr
@@ -85,6 +109,11 @@ function LinearAlgebra.ldiv!(u::AbstractArray{T,1}, precon::ILU0Preconditioner,
85109
end
86110
end
87111

112+
"""
113+
$(SIGNATURES)
114+
115+
Inplace solve of preconditioning system for ILU(0)
116+
"""
88117
function LinearAlgebra.ldiv!(precon::ILU0Preconditioner, v::AbstractArray{T,1} where T)
89118
ldiv!(v, precon, v)
90119
end

src/jacobi.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
"""
2+
$(TYPEDEF)
3+
4+
Jacobi preconditoner
5+
"""
16
struct JacobiPreconditioner{Tv, Ti} <: AbstractExtendablePreconditioner{Tv,Ti}
27
extmatrix::ExtendableSparseMatrix{Tv,Ti}
38
invdiag::Array{Tv,1}
49
end
510

11+
"""
12+
$(SIGNATURES)
13+
14+
Update Jacobi preconditoner
15+
"""
616
function update!(precon::JacobiPreconditioner)
717
cscmatrix=precon.extmatrix.cscmatrix
818
invdiag=precon.invdiag
@@ -13,6 +23,11 @@ function update!(precon::JacobiPreconditioner)
1323
precon
1424
end
1525

26+
"""
27+
$(SIGNATURES)
28+
29+
Construct Jacobi preconditoner
30+
"""
1631
function JacobiPreconditioner(extmatrix::ExtendableSparseMatrix{Tv,Ti}) where {Tv,Ti}
1732
@assert size(extmatrix,1)==size(extmatrix,2)
1833
flush!(extmatrix)
@@ -21,9 +36,19 @@ function JacobiPreconditioner(extmatrix::ExtendableSparseMatrix{Tv,Ti}) where {T
2136
update!(precon)
2237
end
2338

39+
"""
40+
$(SIGNATURES)
41+
42+
Construct Jacobi preconditoner
43+
"""
2444
JacobiPreconditioner(cscmatrix::SparseMatrixCSC{Tv,Ti}) where {Tv,Ti}=JacobiPreconditioner(ExtendableSparseMatrix(cscmatrix))
2545

2646

47+
"""
48+
$(SIGNATURES)
49+
50+
Solve Jacobi preconditioning system
51+
"""
2752
function LinearAlgebra.ldiv!(u::AbstractArray{T,1} where T, precon::JacobiPreconditioner, v::AbstractArray{T,1} where T)
2853
invdiag=precon.invdiag
2954
n=length(invdiag)
@@ -32,6 +57,11 @@ function LinearAlgebra.ldiv!(u::AbstractArray{T,1} where T, precon::JacobiPreco
3257
end
3358
end
3459

60+
"""
61+
$(SIGNATURES)
62+
63+
Inplace solve Jacobi preconditioning system
64+
"""
3565
function LinearAlgebra.ldiv!(precon::JacobiPreconditioner, v::AbstractArray{T,1} where T)
3666
ldiv!(v, precon, v)
3767
end

0 commit comments

Comments
 (0)