1.1 --- a/lemon/path.h Sun Jul 13 16:46:56 2008 +0100
1.2 +++ b/lemon/path.h Sun Jul 13 19:51:02 2008 +0100
1.3 @@ -1,6 +1,6 @@
1.4 -/* -*- C++ -*-
1.5 +/* -*- mode: C++; indent-tabs-mode: nil; -*-
1.6 *
1.7 - * This file is a part of LEMON, a generic C++ optimization library
1.8 + * This file is a part of LEMON, a generic C++ optimization library.
1.9 *
1.10 * Copyright (C) 2003-2008
1.11 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.12 @@ -93,12 +93,12 @@
1.13 /// \brief Invalid constructor
1.14 ArcIt(Invalid) : path(0), idx(-1) {}
1.15 /// \brief Initializate the iterator to the first arc of path
1.16 - ArcIt(const Path &_path)
1.17 + ArcIt(const Path &_path)
1.18 : path(&_path), idx(_path.empty() ? -1 : 0) {}
1.19
1.20 private:
1.21
1.22 - ArcIt(const Path &_path, int _idx)
1.23 + ArcIt(const Path &_path, int _idx)
1.24 : path(&_path), idx(_idx) {}
1.25
1.26 public:
1.27 @@ -109,10 +109,10 @@
1.28 }
1.29
1.30 /// \brief Next arc
1.31 - ArcIt& operator++() {
1.32 + ArcIt& operator++() {
1.33 ++idx;
1.34 - if (idx >= path->length()) idx = -1;
1.35 - return *this;
1.36 + if (idx >= path->length()) idx = -1;
1.37 + return *this;
1.38 }
1.39
1.40 /// \brief Comparison operator
1.41 @@ -284,13 +284,13 @@
1.42 /// Invalid constructor
1.43 ArcIt(Invalid) : path(0), idx(-1) {}
1.44 /// \brief Initializate the constructor to the first arc of path
1.45 - ArcIt(const SimplePath &_path)
1.46 + ArcIt(const SimplePath &_path)
1.47 : path(&_path), idx(_path.empty() ? -1 : 0) {}
1.48
1.49 private:
1.50
1.51 /// Constructor with starting point
1.52 - ArcIt(const SimplePath &_path, int _idx)
1.53 + ArcIt(const SimplePath &_path, int _idx)
1.54 : idx(_idx), path(&_path) {}
1.55
1.56 public:
1.57 @@ -301,10 +301,10 @@
1.58 }
1.59
1.60 /// Next arc
1.61 - ArcIt& operator++() {
1.62 + ArcIt& operator++() {
1.63 ++idx;
1.64 - if (idx >= path->length()) idx = -1;
1.65 - return *this;
1.66 + if (idx >= path->length()) idx = -1;
1.67 + return *this;
1.68 }
1.69
1.70 /// Comparison operator
1.71 @@ -413,7 +413,7 @@
1.72
1.73 protected:
1.74
1.75 - // the std::list<> is incompatible
1.76 + // the std::list<> is incompatible
1.77 // hard to create invalid iterator
1.78 struct Node {
1.79 Arc arc;
1.80 @@ -425,7 +425,7 @@
1.81 std::allocator<Node> alloc;
1.82
1.83 public:
1.84 -
1.85 +
1.86 /// \brief Default constructor
1.87 ///
1.88 /// Default constructor
1.89 @@ -470,12 +470,12 @@
1.90 /// Invalid constructor
1.91 ArcIt(Invalid) : path(0), node(0) {}
1.92 /// \brief Initializate the constructor to the first arc of path
1.93 - ArcIt(const ListPath &_path)
1.94 + ArcIt(const ListPath &_path)
1.95 : path(&_path), node(_path.first) {}
1.96
1.97 protected:
1.98
1.99 - ArcIt(const ListPath &_path, Node *_node)
1.100 + ArcIt(const ListPath &_path, Node *_node)
1.101 : path(&_path), node(_node) {}
1.102
1.103
1.104 @@ -487,9 +487,9 @@
1.105 }
1.106
1.107 /// Next arc
1.108 - ArcIt& operator++() {
1.109 + ArcIt& operator++() {
1.110 node = node->next;
1.111 - return *this;
1.112 + return *this;
1.113 }
1.114
1.115 /// Comparison operator
1.116 @@ -757,7 +757,7 @@
1.117 ///
1.118 /// Default constructor
1.119 StaticPath() : len(0), arcs(0) {}
1.120 -
1.121 +
1.122 /// \brief Template copy constructor
1.123 ///
1.124 /// This path can be initialized from any other path type.
1.125 @@ -796,13 +796,13 @@
1.126 /// Invalid constructor
1.127 ArcIt(Invalid) : path(0), idx(-1) {}
1.128 /// Initializate the constructor to the first arc of path
1.129 - ArcIt(const StaticPath &_path)
1.130 + ArcIt(const StaticPath &_path)
1.131 : path(&_path), idx(_path.empty() ? -1 : 0) {}
1.132
1.133 private:
1.134
1.135 /// Constructor with starting point
1.136 - ArcIt(const StaticPath &_path, int _idx)
1.137 + ArcIt(const StaticPath &_path, int _idx)
1.138 : idx(_idx), path(&_path) {}
1.139
1.140 public:
1.141 @@ -813,10 +813,10 @@
1.142 }
1.143
1.144 /// Next arc
1.145 - ArcIt& operator++() {
1.146 + ArcIt& operator++() {
1.147 ++idx;
1.148 - if (idx >= path->length()) idx = -1;
1.149 - return *this;
1.150 + if (idx >= path->length()) idx = -1;
1.151 + return *this;
1.152 }
1.153
1.154 /// Comparison operator
1.155 @@ -909,7 +909,7 @@
1.156
1.157 template <typename Path>
1.158 struct RevPathTagIndicator<
1.159 - Path,
1.160 + Path,
1.161 typename enable_if<typename Path::RevPathTag, void>::type
1.162 > {
1.163 static const bool value = true;
1.164 @@ -922,15 +922,15 @@
1.165
1.166 template <typename Path>
1.167 struct BuildTagIndicator<
1.168 - Path,
1.169 + Path,
1.170 typename enable_if<typename Path::BuildTag, void>::type
1.171 > {
1.172 static const bool value = true;
1.173 };
1.174
1.175 template <typename Target, typename Source,
1.176 - bool buildEnable = BuildTagIndicator<Target>::value,
1.177 - bool revEnable = RevPathTagIndicator<Source>::value>
1.178 + bool buildEnable = BuildTagIndicator<Target>::value,
1.179 + bool revEnable = RevPathTagIndicator<Source>::value>
1.180 struct PathCopySelector {
1.181 static void copy(Target& target, const Source& source) {
1.182 target.clear();
1.183 @@ -981,8 +981,8 @@
1.184 /// \brief Check the consistency of a path.
1.185 ///
1.186 /// This function checks that the target of each arc is the same
1.187 - /// as the source of the next one.
1.188 - ///
1.189 + /// as the source of the next one.
1.190 + ///
1.191 template <typename Digraph, typename Path>
1.192 bool checkPath(const Digraph& digraph, const Path& path) {
1.193 typename Path::ArcIt it(path);
1.194 @@ -1034,19 +1034,19 @@
1.195
1.196 typedef typename Path::Digraph Digraph;
1.197 typedef typename Digraph::Node Node;
1.198 -
1.199 +
1.200 /// Default constructor
1.201 PathNodeIt() {}
1.202 /// Invalid constructor
1.203 - PathNodeIt(Invalid)
1.204 + PathNodeIt(Invalid)
1.205 : _digraph(0), _it(INVALID), _nd(INVALID) {}
1.206 /// Constructor
1.207 - PathNodeIt(const Digraph& digraph, const Path& path)
1.208 + PathNodeIt(const Digraph& digraph, const Path& path)
1.209 : _digraph(&digraph), _it(path) {
1.210 _nd = (_it != INVALID ? _digraph->source(_it) : INVALID);
1.211 }
1.212 /// Constructor
1.213 - PathNodeIt(const Digraph& digraph, const Path& path, const Node& src)
1.214 + PathNodeIt(const Digraph& digraph, const Path& path, const Node& src)
1.215 : _digraph(&digraph), _it(path), _nd(src) {}
1.216
1.217 ///Conversion to Digraph::Node
1.218 @@ -1058,27 +1058,27 @@
1.219 PathNodeIt& operator++() {
1.220 if (_it == INVALID) _nd = INVALID;
1.221 else {
1.222 - _nd = _digraph->target(_it);
1.223 - ++_it;
1.224 + _nd = _digraph->target(_it);
1.225 + ++_it;
1.226 }
1.227 return *this;
1.228 }
1.229
1.230 /// Comparison operator
1.231 - bool operator==(const PathNodeIt& n) const {
1.232 - return _it == n._it && _nd == n._nd;
1.233 + bool operator==(const PathNodeIt& n) const {
1.234 + return _it == n._it && _nd == n._nd;
1.235 }
1.236 /// Comparison operator
1.237 - bool operator!=(const PathNodeIt& n) const {
1.238 - return _it != n._it || _nd != n._nd;
1.239 + bool operator!=(const PathNodeIt& n) const {
1.240 + return _it != n._it || _nd != n._nd;
1.241 }
1.242 /// Comparison operator
1.243 - bool operator<(const PathNodeIt& n) const {
1.244 + bool operator<(const PathNodeIt& n) const {
1.245 return (_it < n._it && _nd != INVALID);
1.246 }
1.247 -
1.248 +
1.249 };
1.250 -
1.251 +
1.252 ///@}
1.253
1.254 } // namespace lemon