Skip to content

Commit

Permalink
Interface the binary ColPack
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Jun 12, 2024
1 parent 5b1ceb8 commit 10d0892
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ColPack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
22 changes: 22 additions & 0 deletions src/colpack_binary.jl
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 10d0892

Please sign in to comment.