File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name = " SparseMatrixColorings"
22uuid = " 0a514795-09f3-496d-8182-132a7b665d35"
33authors = [" Guillaume Dalle <22795598+gdalle@users.noreply.github.com>" ]
4- version = " 0.1 .0"
4+ version = " 0.2 .0"
55
66[deps ]
77ADTypes = " 47edcb42-4c32-4615-8424-f2b9edc5f35b"
Original file line number Diff line number Diff line change 11[deps ]
2+ ADTypes = " 47edcb42-4c32-4615-8424-f2b9edc5f35b"
23Documenter = " e30172f5-a6a5-5a46-863b-614d45cd2de4"
34DocumenterInterLinks = " d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
45SparseMatrixColorings = " 0a514795-09f3-496d-8182-132a7b665d35"
Original file line number Diff line number Diff line change 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
66Compatible 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"""
1745struct GreedyColoringAlgorithm{O<: AbstractOrder } <: ADTypes.AbstractColoringAlgorithm
1846 order:: O
You can’t perform that action at this time.
0 commit comments