deba@822: // -*- c++ -*- deba@822: #ifndef SYM_MAP_H deba@822: #define SYM_MAP_H deba@822: deba@822: ///\ingroup graphmaps deba@822: ///\file deba@822: ///\brief Graph maps that construates and destruates deba@822: ///their elements dynamically. deba@822: deba@822: namespace hugo { deba@822: deba@822: /// \addtogroup graphmaps deba@822: /// @{ deba@822: deba@822: /** The SymEdgeIt is wrapper class for the EdgeIt. It can be used to deba@822: * iterate on the symmetric maps when all of the edge - reverse edge pair deba@822: * has different parity. deba@822: */ deba@822: deba@844: deba@822: template deba@822: class SymEdgeIt : public EdgeIt { deba@822: public: deba@822: deba@822: /** Default constructor. deba@822: */ deba@822: SymEdgeIt() deba@822: : EdgeIt() {} deba@822: deba@822: /** Graph initialized constructor. deba@822: */ deba@822: SymEdgeIt(const Graph& graph) deba@822: : EdgeIt(graph) { deba@844: while ( (EdgeIt::n & 1) && EdgeIt::n != -1) { deba@822: EdgeIt::operator++(); deba@822: } deba@822: } deba@822: deba@822: /** Creating invelid SymEdgeIt. deba@822: */ deba@822: SymEdgeIt(Invalid invalid) deba@822: : EdgeIt(invalid) {} deba@822: deba@822: /** SymEdgeIt from the given Edge. deba@822: */ deba@822: SymEdgeIt(const Graph& graph, const Edge& edge) deba@822: : EdgeIt(graph, edge) { deba@844: while ( (EdgeIt::n & 1) && EdgeIt::n != -1) { deba@822: EdgeIt::operator++(); deba@822: } deba@822: } deba@822: deba@822: /** Increase operator. deba@822: */ deba@822: SymEdgeIt& operator++() { deba@822: EdgeIt::operator++(); deba@844: while ( (EdgeIt::n & 1) && EdgeIt::n != -1) { deba@822: EdgeIt::operator++(); deba@822: } deba@822: return *this; deba@822: } deba@822: }; deba@822: deba@822: /** The SymMap template class is graph map structure what deba@822: * wraps an other map structure to use as symmetric map structure. deba@822: * deba@822: * The template parameter is the MapRegistry that the maps deba@822: * will belong to and the ValueType. deba@822: */ deba@822: template