Thursday, 15 August 2013

c++11 - boost graph library adjacency_list: maintain EdgeList sorted by EdgeProperties -


I try to use a std :: multiset container with EdgeProperties for EdgeProperties with strict weak commands Named Boost (strip proporpedMultisetS {}; template & lt; class ValueType & gt; Structure Container & lt; Proportion Multicets, Value Type & gt; {Struct Less {Bool} Operator () (cost value type & amp; LHS, constant value type & amp; rhs) const {returns (lhs.get_property ()) & lt; rhs.get_property ()); }; }; Typedef std :: multiset & lt; ValueType, less & gt; type; }; Struct MyVertexProp {int v; }; Street MyDeGeprop {Bull Operator & lt; (Cost MySpop & amp; RA) Const. {This-> Weight & lt; Rhs.weight; } Double weight; } Typedef adjacency_list & lt; ListS, list, undirectedS, MyVertexProp, MyEdgeProp, no_property, proposedMultisets & gt; PropOrderedGraph; } Promotion of namespace; Int main () {PropOrderedGraph g; // // (auto e_range = edges (g); e_range.first! = E_range.second; ++ e_range.first) adding some circles and edges {// works! Weight STD :: COAT & LT; & Lt; G [* e_range.first]. Weight & lt; & Lt; Std :: endl; } (Auto v_range = meridian (g); v_range.first! = V_range.second; ++ v_range.first) {// works! All meridian prints (random order) std :: cout & lt; & Lt; G [* v_range.first] .v & lt; & Lt; Std :: endl; } Auto first_vertex = * circular (g). First; (Auto adj_v_range = adjacent_vertices (first_vtex, g); adj_v_range.first! = Adj_v_range.second; ++ adj_v_range.first) {/ problem: dereferencing reasons compiler error, see std :: cout

The reference to the iterator in the third for-loop causes a compiler error:

/ usr / include / boost / graph / detail / Adjacency_list.hpp: 2 9 3: 69: Error: Invalid initialization of the context of 'MyIdegeProp End' by inline property & amp; Expression of 'Cans Mieijpop'; Get_property () {return m_iter-> get_property (); }

Any idea how can I fix that error or how can I complete the task?

I have changed the graph library and now I am using LEMO, which is class for my work IterableValueMap provides


1 comment: