#ifndef NK_MISC_H #define NK_MISC_H #include "rust/cxx.h" #include #include #include namespace NetworKit { using namespace std; inline unique_ptr NewNode2Vec(const Graph &G, double P = 1, double Q = 1, count L = 80, count N = 10, count D = 128) { return make_unique(G, P, Q, L, N, D); } inline void Node2VecGetFeatures(const Node2Vec &algo, rust::Vec &ret) { for (auto &&row : algo.getFeatures()) { for (auto &&el : row) { ret.push_back(el); } } } inline unique_ptr NewEdmondsKarp(const Graph &G, node source, node sink) { return make_unique(G, source, sink); } inline unique_ptr> EdmondsKarpGetSourceSet(const EdmondsKarp &algo) { return make_unique>(algo.getSourceSet()); } inline unique_ptr> EdmondsKarpGetFlowVector(const EdmondsKarp &algo) { return make_unique>(algo.getFlowVector()); } inline unique_ptr NewLuby() { return make_unique(); } inline void LubyRun(Luby &algo, const Graph &g, rust::Vec &ret) { for (auto &&v : algo.run(g)) { ret.push_back(v); } } inline bool LubyIsIndependentSet(const Luby &algo, rust::Slice set, const Graph &g) { vector v{set.begin(), set.end()}; return algo.isIndependentSet(v, g); } } #endif // NK_MISC_H