File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 1
1
name = " SparseMatrixColorings"
2
2
uuid = " 0a514795-09f3-496d-8182-132a7b665d35"
3
3
authors = [" Guillaume Dalle <22795598+gdalle@users.noreply.github.com>" ]
4
- version = " 0.1 .0"
4
+ version = " 0.2 .0"
5
5
6
6
[deps ]
7
7
ADTypes = " 47edcb42-4c32-4615-8424-f2b9edc5f35b"
Original file line number Diff line number Diff line change 1
1
[deps ]
2
+ ADTypes = " 47edcb42-4c32-4615-8424-f2b9edc5f35b"
2
3
Documenter = " e30172f5-a6a5-5a46-863b-614d45cd2de4"
3
4
DocumenterInterLinks = " d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
4
5
SparseMatrixColorings = " 0a514795-09f3-496d-8182-132a7b665d35"
Original file line number Diff line number Diff line change 1
1
"""
2
2
GreedyColoringAlgorithm <: ADTypes.AbstractColoringAlgorithm
3
3
4
- Matrix coloring algorithm for sparse Jacobians and Hessians.
4
+ Greedy coloring algorithm for sparse Jacobians and Hessians, with configurable vertex order .
5
5
6
6
Compatible with the [ADTypes.jl coloring framework](https://sciml.github.io/ADTypes.jl/stable/#Coloring-algorithm).
7
7
@@ -13,6 +13,34 @@ Compatible with the [ADTypes.jl coloring framework](https://sciml.github.io/ADTy
13
13
14
14
- [`ADTypes.column_coloring`](@extref ADTypes) and [`ADTypes.row_coloring`](@extref ADTypes) with a partial distance-2 coloring of the bipartite graph
15
15
- [`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)
16
44
"""
17
45
struct GreedyColoringAlgorithm{O<: AbstractOrder } <: ADTypes.AbstractColoringAlgorithm
18
46
order:: O
You can’t perform that action at this time.
0 commit comments