MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / get_adj

Method get_adj

cpp_easygraph/classes/graph.cpp:667–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

665}
666
667py::object Graph::get_adj() {
668 if (this->dirty_adj) {
669 py::dict adj = py::dict();
670 for (const auto& ego_edges : this->adj) {
671 node_t start_point = ego_edges.first;
672 py::dict ego_edges_dict = py::dict();
673 for (const auto& edge_info : ego_edges.second) {
674 node_t end_point = edge_info.first;
675 const auto& edge_attr = edge_info.second;
676 ego_edges_dict[this->id_to_node[py::cast(end_point)]] = attr_to_dict(edge_attr);
677 }
678 adj[this->id_to_node[py::cast(start_point)]] = ego_edges_dict;
679 }
680 this->adj_cache = adj;
681 this->dirty_adj = false;
682 }
683 return this->adj_cache;
684}
685
686py::object Graph::get_edges() {
687 py::list edges = py::list();

Callers

nothing calls this directly

Calls 1

attr_to_dictFunction · 0.85

Tested by

no test coverage detected