c++ - edge_index zero for all edges? -
Define my As far as I can say with documentation and examples, this should work. An adjacency_list does not have a edge index associated with it, only one Top Index To keep a growth index, you have to add it manually to the graph description, and then manually manage it. boost :: graph as the following, let me increase the edge index for all edges Get zero Why? What am i doing
#include & lt; Iostream & gt; # Include & lt; Boost / graph / adjacency_list.hpp & gt; Int main () {typedef boost :: adjacency_list & lt; Boost :: vecS, boost :: vecS, boost :: directs, boost :: no_property, boost :: property & lt; Boost :: edge_index_t, std :: size_t & gt; & Gt; Graph; Typedef boost :: graph_traits & lt; Graph & gt; :: Edge _ Descriptor Edge; Graphs (3); Edge e1 = boost :: add_edge (0, 1, g). First; Edge e2 = boost :: add_edge (1, 2, g). First; Edge E3 = Extend :: add_edge (2, 0, g). First; Boost :: property_map & lt; Graph, boost :: edge_index_t> :: type eim = boost :: get (boost :: edge_index, g); Size_te E1N = EIM [E1], E2N = EIM [E2], E3N = EIM [E3]; Return 0; }
Comments
Post a Comment