COIN-OR::LEMON - Graph Library

Changeset 2357:5365600a7a5c in lemon-0.x


Ignore:
Timestamp:
02/11/07 17:34:51 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3160
Message:

Some bug fix
RevIt? => RevEdgeIt? renaming

Location:
lemon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/path_dump.h

    r2335 r2357  
     1
    12/* -*- C++ -*-
    23 *
     
    5051    }
    5152
    52     class RevIt {
     53    class RevEdgeIt {
    5354    public:
    54       RevIt() {}
    55       RevIt(Invalid) : path(0), current(INVALID) {}
    56       RevIt(const PredMapPath& _path)
     55      RevEdgeIt() {}
     56      RevEdgeIt(Invalid) : path(0), current(INVALID) {}
     57      RevEdgeIt(const PredMapPath& _path)
    5758        : path(&_path), current(_path.target) {}
    5859
     
    6162      }
    6263
    63       RevIt& operator++() {
     64      RevEdgeIt& operator++() {
    6465        current = path->graph.source(path->predMap[current]);
    6566        if (path->predMap[current] == INVALID) current = INVALID;
     
    6768      }
    6869
    69       bool operator==(const RevIt& e) const {
     70      bool operator==(const RevEdgeIt& e) const {
    7071        return current == e.current;
    7172      }
    7273
    73       bool operator!=(const RevIt& e) const {
     74      bool operator!=(const RevEdgeIt& e) const {
    7475        return current != e.current;
    7576      }
    7677
    77       bool operator<(const RevIt& e) const {
     78      bool operator<(const RevEdgeIt& e) const {
    7879        return current < e.current;
    7980      }
     
    122123    }
    123124
    124     class RevIt {
     125    class RevEdgeIt {
    125126    public:
    126       RevIt() {}
    127       RevIt(Invalid) : path(0), current(INVALID) {}
    128       RevIt(const PredMatrixMapPath& _path)
     127      RevEdgeIt() {}
     128      RevEdgeIt(Invalid) : path(0), current(INVALID) {}
     129      RevEdgeIt(const PredMatrixMapPath& _path)
    129130        : path(&_path), current(_path.target) {}
    130131
     
    133134      }
    134135
    135       RevIt& operator++() {
     136      RevEdgeIt& operator++() {
    136137        current =
    137138          path->graph.source(path->predMatrixMap(path->source, current));
     
    141142      }
    142143
    143       bool operator==(const RevIt& e) const {
     144      bool operator==(const RevEdgeIt& e) const {
    144145        return current == e.current;
    145146      }
    146147
    147       bool operator!=(const RevIt& e) const {
     148      bool operator!=(const RevEdgeIt& e) const {
    148149        return current != e.current;
    149150      }
    150151
    151       bool operator<(const RevIt& e) const {
     152      bool operator<(const RevEdgeIt& e) const {
    152153        return current < e.current;
    153154      }
  • lemon/concepts/path.h

    r2335 r2357  
    172172          int e = p.empty();
    173173
    174           typename _Path::RevIt id, ii(INVALID), i(p);
     174          typename _Path::RevEdgeIt id, ii(INVALID), i(p);
    175175
    176176          ++i;
     
    233233      ///
    234234      /// If the RevPathTag is defined and true then reverse dumping
    235       /// is provided in the path proxy. In this case instead of the
    236       /// EdgeIt the RevIt iterator should be implemented in the
    237       /// proxy.
     235      /// is provided in the path dumper. In this case instead of the
     236      /// EdgeIt the RevEdgeIt iterator should be implemented in the
     237      /// dumper.
    238238      typedef False RevPathTag;
    239239
     
    269269      /// This class is used to iterate on the edges of the paths in
    270270      /// reverse direction.
    271       class RevIt {
     271      class RevEdgeIt {
    272272      public:
    273273        /// Default constructor
    274         RevIt() {}
     274        RevEdgeIt() {}
    275275        /// Invalid constructor
    276         RevIt(Invalid) {}
     276        RevEdgeIt(Invalid) {}
    277277        /// Constructor for first edge
    278         RevIt(const PathDumper &) {}
     278        RevEdgeIt(const PathDumper &) {}
    279279
    280280        /// Conversion to Edge
     
    282282
    283283        /// Next edge
    284         RevIt& operator++() {return *this;}
    285 
    286         /// Comparison operator
    287         bool operator==(const RevIt&) const {return true;}
    288         /// Comparison operator
    289         bool operator!=(const RevIt&) const {return true;}
     284        RevEdgeIt& operator++() {return *this;}
     285
     286        /// Comparison operator
     287        bool operator==(const RevEdgeIt&) const {return true;}
     288        /// Comparison operator
     289        bool operator!=(const RevEdgeIt&) const {return true;}
    290290        /// Comparison operator
    291         bool operator<(const RevIt&) const {return false;}
     291        bool operator<(const RevEdgeIt&) const {return false;}
    292292
    293293      };
  • lemon/path.h

    r2336 r2357  
    218218      int len = path.length();
    219219      head.reserve(len);
    220       for (typename CPath::RevIt it(path); it != INVALID; ++it) {
     220      for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) {
    221221        head.push_back(it);
    222222      }
     
    376376      data.resize(len);
    377377      int index = len;
    378       for (typename CPath::RevIt it(path); it != INVALID; ++it) {
     378      for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) {
    379379        --index;
    380380        data[index] = it;;
     
    721721    template <typename CPath>
    722722    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) {
    724724        addFront(it);
    725725      }
     
    882882      edges = new Edge[len];
    883883      int index = len;
    884       for (typename CPath::RevIt it(path); it != INVALID; ++it) {
     884      for (typename CPath::RevEdgeIt it(path); it != INVALID; ++it) {
    885885        --index;
    886886        edges[index] = it;
  • lemon/path_utils.h

    r2350 r2357  
    4949    struct PathCopySelector {
    5050      static void copy(Target& target, const Source& source) {
    51         source.clear();
     51        target.clear();
    5252        for (typename Source::EdgeIt it(source); it != INVALID; ++it) {
    5353          target.addBack(it);
     
    6161      typename enable_if<typename Source::RevPathTag, void>::type> {
    6262      static void copy(Target& target, const Source& source) {
    63         source.clear();
    64         for (typename Source::RevIt it(source); it != INVALID; ++it) {
     63        target.clear();
     64        for (typename Source::RevEdgeIt it(source); it != INVALID; ++it) {
    6565          target.addFront(it);
    6666        }
Note: See TracChangeset for help on using the changeset viewer.