MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / infer_n_vertices

Method infer_n_vertices

source/matplot/axes_objects/network.cpp:290–302  ·  view source on GitHub ↗

If the user has not provided a list of nodes we assume this is a list from 0 to max(edge)

Source from the content-addressed store, hash-verified

288 /// If the user has not provided a list of nodes
289 /// we assume this is a list from 0 to max(edge)
290 void network::infer_n_vertices() {
291 // look for highest edge index
292 size_t n_vertices = edges_[0].first;
293 for (const auto &[edge_index_a, edge_index_b] : edges_) {
294 if (edge_index_a > n_vertices) {
295 n_vertices = edge_index_a;
296 }
297 if (edge_index_b > n_vertices) {
298 n_vertices = edge_index_b;
299 }
300 }
301 n_vertices_ = n_vertices + 1;
302 }
303
304 size_t network::n_vertices() {
305 if (n_vertices_ != 0) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected