xymap.h
changeset 157 7e6ad28aeb9e
parent 98 f60f89147531
child 174 95872af46fc4
equal deleted inserted replaced
1:af22938c8238 2:3c8eb4838a83
     1 #ifndef XYMAP_H
     1 #ifndef XYMAP_H
     2 #define XYMAP_H
     2 #define XYMAP_H
     3 
     3 
     4 #include <lemon/list_graph.h>
     4 #include <lemon/list_graph.h>
     5 #include <lemon/xy.h>
     5 #include <lemon/dim2.h>
     6 
     6 
     7 template<class M>
     7 template<class M>
     8 class XYMap
     8 class XYMap
     9 {
     9 {
    10   private:
    10   private:
    11     M *xmap, *ymap;
    11     M *xmap, *ymap;
    12 
    12 
    13   public:
    13   public:
    14     typedef typename M::Key Key;
    14     typedef typename M::Key Key;
    15     typedef lemon::xy<typename M::Value> Value;
    15     typedef lemon::dim2::Point<typename M::Value> Value;
    16     XYMap() {}
    16     XYMap() {}
    17     XYMap(M &_xmap, M &_ymap) : xmap(&_xmap), ymap(&_ymap) {}
    17     XYMap(M &_xmap, M &_ymap) : xmap(&_xmap), ymap(&_ymap) {}
    18     void setXMap(M &_xmap) { xmap = &_xmap; }
    18     void setXMap(M &_xmap) { xmap = &_xmap; }
    19     void setYMap(M &_ymap) { ymap = &_ymap; }
    19     void setYMap(M &_ymap) { ymap = &_ymap; }
    20     Value operator[](Key k) const
    20     Value operator[](Key k) const