diff --git a/kaminpar-shm/kaminpar.cc b/kaminpar-shm/kaminpar.cc index 4776d1fe..54ac989c 100644 --- a/kaminpar-shm/kaminpar.cc +++ b/kaminpar-shm/kaminpar.cc @@ -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]; diff --git a/kaminpar-shm/kaminpar.h b/kaminpar-shm/kaminpar.h index e7c04ff0..179871cc 100644 --- a/kaminpar-shm/kaminpar.h +++ b/kaminpar-shm/kaminpar.h @@ -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` @@ -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,