You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
py::return_value_policy::reference, "read or write in the edge map of the node.");
604
+
py::return_value_policy::reference, "read or write in the edge map of the node.")
605
+
.def("get_edges", [](Node &self){
606
+
std::vector<Edge> edges;
607
+
edges.reserve(self.fano().size());
608
+
for (auto [_, edge] : self.fano()) {
609
+
edges.emplace_back(edge);
610
+
}
611
+
return edges;
612
+
});
601
613
602
614
603
615
@@ -657,6 +669,7 @@ PYBIND11_MODULE(pydsr, m) {
657
669
.def("get_nodes", &DSRGraph::get_nodes, "Returns all nodes")
658
670
.def("get_name_from_id", &DSRGraph::get_name_from_id, "id"_a, "Return the name of a node given its id")
659
671
.def("get_id_from_name", &DSRGraph::get_id_from_name, "name"_a, "Return the id from a node given its name")
672
+
.def("get_edges", &DSRGraph::get_edges, "Return all the edges in the graph")
660
673
.def("get_edges_by_type", &DSRGraph::get_edges_by_type, "type"_a, "Return all the edges with a given type.")
661
674
.def("get_edges_to_id", &DSRGraph::get_edges_to_id, "id"_a, "Return all the edges that point to the node")
662
675
.def("write_to_json_file", &DSRGraph::write_to_json_file, "file"_a, "skip_atts"_a=std::vector<std::string>{}, "Return all the edges that point to the node");
0 commit comments