src/lemon/map_utils.h
changeset 1237 2414b5ab7684
parent 1211 73912ba03d83
child 1239 8e1c3c30578b
equal deleted inserted replaced
4:a43d1a1fcdb0 5:79045cf6e7d1
   241     /// \brief The class represents the inverse of the map.
   241     /// \brief The class represents the inverse of the map.
   242     ///
   242     ///
   243     /// The class represents the inverse of the map.
   243     /// The class represents the inverse of the map.
   244     /// \see inverse()
   244     /// \see inverse()
   245     class InverseMap {
   245     class InverseMap {
   246     protected:
   246     public:
       
   247       /// \brief Constructor.
       
   248       ///
       
   249       /// Constructor for creating an id-to-item map.
   247       InverseMap(const Graph& _graph) : graph(&_graph) {}
   250       InverseMap(const Graph& _graph) : graph(&_graph) {}
   248     public:
   251       /// \brief Gives back the given item from its id.
   249       /// \brief Gives back the given item by its id.
       
   250       ///
   252       ///
   251       /// Gives back the given item by its id.
   253       /// Gives back the given item from its id.
   252       /// 
   254       /// 
   253       Item operator[](int id) const { return graph->fromId(id, Item());}
   255       Item operator[](int id) const { return graph->fromId(id, Item());}
   254     private:
   256     private:
   255       const Graph* graph;
   257       const Graph* graph;
   256     };
   258     };