[Lemon-commits] deba: r3160 - in hugo/trunk/lemon: . bits concepts
Lemon SVN
svn at lemon.cs.elte.hu
Sun Feb 11 17:34:58 CET 2007
Author: deba
Date: Sun Feb 11 17:34:51 2007
New Revision: 3160
Modified:
hugo/trunk/lemon/bits/path_dump.h
hugo/trunk/lemon/concepts/path.h
hugo/trunk/lemon/path.h
hugo/trunk/lemon/path_utils.h
Log:
Some bug fix
RevIt => RevEdgeIt renaming
Modified: hugo/trunk/lemon/bits/path_dump.h
==============================================================================
--- hugo/trunk/lemon/bits/path_dump.h (original)
+++ hugo/trunk/lemon/bits/path_dump.h Sun Feb 11 17:34:51 2007
@@ -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;
}
Modified: hugo/trunk/lemon/concepts/path.h
==============================================================================
--- hugo/trunk/lemon/concepts/path.h (original)
+++ hugo/trunk/lemon/concepts/path.h Sun Feb 11 17:34:51 2007
@@ -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;}
};
Modified: hugo/trunk/lemon/path.h
==============================================================================
--- hugo/trunk/lemon/path.h (original)
+++ hugo/trunk/lemon/path.h Sun Feb 11 17:34:51 2007
@@ -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 <typename CPath>
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;
}
Modified: hugo/trunk/lemon/path_utils.h
==============================================================================
--- hugo/trunk/lemon/path_utils.h (original)
+++ hugo/trunk/lemon/path_utils.h Sun Feb 11 17:34:51 2007
@@ -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<typename Source::RevPathTag, void>::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);
}
}
More information about the Lemon-commits
mailing list