# HG changeset patch # User deba # Date 1171211691 0 # Node ID 5365600a7a5c09a09b931cb0d98ea5d1d15e5a3c # Parent 57c316cb868ba7ca4c2767a853e437ce17021e4f Some bug fix RevIt => RevEdgeIt renaming diff -r 57c316cb868b -r 5365600a7a5c lemon/bits/path_dump.h --- a/lemon/bits/path_dump.h Wed Feb 07 18:07:10 2007 +0000 +++ b/lemon/bits/path_dump.h Sun Feb 11 16:34:51 2007 +0000 @@ -1,3 +1,4 @@ + /* -*- C++ -*- * * This file is a part of LEMON, a generic C++ optimization library @@ -49,32 +50,32 @@ return predMap[target] != INVALID; } - class RevIt { + class RevEdgeIt { public: - RevIt() {} - RevIt(Invalid) : path(0), current(INVALID) {} - RevIt(const PredMapPath& _path) + RevEdgeIt() {} + RevEdgeIt(Invalid) : path(0), current(INVALID) {} + RevEdgeIt(const PredMapPath& _path) : path(&_path), current(_path.target) {} operator const typename Graph::Edge() const { return path->predMap[current]; } - RevIt& operator++() { + RevEdgeIt& operator++() { current = path->graph.source(path->predMap[current]); if (path->predMap[current] == INVALID) current = INVALID; return *this; } - bool operator==(const RevIt& e) const { + bool operator==(const RevEdgeIt& e) const { return current == e.current; } - bool operator!=(const RevIt& e) const { + bool operator!=(const RevEdgeIt& e) const { return current != e.current; } - bool operator<(const RevIt& e) const { + bool operator<(const RevEdgeIt& e) const { return current < e.current; } @@ -121,18 +122,18 @@ return source != target; } - class RevIt { + class RevEdgeIt { public: - RevIt() {} - RevIt(Invalid) : path(0), current(INVALID) {} - RevIt(const PredMatrixMapPath& _path) + RevEdgeIt() {} + RevEdgeIt(Invalid) : path(0), current(INVALID) {} + RevEdgeIt(const PredMatrixMapPath& _path) : path(&_path), current(_path.target) {} operator const typename Graph::Edge() const { return path->predMatrixMap(path->source, current); } - RevIt& operator++() { + RevEdgeIt& operator++() { current = path->graph.source(path->predMatrixMap(path->source, current)); if (path->predMatrixMap(path->source, current) == INVALID) @@ -140,15 +141,15 @@ return *this; } - bool operator==(const RevIt& e) const { + bool operator==(const RevEdgeIt& e) const { return current == e.current; } - bool operator!=(const RevIt& e) const { + bool operator!=(const RevEdgeIt& e) const { return current != e.current; } - bool operator<(const RevIt& e) const { + bool operator<(const RevEdgeIt& e) const { return current < e.current; } diff -r 57c316cb868b -r 5365600a7a5c lemon/concepts/path.h --- a/lemon/concepts/path.h Wed Feb 07 18:07:10 2007 +0000 +++ b/lemon/concepts/path.h Sun Feb 11 16:34:51 2007 +0000 @@ -171,7 +171,7 @@ int l = p.length(); int e = p.empty(); - typename _Path::RevIt id, ii(INVALID), i(p); + typename _Path::RevEdgeIt id, ii(INVALID), i(p); ++i; typename _Graph::Edge ed = i; @@ -232,9 +232,9 @@ /// \brief Forward or reverse dumping /// /// If the RevPathTag is defined and true then reverse dumping - /// is provided in the path proxy. In this case instead of the - /// EdgeIt the RevIt iterator should be implemented in the - /// proxy. + /// is provided in the path dumper. In this case instead of the + /// EdgeIt the RevEdgeIt iterator should be implemented in the + /// dumper. typedef False RevPathTag; /// \brief Lemon style iterator for path edges @@ -268,27 +268,27 @@ /// /// This class is used to iterate on the edges of the paths in /// reverse direction. - class RevIt { + class RevEdgeIt { public: /// Default constructor - RevIt() {} + RevEdgeIt() {} /// Invalid constructor - RevIt(Invalid) {} + RevEdgeIt(Invalid) {} /// Constructor for first edge - RevIt(const PathDumper &) {} + RevEdgeIt(const PathDumper &) {} /// Conversion to Edge operator Edge() const { return INVALID; } /// Next edge - RevIt& operator++() {return *this;} + RevEdgeIt& operator++() {return *this;} /// Comparison operator - bool operator==(const RevIt&) const {return true;} + bool operator==(const RevEdgeIt&) const {return true;} /// Comparison operator - bool operator!=(const RevIt&) const {return true;} + bool operator!=(const RevEdgeIt&) const {return true;} /// Comparison operator - bool operator<(const RevIt&) const {return false;} + bool operator<(const RevEdgeIt&) const {return false;} }; diff -r 57c316cb868b -r 5365600a7a5c lemon/path.h --- a/lemon/path.h Wed Feb 07 18:07:10 2007 +0000 +++ b/lemon/path.h Sun Feb 11 16:34:51 2007 +0000 @@ -217,7 +217,7 @@ void buildRev(const CPath& path) { int len = path.length(); head.reserve(len); - for (typename CPath::RevIt it(path); it != INVALID; ++it) { + for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) { head.push_back(it); } } @@ -375,7 +375,7 @@ int len = path.length(); data.resize(len); int index = len; - for (typename CPath::RevIt it(path); it != INVALID; ++it) { + for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) { --index; data[index] = it;; } @@ -720,7 +720,7 @@ template void buildRev(const CPath& path) { - for (typename CPath::RevIt it(path); it != INVALID; ++it) { + for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) { addFront(it); } } @@ -881,7 +881,7 @@ len = path.length(); edges = new Edge[len]; int index = len; - for (typename CPath::RevIt it(path); it != INVALID; ++it) { + for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) { --index; edges[index] = it; } diff -r 57c316cb868b -r 5365600a7a5c lemon/path_utils.h --- a/lemon/path_utils.h Wed Feb 07 18:07:10 2007 +0000 +++ b/lemon/path_utils.h Sun Feb 11 16:34:51 2007 +0000 @@ -48,7 +48,7 @@ typename BuildEnable = void, typename RevEnable = void> struct PathCopySelector { static void copy(Target& target, const Source& source) { - source.clear(); + target.clear(); for (typename Source::EdgeIt it(source); it != INVALID; ++it) { target.addBack(it); } @@ -60,8 +60,8 @@ Target, Source, BuildEnable, typename enable_if::type> { static void copy(Target& target, const Source& source) { - source.clear(); - for (typename Source::RevIt it(source); it != INVALID; ++it) { + target.clear(); + for (typename Source::RevEdgeIt it(source); it != INVALID; ++it) { target.addFront(it); } }