Skip to content

Commit 06a55e6

Browse files
authored
Bump version (#5)
* Bump version * Add doctest
1 parent aaba292 commit 06a55e6

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SparseMatrixColorings"
22
uuid = "0a514795-09f3-496d-8182-132a7b665d35"
33
authors = ["Guillaume Dalle <22795598+gdalle@users.noreply.github.com>"]
4-
version = "0.1.0"
4+
version = "0.2.0"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[deps]
2+
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
23
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
34
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
45
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"

src/adtypes.jl

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
GreedyColoringAlgorithm <: ADTypes.AbstractColoringAlgorithm
33
4-
Matrix coloring algorithm for sparse Jacobians and Hessians.
4+
Greedy coloring algorithm for sparse Jacobians and Hessians, with configurable vertex order.
55
66
Compatible with the [ADTypes.jl coloring framework](https://sciml.github.io/ADTypes.jl/stable/#Coloring-algorithm).
77
@@ -13,6 +13,34 @@ Compatible with the [ADTypes.jl coloring framework](https://sciml.github.io/ADTy
1313
1414
- [`ADTypes.column_coloring`](@extref ADTypes) and [`ADTypes.row_coloring`](@extref ADTypes) with a partial distance-2 coloring of the bipartite graph
1515
- [`ADTypes.symmetric_coloring`](@extref ADTypes) with a star coloring of the adjacency graph
16+
17+
# Example use
18+
19+
```jldoctest
20+
using ADTypes, SparseMatrixColorings, SparseArrays
21+
22+
algo = GreedyColoringAlgorithm(SparseMatrixColorings.LargestFirst())
23+
A = sparse([
24+
0 0 1 1 0
25+
1 0 0 0 1
26+
0 1 1 0 0
27+
0 1 1 0 1
28+
])
29+
ADTypes.column_coloring(A, algo)
30+
31+
# output
32+
33+
5-element Vector{Int64}:
34+
1
35+
2
36+
1
37+
2
38+
3
39+
```
40+
41+
# See also
42+
43+
- [`AbstractOrder`](@ref)
1644
"""
1745
struct GreedyColoringAlgorithm{O<:AbstractOrder} <: ADTypes.AbstractColoringAlgorithm
1846
order::O

0 commit comments

Comments
 (0)