Skip to content

Commit

Permalink
[KaMinPar] Rename KaMinPar::import_graph() to KaMinPar::borrow_and_mu…
Browse files Browse the repository at this point in the history
…tate_graph(), keep old name for now
  • Loading branch information
DanielSeemaier committed Oct 11, 2023
1 parent 3dc7221 commit 08bb0d6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
7 changes: 7 additions & 0 deletions kaminpar-shm/kaminpar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,15 @@ Context &KaMinPar::context() {
return _ctx;
}

// @deprecated in favor of borrow_and_mutate_graph()
void KaMinPar::take_graph(
const NodeID n, EdgeID *xadj, NodeID *adjncy, NodeWeight *vwgt, EdgeWeight *adjwgt
) {
borrow_and_mutate_graph(n, xadj, adjncy, vwgt, adjwgt);
}

void KaMinPar::borrow_and_mutate_graph(
const NodeID n, EdgeID *xadj, NodeID *adjncy, NodeWeight *vwgt, EdgeWeight *adjwgt
) {
const EdgeID m = xadj[n];

Expand Down
15 changes: 12 additions & 3 deletions kaminpar-shm/kaminpar.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ class KaMinPar {
shm::Context &context();

/*!
* Sets the graph to be partitioned by taking ownership of the given pointers. In particular, the
* partitioner might modify the data pointed to.
* The caller is responsible for free'ing the memory.
* Sets the graph to be partitioned by taking temporary ownership of the given pointers. In
* particular, the partitioner might modify the data pointed to. The caller is responsible for
* free'ing the memory.
*
* @param n The number of nodes in the graph.
* @param xadj Array of length `n + 1`, where `xadj[u]` points to the first neighbor of node `u`
Expand All @@ -346,6 +346,15 @@ class KaMinPar {
* @param adjwgt Array of length `xadj[n]` storing the weight of each edge. Note that reverse
* edges must be assigned the same weight. If the edges are unweighted, pass `nullptr`.
*/
void borrow_and_mutate_graph(
shm::NodeID n,
shm::EdgeID *xadj,
shm::NodeID *adjncy,
shm::NodeWeight *vwgt,
shm::EdgeWeight *adjwgt
);

/*! @deprecated in favor of borrow_and_mutate_graph() */
void take_graph(
shm::NodeID n,
shm::EdgeID *xadj,
Expand Down

0 comments on commit 08bb0d6

Please sign in to comment.