lemon/path.h
changeset 2375 e30a0fdad0d7
parent 2336 215a6f3e33c9
child 2386 81b47fc5c444
equal deleted inserted replaced
10:f0e7dc0b195d 11:1527d9ba6aa4
   215 
   215 
   216     template <typename CPath>
   216     template <typename CPath>
   217     void buildRev(const CPath& path) {
   217     void buildRev(const CPath& path) {
   218       int len = path.length();
   218       int len = path.length();
   219       head.reserve(len);
   219       head.reserve(len);
   220       for (typename CPath::RevIt it(path); it != INVALID; ++it) {
   220       for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) {
   221         head.push_back(it);
   221         head.push_back(it);
   222       }
   222       }
   223     }
   223     }
   224 
   224 
   225   protected:
   225   protected:
   373     template <typename CPath>
   373     template <typename CPath>
   374     void buildRev(const CPath& path) {
   374     void buildRev(const CPath& path) {
   375       int len = path.length();
   375       int len = path.length();
   376       data.resize(len);
   376       data.resize(len);
   377       int index = len;
   377       int index = len;
   378       for (typename CPath::RevIt it(path); it != INVALID; ++it) {
   378       for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) {
   379         --index;
   379         --index;
   380         data[index] = it;;
   380         data[index] = it;;
   381       }
   381       }
   382     }
   382     }
   383 
   383 
   718       }
   718       }
   719     }
   719     }
   720 
   720 
   721     template <typename CPath>
   721     template <typename CPath>
   722     void buildRev(const CPath& path) {
   722     void buildRev(const CPath& path) {
   723       for (typename CPath::RevIt it(path); it != INVALID; ++it) {
   723       for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) {
   724         addFront(it);
   724         addFront(it);
   725       }
   725       }
   726     }
   726     }
   727 
   727 
   728   };
   728   };
   879     template <typename CPath>
   879     template <typename CPath>
   880     void buildRev(const CPath& path) {
   880     void buildRev(const CPath& path) {
   881       len = path.length();
   881       len = path.length();
   882       edges = new Edge[len];
   882       edges = new Edge[len];
   883       int index = len;
   883       int index = len;
   884       for (typename CPath::RevIt it(path); it != INVALID; ++it) {
   884       for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) {
   885         --index;
   885         --index;
   886         edges[index] = it;
   886         edges[index] = it;
   887       }
   887       }
   888     }
   888     }
   889 
   889