Tutorial

Jacobian coloring

julia> using ColPack, SparseArrays
julia> J = sparse([
           1 1 0 0 0
           0 0 1 0 0
           0 1 0 1 0
           0 0 0 1 1
       ]);

julia> adjJ = ColPack.matrix2adjmatrix(J; partition_by_rows=false)
5×5 SparseMatrixCSC{Float64, UInt32} with 6 stored entries:
  ⋅   1.0   ⋅    ⋅    ⋅ 
 1.0   ⋅    ⋅   1.0   ⋅ 
  ⋅    ⋅    ⋅    ⋅    ⋅ 
  ⋅   1.0   ⋅    ⋅   1.0
  ⋅    ⋅    ⋅   1.0   ⋅ 
julia> coloring = ColPackColoring(adjJ, d1_coloring(), natural_ordering());

julia> colors = get_colors(coloring)
5-element Vector{Int64}:
 1
 2
 1
 1
 2

julia> length(unique(colors)) == 2
true

Hessian coloring

Warning

Work in progress