From 10d089204cd3e5491b8917ecaf5dc6663b7e72cf Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Wed, 12 Jun 2024 00:15:00 -0400 Subject: [PATCH] Interface the binary ColPack --- src/ColPack.jl | 5 +++-- src/colpack_binary.jl | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/colpack_binary.jl diff --git a/src/ColPack.jl b/src/ColPack.jl index 3f003f5..2708c59 100644 --- a/src/ColPack.jl +++ b/src/ColPack.jl @@ -7,7 +7,7 @@ A Julia interface to the C++ library [ColPack](https://github.com/CSCsw/ColPack) - [`ColPackColoring`](@ref) - [`ColPackPartialColoring`](@ref) -- [`ColPackBiColoring`](@ref) +- [`colpack`](@ref) - [`get_colors`](@ref) """ module ColPack @@ -22,12 +22,13 @@ using SparseArrays include("libcolpack.jl") include("options.jl") +include("colpack_binary.jl") include("colpack_coloring.jl") include("colpack_partial_coloring.jl") include("colpack_bicoloring.jl") # Exports -export ColPackColoring, ColPackPartialColoring, get_colors +export ColPackColoring, ColPackPartialColoring, colpack, get_colors end #module diff --git a/src/colpack_binary.jl b/src/colpack_binary.jl new file mode 100644 index 0000000..fbcf660 --- /dev/null +++ b/src/colpack_binary.jl @@ -0,0 +1,22 @@ +""" + colpack(file::String, method::String, order::String; verbose::Bool=false) + +Perform graph coloring. + +- `file`: Indicates the graph file path. +- `method`: Indicates the method. +- `order`: Indicates the ordering. +- `verbose`: Indicates verbose flag will be turned on and there will display more rich information. + +Examples: +colpack("./bcsstk01.mtx", "DISTANCE_ONE", "RANDOM", verbose=true) +colpack("./bcsstk01.mtx", "ROW_PARTIAL_DISTANCE_TWO", "NATURAL", verbose=true) +colpack("./bcsstk01.mtx", "COLUMN_PARTIAL_DISTANCE_TWO", "NATURAL", verbose=true) +""" +function colpack(file::String, method::String, order::String; verbose::Bool=false) + if verbose + run(`$(ColPack_jll.ColPack()) -f $file -m $method -o $order -v`) + else + run(`$(ColPack_jll.ColPack()) -f $file -m $method -o $order`) + end +end