diff --git a/demo/arg_parser_demo.cc b/demo/arg_parser_demo.cc
--- a/demo/arg_parser_demo.cc
+++ b/demo/arg_parser_demo.cc
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -69,7 +69,7 @@
// exit(1) on these cases, but this makes Valgrind falsely warn
// about memory leaks.
ap.throwOnProblems();
-
+
// Perform the parsing process
// (in case of any error it terminates the program)
// The try {} construct is necessary only if the ap.trowOnProblems()
diff --git a/doc/groups.dox b/doc/groups.dox
--- a/doc/groups.dox
+++ b/doc/groups.dox
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
diff --git a/doc/mainpage.dox b/doc/mainpage.dox
--- a/doc/mainpage.dox
+++ b/doc/mainpage.dox
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -25,7 +25,7 @@
and Optimization in Networks.
It is a C++ template library providing efficient implementations of common
data structures and algorithms with focus on combinatorial optimization
-tasks connected mainly with graphs and networks.
+tasks connected mainly with graphs and networks.
LEMON is an open source
@@ -35,7 +35,7 @@
\ref license "license terms".
-The project is maintained by the
+The project is maintained by the
Egerváry Research Group on
Combinatorial Optimization \ref egres
at the Operations Research Department of the
diff --git a/doc/min_cost_flow.dox b/doc/min_cost_flow.dox
--- a/doc/min_cost_flow.dox
+++ b/doc/min_cost_flow.dox
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -81,7 +81,7 @@
- \f$\pi(u)\leq 0\f$;
- if \f$\sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \neq sup(u)\f$,
then \f$\pi(u)=0\f$.
-
+
Here \f$cost^\pi(uv)\f$ denotes the \e reduced \e cost of the arc
\f$uv\in A\f$ with respect to the potential function \f$\pi\f$, i.e.
\f[ cost^\pi(uv) = cost(uv) + \pi(u) - \pi(v).\f]
@@ -119,7 +119,7 @@
sup(u) \quad \forall u\in V \f]
\f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A \f]
-It means that the total demand must be less or equal to the
+It means that the total demand must be less or equal to the
total supply (i.e. \f$\sum_{u\in V} sup(u)\f$ must be zero or
positive) and all the demands have to be satisfied, but there
could be supplies that are not carried out from the supply
diff --git a/lemon/adaptors.h b/lemon/adaptors.h
--- a/lemon/adaptors.h
+++ b/lemon/adaptors.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -421,7 +421,7 @@
void initialize(DGR& digraph, NF& node_filter, AF& arc_filter) {
Parent::initialize(digraph);
_node_filter = &node_filter;
- _arc_filter = &arc_filter;
+ _arc_filter = &arc_filter;
}
public:
@@ -508,11 +508,11 @@
public:
template
- class NodeMap
- : public SubMapExtender,
- LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> {
+ class NodeMap
+ : public SubMapExtender,
+ LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> {
typedef SubMapExtender,
- LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> Parent;
+ LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> Parent;
public:
typedef V Value;
@@ -535,9 +535,9 @@
};
template
- class ArcMap
+ class ArcMap
: public SubMapExtender,
- LEMON_SCOPE_FIX(DigraphAdaptorBase, ArcMap)> {
+ LEMON_SCOPE_FIX(DigraphAdaptorBase, ArcMap)> {
typedef SubMapExtender,
LEMON_SCOPE_FIX(DigraphAdaptorBase, ArcMap)> Parent;
@@ -582,7 +582,7 @@
void initialize(DGR& digraph, NF& node_filter, AF& arc_filter) {
Parent::initialize(digraph);
_node_filter = &node_filter;
- _arc_filter = &arc_filter;
+ _arc_filter = &arc_filter;
}
public:
@@ -651,10 +651,10 @@
}
template
- class NodeMap
+ class NodeMap
: public SubMapExtender,
LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> {
- typedef SubMapExtender,
+ typedef SubMapExtender,
LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> Parent;
public:
@@ -678,7 +678,7 @@
};
template
- class ArcMap
+ class ArcMap
: public SubMapExtender,
LEMON_SCOPE_FIX(DigraphAdaptorBase, ArcMap)> {
typedef SubMapExtender,
@@ -1021,10 +1021,10 @@
}
template
- class NodeMap
+ class NodeMap
: public SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, NodeMap)> {
- typedef SubMapExtender,
+ typedef SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, NodeMap)> Parent;
public:
@@ -1048,10 +1048,10 @@
};
template
- class ArcMap
+ class ArcMap
: public SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, ArcMap)> {
- typedef SubMapExtender,
+ typedef SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, ArcMap)> Parent;
public:
@@ -1075,10 +1075,10 @@
};
template
- class EdgeMap
+ class EdgeMap
: public SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> {
- typedef SubMapExtender,
+ typedef SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> Parent;
public:
@@ -1117,8 +1117,8 @@
protected:
NF* _node_filter;
EF* _edge_filter;
- SubGraphBase()
- : Parent(), _node_filter(0), _edge_filter(0) { }
+ SubGraphBase()
+ : Parent(), _node_filter(0), _edge_filter(0) { }
void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
Parent::initialize(graph);
@@ -1219,10 +1219,10 @@
}
template
- class NodeMap
+ class NodeMap
: public SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, NodeMap)> {
- typedef SubMapExtender,
+ typedef SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, NodeMap)> Parent;
public:
@@ -1246,10 +1246,10 @@
};
template
- class ArcMap
+ class ArcMap
: public SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, ArcMap)> {
- typedef SubMapExtender,
+ typedef SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, ArcMap)> Parent;
public:
@@ -1273,11 +1273,11 @@
};
template
- class EdgeMap
+ class EdgeMap
: public SubMapExtender,
LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> {
- typedef SubMapExtender,
- LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> Parent;
+ typedef SubMapExtender,
+ LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> Parent;
public:
typedef V Value;
@@ -1504,7 +1504,7 @@
true> > {
#endif
typedef DigraphAdaptorExtender<
- SubDigraphBase >,
+ SubDigraphBase >,
true> > Parent;
public:
@@ -1525,7 +1525,7 @@
///
/// Creates a subgraph for the given digraph or graph with the
/// given node filter map.
- FilterNodes(GR& graph, NF& node_filter)
+ FilterNodes(GR& graph, NF& node_filter)
: Parent(), const_true_map()
{
Parent::initialize(graph, node_filter, const_true_map);
@@ -1563,11 +1563,11 @@
class FilterNodes >::type> :
public GraphAdaptorExtender<
- SubGraphBase >,
+ SubGraphBase >,
true> > {
typedef GraphAdaptorExtender<
- SubGraphBase >,
+ SubGraphBase >,
true> > Parent;
public:
@@ -1653,7 +1653,7 @@
AF, false> > {
#endif
typedef DigraphAdaptorExtender<
- SubDigraphBase >,
+ SubDigraphBase >,
AF, false> > Parent;
public:
@@ -1761,11 +1761,11 @@
typename EF = typename GR::template EdgeMap >
class FilterEdges :
public GraphAdaptorExtender<
- SubGraphBase >,
+ SubGraphBase >,
EF, false> > {
#endif
typedef GraphAdaptorExtender<
- SubGraphBase >,
+ SubGraphBase >,
EF, false> > Parent;
public:
@@ -1790,7 +1790,7 @@
///
/// Creates a subgraph for the given graph with the given edge
/// filter map.
- FilterEdges(GR& graph, EF& edge_filter)
+ FilterEdges(GR& graph, EF& edge_filter)
: Parent(), const_true_map() {
Parent::initialize(graph, const_true_map, edge_filter);
}
@@ -1858,7 +1858,7 @@
Edge _edge;
bool _forward;
- Arc(const Edge& edge, bool forward)
+ Arc(const Edge& edge, bool forward)
: _edge(edge), _forward(forward) {}
public:
@@ -2098,7 +2098,7 @@
_forward(*adaptor._digraph), _backward(*adaptor._digraph) {}
ArcMapBase(const UndirectorBase& adaptor, const V& value)
- : _forward(*adaptor._digraph, value),
+ : _forward(*adaptor._digraph, value),
_backward(*adaptor._digraph, value) {}
void set(const Arc& a, const V& value) {
@@ -2216,7 +2216,7 @@
typedef typename ItemSetTraits::ItemNotifier EdgeNotifier;
EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
-
+
typedef EdgeNotifier ArcNotifier;
ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); }
@@ -2728,7 +2728,7 @@
typename CM = typename DGR::template ArcMap,
typename FM = CM,
typename TL = Tolerance >
- class ResidualDigraph
+ class ResidualDigraph
: public SubDigraph<
Undirector,
ConstMap >,
@@ -2785,7 +2785,7 @@
/// digraph, the capacity map, the flow map, and a tolerance object.
ResidualDigraph(const DGR& digraph, const CM& capacity,
FM& flow, const TL& tolerance = Tolerance())
- : Parent(), _capacity(&capacity), _flow(&flow),
+ : Parent(), _capacity(&capacity), _flow(&flow),
_graph(digraph), _node_filter(),
_forward_filter(capacity, flow, tolerance),
_backward_filter(capacity, flow, tolerance),
@@ -2867,7 +2867,7 @@
typedef typename CapacityMap::Value Value;
/// Constructor
- ResidualCapacity(const ResidualDigraph& adaptor)
+ ResidualCapacity(const ResidualDigraph& adaptor)
: _adaptor(&adaptor) {}
/// Returns the value associated with the given residual arc
@@ -3447,7 +3447,7 @@
/// This map adaptor class adapts two node maps of the original digraph
/// to get a node map of the split digraph.
/// Its value type is inherited from the first node map type (\c IN).
- /// \tparam IN The type of the node map for the in-nodes.
+ /// \tparam IN The type of the node map for the in-nodes.
/// \tparam OUT The type of the node map for the out-nodes.
template
class CombinedNodeMap {
diff --git a/lemon/arg_parser.cc b/lemon/arg_parser.cc
--- a/lemon/arg_parser.cc
+++ b/lemon/arg_parser.cc
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -26,8 +26,8 @@
exit(1);
else throw(ArgParserException(reason));
}
-
-
+
+
void ArgParser::_showHelp(void *p)
{
(static_cast(p))->showHelp();
diff --git a/lemon/arg_parser.h b/lemon/arg_parser.h
--- a/lemon/arg_parser.h
+++ b/lemon/arg_parser.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -42,10 +42,10 @@
UNKNOWN_OPT, /// Unknown option was given
INVALID_OPT /// Invalid combination of options
};
-
+
private:
Reason _reason;
-
+
public:
///Constructor
ArgParserException(Reason r) throw() : _reason(r) {}
@@ -141,7 +141,7 @@
std::vector _file_args;
std::string _command_name;
-
+
private:
//Bind a function to an option.
@@ -155,7 +155,7 @@
void (*func)(void *),void *data);
bool _exit_on_problems;
-
+
void _terminate(ArgParserException::Reason reason) const;
public:
@@ -423,7 +423,7 @@
const std::vector &files() const { return _file_args; }
///Throw instead of exit in case of problems
- void throwOnProblems()
+ void throwOnProblems()
{
_exit_on_problems=false;
}
diff --git a/lemon/bellman_ford.h b/lemon/bellman_ford.h
--- a/lemon/bellman_ford.h
+++ b/lemon/bellman_ford.h
@@ -1,8 +1,8 @@
-/* -*- C++ -*-
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
*
- * This file is a part of LEMON, a generic C++ optimization library
+ * This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -36,7 +36,7 @@
namespace lemon {
/// \brief Default operation traits for the BellmanFord algorithm class.
- ///
+ ///
/// This operation traits class defines all computational operations
/// and constants that are used in the Bellman-Ford algorithm.
/// The default implementation is based on the \c numeric_limits class.
@@ -45,7 +45,7 @@
///
/// \see BellmanFordToleranceOperationTraits
template <
- typename V,
+ typename V,
bool has_inf = std::numeric_limits::has_infinity>
struct BellmanFordDefaultOperationTraits {
/// \brief Value type for the algorithm.
@@ -86,7 +86,7 @@
return left < right;
}
};
-
+
/// \brief Operation traits for the BellmanFord algorithm class
/// using tolerance.
///
@@ -139,7 +139,7 @@
/// \param LEN The type of the length map.
template
struct BellmanFordDefaultTraits {
- /// The type of the digraph the algorithm runs on.
+ /// The type of the digraph the algorithm runs on.
typedef GR Digraph;
/// \brief The type of the map that stores the arc lengths.
@@ -158,18 +158,18 @@
/// \see BellmanFordDefaultOperationTraits,
/// BellmanFordToleranceOperationTraits
typedef BellmanFordDefaultOperationTraits OperationTraits;
-
- /// \brief The type of the map that stores the last arcs of the
+
+ /// \brief The type of the map that stores the last arcs of the
/// shortest paths.
- ///
+ ///
/// The type of the map that stores the last
/// arcs of the shortest paths.
/// It must conform to the \ref concepts::WriteMap "WriteMap" concept.
typedef typename GR::template NodeMap PredMap;
/// \brief Instantiates a \c PredMap.
- ///
- /// This function instantiates a \ref PredMap.
+ ///
+ /// This function instantiates a \ref PredMap.
/// \param g is the digraph to which we would like to define the
/// \ref PredMap.
static PredMap *createPredMap(const GR& g) {
@@ -184,19 +184,19 @@
/// \brief Instantiates a \c DistMap.
///
- /// This function instantiates a \ref DistMap.
- /// \param g is the digraph to which we would like to define the
+ /// This function instantiates a \ref DistMap.
+ /// \param g is the digraph to which we would like to define the
/// \ref DistMap.
static DistMap *createDistMap(const GR& g) {
return new DistMap(g);
}
};
-
+
/// \brief %BellmanFord algorithm class.
///
/// \ingroup shortest_path
- /// This class provides an efficient implementation of the Bellman-Ford
+ /// This class provides an efficient implementation of the Bellman-Ford
/// algorithm. The maximum time complexity of the algorithm is
/// O(ne).
///
@@ -207,7 +207,7 @@
/// algorithm instead, since it is more efficient.
///
/// The arc lengths are passed to the algorithm using a
- /// \ref concepts::ReadMap "ReadMap", so it is easy to change it to any
+ /// \ref concepts::ReadMap "ReadMap", so it is easy to change it to any
/// kind of length. The type of the length values is determined by the
/// \ref concepts::ReadMap::Value "Value" type of the length map.
///
@@ -237,7 +237,7 @@
///The type of the underlying digraph.
typedef typename TR::Digraph Digraph;
-
+
/// \brief The type of the arc lengths.
typedef typename TR::LengthMap::Value Value;
/// \brief The type of the map that stores the arc lengths.
@@ -284,20 +284,20 @@
// Creates the maps if necessary.
void create_maps() {
if(!_pred) {
- _local_pred = true;
- _pred = Traits::createPredMap(*_gr);
+ _local_pred = true;
+ _pred = Traits::createPredMap(*_gr);
}
if(!_dist) {
- _local_dist = true;
- _dist = Traits::createDistMap(*_gr);
+ _local_dist = true;
+ _dist = Traits::createDistMap(*_gr);
}
if(!_mask) {
_mask = new MaskMap(*_gr);
}
}
-
+
public :
-
+
typedef BellmanFord Create;
/// \name Named Template Parameters
@@ -320,11 +320,11 @@
/// \c PredMap type.
/// It must conform to the \ref concepts::WriteMap "WriteMap" concept.
template
- struct SetPredMap
+ struct SetPredMap
: public BellmanFord< Digraph, LengthMap, SetPredMapTraits > {
typedef BellmanFord< Digraph, LengthMap, SetPredMapTraits > Create;
};
-
+
template
struct SetDistMapTraits : public Traits {
typedef T DistMap;
@@ -341,7 +341,7 @@
/// \c DistMap type.
/// It must conform to the \ref concepts::WriteMap "WriteMap" concept.
template
- struct SetDistMap
+ struct SetDistMap
: public BellmanFord< Digraph, LengthMap, SetDistMapTraits > {
typedef BellmanFord< Digraph, LengthMap, SetDistMapTraits > Create;
};
@@ -350,8 +350,8 @@
struct SetOperationTraitsTraits : public Traits {
typedef T OperationTraits;
};
-
- /// \brief \ref named-templ-param "Named parameter" for setting
+
+ /// \brief \ref named-templ-param "Named parameter" for setting
/// \c OperationTraits type.
///
/// \ref named-templ-param "Named parameter" for setting
@@ -363,15 +363,15 @@
typedef BellmanFord< Digraph, LengthMap, SetOperationTraitsTraits >
Create;
};
-
+
///@}
protected:
-
+
BellmanFord() {}
- public:
-
+ public:
+
/// \brief Constructor.
///
/// Constructor.
@@ -381,7 +381,7 @@
_gr(&g), _length(&length),
_pred(0), _local_pred(false),
_dist(0), _local_dist(false), _mask(0) {}
-
+
///Destructor.
~BellmanFord() {
if(_local_pred) delete _pred;
@@ -408,8 +408,8 @@
/// \return (*this)
BellmanFord &predMap(PredMap &map) {
if(_local_pred) {
- delete _pred;
- _local_pred=false;
+ delete _pred;
+ _local_pred=false;
}
_pred = ↦
return *this;
@@ -426,8 +426,8 @@
/// \return (*this)
BellmanFord &distMap(DistMap &map) {
if(_local_dist) {
- delete _dist;
- _local_dist=false;
+ delete _dist;
+ _local_dist=false;
}
_dist = ↦
return *this;
@@ -445,28 +445,28 @@
///@{
/// \brief Initializes the internal data structures.
- ///
+ ///
/// Initializes the internal data structures. The optional parameter
/// is the initial distance of each node.
void init(const Value value = OperationTraits::infinity()) {
create_maps();
for (NodeIt it(*_gr); it != INVALID; ++it) {
- _pred->set(it, INVALID);
- _dist->set(it, value);
+ _pred->set(it, INVALID);
+ _dist->set(it, value);
}
_process.clear();
if (OperationTraits::less(value, OperationTraits::infinity())) {
- for (NodeIt it(*_gr); it != INVALID; ++it) {
- _process.push_back(it);
- _mask->set(it, true);
- }
+ for (NodeIt it(*_gr); it != INVALID; ++it) {
+ _process.push_back(it);
+ _mask->set(it, true);
+ }
} else {
- for (NodeIt it(*_gr); it != INVALID; ++it) {
- _mask->set(it, false);
- }
+ for (NodeIt it(*_gr); it != INVALID; ++it) {
+ _mask->set(it, false);
+ }
}
}
-
+
/// \brief Adds a new source node.
///
/// This function adds a new source node. The optional second parameter
@@ -474,8 +474,8 @@
void addSource(Node source, Value dst = OperationTraits::zero()) {
_dist->set(source, dst);
if (!(*_mask)[source]) {
- _process.push_back(source);
- _mask->set(source, true);
+ _process.push_back(source);
+ _mask->set(source, true);
}
}
@@ -500,26 +500,26 @@
/// \see ActiveIt
bool processNextRound() {
for (int i = 0; i < int(_process.size()); ++i) {
- _mask->set(_process[i], false);
+ _mask->set(_process[i], false);
}
std::vector nextProcess;
std::vector values(_process.size());
for (int i = 0; i < int(_process.size()); ++i) {
- values[i] = (*_dist)[_process[i]];
+ values[i] = (*_dist)[_process[i]];
}
for (int i = 0; i < int(_process.size()); ++i) {
- for (OutArcIt it(*_gr, _process[i]); it != INVALID; ++it) {
- Node target = _gr->target(it);
- Value relaxed = OperationTraits::plus(values[i], (*_length)[it]);
- if (OperationTraits::less(relaxed, (*_dist)[target])) {
- _pred->set(target, it);
- _dist->set(target, relaxed);
- if (!(*_mask)[target]) {
- _mask->set(target, true);
- nextProcess.push_back(target);
- }
- }
- }
+ for (OutArcIt it(*_gr, _process[i]); it != INVALID; ++it) {
+ Node target = _gr->target(it);
+ Value relaxed = OperationTraits::plus(values[i], (*_length)[it]);
+ if (OperationTraits::less(relaxed, (*_dist)[target])) {
+ _pred->set(target, it);
+ _dist->set(target, relaxed);
+ if (!(*_mask)[target]) {
+ _mask->set(target, true);
+ nextProcess.push_back(target);
+ }
+ }
+ }
}
_process.swap(nextProcess);
return _process.empty();
@@ -541,23 +541,23 @@
/// \see ActiveIt
bool processNextWeakRound() {
for (int i = 0; i < int(_process.size()); ++i) {
- _mask->set(_process[i], false);
+ _mask->set(_process[i], false);
}
std::vector nextProcess;
for (int i = 0; i < int(_process.size()); ++i) {
- for (OutArcIt it(*_gr, _process[i]); it != INVALID; ++it) {
- Node target = _gr->target(it);
- Value relaxed =
- OperationTraits::plus((*_dist)[_process[i]], (*_length)[it]);
- if (OperationTraits::less(relaxed, (*_dist)[target])) {
- _pred->set(target, it);
- _dist->set(target, relaxed);
- if (!(*_mask)[target]) {
- _mask->set(target, true);
- nextProcess.push_back(target);
- }
- }
- }
+ for (OutArcIt it(*_gr, _process[i]); it != INVALID; ++it) {
+ Node target = _gr->target(it);
+ Value relaxed =
+ OperationTraits::plus((*_dist)[_process[i]], (*_length)[it]);
+ if (OperationTraits::less(relaxed, (*_dist)[target])) {
+ _pred->set(target, it);
+ _dist->set(target, relaxed);
+ if (!(*_mask)[target]) {
+ _mask->set(target, true);
+ nextProcess.push_back(target);
+ }
+ }
+ }
}
_process.swap(nextProcess);
return _process.empty();
@@ -579,7 +579,7 @@
void start() {
int num = countNodes(*_gr) - 1;
for (int i = 0; i < num; ++i) {
- if (processNextWeakRound()) break;
+ if (processNextWeakRound()) break;
}
}
@@ -591,18 +591,18 @@
/// in order to compute the shortest path to each node and also checks
/// if the digraph contains cycles with negative total length.
///
- /// The algorithm computes
+ /// The algorithm computes
/// - the shortest path tree (forest),
/// - the distance of each node from the root(s).
- ///
+ ///
/// \return \c false if there is a negative cycle in the digraph.
///
/// \pre init() must be called and at least one root node should be
- /// added with addSource() before using this function.
+ /// added with addSource() before using this function.
bool checkedStart() {
int num = countNodes(*_gr);
for (int i = 0; i < num; ++i) {
- if (processNextWeakRound()) return true;
+ if (processNextWeakRound()) return true;
}
return _process.empty();
}
@@ -626,15 +626,15 @@
/// and build the path manually.
///
/// \pre init() must be called and at least one root node should be
- /// added with addSource() before using this function.
+ /// added with addSource() before using this function.
void limitedStart(int num) {
for (int i = 0; i < num; ++i) {
- if (processNextRound()) break;
+ if (processNextRound()) break;
}
}
-
+
/// \brief Runs the algorithm from the given root node.
- ///
+ ///
/// This method runs the Bellman-Ford algorithm from the given root
/// node \c s in order to compute the shortest path to each node.
///
@@ -653,10 +653,10 @@
addSource(s);
start();
}
-
+
/// \brief Runs the algorithm from the given root node with arc
/// number limit.
- ///
+ ///
/// This method runs the Bellman-Ford algorithm from the given root
/// node \c s in order to compute the shortest path distance for each
/// node using only the paths consisting of at most \c num arcs.
@@ -682,7 +682,7 @@
addSource(s);
limitedStart(num);
}
-
+
///@}
/// \brief LEMON iterator for getting the active nodes.
@@ -697,7 +697,7 @@
/// \brief Constructor.
///
/// Constructor for getting the active nodes of the given BellmanFord
- /// instance.
+ /// instance.
ActiveIt(const BellmanFord& algorithm) : _algorithm(&algorithm)
{
_index = _algorithm->_process.size() - 1;
@@ -711,7 +711,7 @@
/// \brief Conversion to \c Node.
///
/// Conversion to \c Node.
- operator Node() const {
+ operator Node() const {
return _index >= 0 ? _algorithm->_process[_index] : INVALID;
}
@@ -720,33 +720,33 @@
/// Increment operator.
ActiveIt& operator++() {
--_index;
- return *this;
+ return *this;
}
- bool operator==(const ActiveIt& it) const {
- return static_cast(*this) == static_cast(it);
+ bool operator==(const ActiveIt& it) const {
+ return static_cast(*this) == static_cast(it);
}
- bool operator!=(const ActiveIt& it) const {
- return static_cast(*this) != static_cast(it);
+ bool operator!=(const ActiveIt& it) const {
+ return static_cast(*this) != static_cast(it);
}
- bool operator<(const ActiveIt& it) const {
- return static_cast(*this) < static_cast(it);
+ bool operator<(const ActiveIt& it) const {
+ return static_cast(*this) < static_cast(it);
}
-
+
private:
const BellmanFord* _algorithm;
int _index;
};
-
+
/// \name Query Functions
/// The result of the Bellman-Ford algorithm can be obtained using these
/// functions.\n
/// Either \ref run() or \ref init() should be called before using them.
-
+
///@{
/// \brief The shortest path to the given node.
- ///
+ ///
/// Gives back the shortest path to the given node from the root(s).
///
/// \warning \c t should be reached from the root(s).
@@ -757,7 +757,7 @@
{
return Path(*_gr, *_pred, t);
}
-
+
/// \brief The distance of the given node from the root(s).
///
/// Returns the distance of the given node from the root(s).
@@ -797,10 +797,10 @@
///
/// \pre Either \ref run() or \ref init() must be called before
/// using this function.
- Node predNode(Node v) const {
- return (*_pred)[v] == INVALID ? INVALID : _gr->source((*_pred)[v]);
+ Node predNode(Node v) const {
+ return (*_pred)[v] == INVALID ? INVALID : _gr->source((*_pred)[v]);
}
-
+
/// \brief Returns a const reference to the node map that stores the
/// distances of the nodes.
///
@@ -810,7 +810,7 @@
/// \pre Either \ref run() or \ref init() must be called before
/// using this function.
const DistMap &distMap() const { return *_dist;}
-
+
/// \brief Returns a const reference to the node map that stores the
/// predecessor arcs.
///
@@ -820,7 +820,7 @@
/// \pre Either \ref run() or \ref init() must be called before
/// using this function.
const PredMap &predMap() const { return *_pred; }
-
+
/// \brief Checks if a node is reached from the root(s).
///
/// Returns \c true if \c v is reached from the root(s).
@@ -832,7 +832,7 @@
}
/// \brief Gives back a negative cycle.
- ///
+ ///
/// This function gives back a directed cycle with negative total
/// length if the algorithm has already found one.
/// Otherwise it gives back an empty path.
@@ -859,10 +859,10 @@
}
return cycle;
}
-
+
///@}
};
-
+
/// \brief Default traits class of bellmanFord() function.
///
/// Default traits class of bellmanFord() function.
@@ -870,7 +870,7 @@
/// \tparam LEN The type of the length map.
template
struct BellmanFordWizardDefaultTraits {
- /// The type of the digraph the algorithm runs on.
+ /// The type of the digraph the algorithm runs on.
typedef GR Digraph;
/// \brief The type of the map that stores the arc lengths.
@@ -892,13 +892,13 @@
/// \brief The type of the map that stores the last
/// arcs of the shortest paths.
- ///
+ ///
/// The type of the map that stores the last arcs of the shortest paths.
/// It must conform to the \ref concepts::WriteMap "WriteMap" concept.
typedef typename GR::template NodeMap PredMap;
/// \brief Instantiates a \c PredMap.
- ///
+ ///
/// This function instantiates a \ref PredMap.
/// \param g is the digraph to which we would like to define the
/// \ref PredMap.
@@ -914,7 +914,7 @@
/// \brief Instantiates a \c DistMap.
///
- /// This function instantiates a \ref DistMap.
+ /// This function instantiates a \ref DistMap.
/// \param g is the digraph to which we would like to define the
/// \ref DistMap.
static DistMap *createDistMap(const GR &g) {
@@ -927,14 +927,14 @@
///It must meet the \ref concepts::Path "Path" concept.
typedef lemon::Path Path;
};
-
+
/// \brief Default traits class used by BellmanFordWizard.
///
/// Default traits class used by BellmanFordWizard.
/// \tparam GR The type of the digraph.
/// \tparam LEN The type of the length map.
template
- class BellmanFordWizardBase
+ class BellmanFordWizardBase
: public BellmanFordWizardDefaultTraits {
typedef BellmanFordWizardDefaultTraits Base;
@@ -957,26 +957,26 @@
public:
/// Constructor.
-
+
/// This constructor does not require parameters, it initiates
/// all of the attributes to default values \c 0.
BellmanFordWizardBase() :
_graph(0), _length(0), _pred(0), _dist(0), _path(0), _di(0) {}
/// Constructor.
-
+
/// This constructor requires two parameters,
/// others are initiated to \c 0.
/// \param gr The digraph the algorithm runs on.
/// \param len The length map.
- BellmanFordWizardBase(const GR& gr,
- const LEN& len) :
- _graph(reinterpret_cast(const_cast(&gr))),
- _length(reinterpret_cast(const_cast(&len))),
+ BellmanFordWizardBase(const GR& gr,
+ const LEN& len) :
+ _graph(reinterpret_cast(const_cast(&gr))),
+ _length(reinterpret_cast(const_cast(&len))),
_pred(0), _dist(0), _path(0), _di(0) {}
};
-
+
/// \brief Auxiliary class for the function-type interface of the
/// \ref BellmanFord "Bellman-Ford" algorithm.
///
@@ -1001,7 +1001,7 @@
typedef typename Digraph::NodeIt NodeIt;
typedef typename Digraph::Arc Arc;
typedef typename Digraph::OutArcIt ArcIt;
-
+
typedef typename TR::LengthMap LengthMap;
typedef typename LengthMap::Value Value;
typedef typename TR::PredMap PredMap;
@@ -1018,7 +1018,7 @@
/// These parameters will be the default values for the traits class.
/// \param gr The digraph the algorithm runs on.
/// \param len The length map.
- BellmanFordWizard(const Digraph& gr, const LengthMap& len)
+ BellmanFordWizard(const Digraph& gr, const LengthMap& len)
: TR(gr, len) {}
/// \brief Copy constructor
@@ -1027,12 +1027,12 @@
~BellmanFordWizard() {}
/// \brief Runs the Bellman-Ford algorithm from the given source node.
- ///
+ ///
/// This method runs the Bellman-Ford algorithm from the given source
/// node in order to compute the shortest path to each node.
void run(Node s) {
- BellmanFord
- bf(*reinterpret_cast(Base::_graph),
+ BellmanFord
+ bf(*reinterpret_cast(Base::_graph),
*reinterpret_cast(Base::_length));
if (Base::_pred) bf.predMap(*reinterpret_cast(Base::_pred));
if (Base::_dist) bf.distMap(*reinterpret_cast(Base::_dist));
@@ -1067,7 +1067,7 @@
static PredMap *createPredMap(const Digraph &) { return 0; };
SetPredMapBase(const TR &b) : TR(b) {}
};
-
+
/// \brief \ref named-templ-param "Named parameter" for setting
/// the predecessor map.
///
@@ -1078,14 +1078,14 @@
Base::_pred=reinterpret_cast(const_cast(&t));
return BellmanFordWizard >(*this);
}
-
+
template
struct SetDistMapBase : public Base {
typedef T DistMap;
static DistMap *createDistMap(const Digraph &) { return 0; };
SetDistMapBase(const TR &b) : TR(b) {}
};
-
+
/// \brief \ref named-templ-param "Named parameter" for setting
/// the distance map.
///
@@ -1126,9 +1126,9 @@
Base::_di=reinterpret_cast(const_cast(&d));
return *this;
}
-
+
};
-
+
/// \brief Function type interface for the \ref BellmanFord "Bellman-Ford"
/// algorithm.
///
@@ -1136,8 +1136,8 @@
/// Function type interface for the \ref BellmanFord "Bellman-Ford"
/// algorithm.
///
- /// This function also has several \ref named-templ-func-param
- /// "named parameters", they are declared as the members of class
+ /// This function also has several \ref named-templ-func-param
+ /// "named parameters", they are declared as the members of class
/// \ref BellmanFordWizard.
/// The following examples show how to use these parameters.
/// \code
@@ -1154,7 +1154,7 @@
template
BellmanFordWizard >
bellmanFord(const GR& digraph,
- const LEN& length)
+ const LEN& length)
{
return BellmanFordWizard >(digraph, length);
}
diff --git a/lemon/bfs.h b/lemon/bfs.h
--- a/lemon/bfs.h
+++ b/lemon/bfs.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -82,7 +82,8 @@
///The type of the map that indicates which nodes are reached.
///The type of the map that indicates which nodes are reached.
- ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ ///It must conform to
+ ///the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
typedef typename Digraph::template NodeMap ReachedMap;
///Instantiates a \c ReachedMap.
@@ -271,7 +272,8 @@
///
///\ref named-templ-param "Named parameter" for setting
///\c ReachedMap type.
- ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ ///It must conform to
+ ///the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
template
struct SetReachedMap : public Bfs< Digraph, SetReachedMapTraits > {
typedef Bfs< Digraph, SetReachedMapTraits > Create;
@@ -872,7 +874,8 @@
///The type of the map that indicates which nodes are reached.
///The type of the map that indicates which nodes are reached.
- ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ ///It must conform to
+ ///the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
typedef typename Digraph::template NodeMap ReachedMap;
///Instantiates a ReachedMap.
@@ -1265,7 +1268,8 @@
/// \brief The type of the map that indicates which nodes are reached.
///
/// The type of the map that indicates which nodes are reached.
- /// It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ /// It must conform to
+ ///the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
typedef typename Digraph::template NodeMap ReachedMap;
/// \brief Instantiates a ReachedMap.
diff --git a/lemon/binomial_heap.h b/lemon/binomial_heap.h
--- a/lemon/binomial_heap.h
+++ b/lemon/binomial_heap.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -258,7 +258,7 @@
int i=_iim[item];
int p=_data[i].parent;
_data[i].prio=value;
-
+
while( p!=-1 && _comp(value, _data[p].prio) ) {
_data[i].name=_data[p].name;
_data[i].prio=_data[p].prio;
@@ -322,7 +322,7 @@
}
private:
-
+
// Find the minimum of the roots
int findMin() {
if( _head!=-1 ) {
@@ -350,7 +350,7 @@
interleave(a);
}
if( _data[_head].right_neighbor==-1 ) return;
-
+
int x=_head;
int x_prev=-1, x_next=_data[x].right_neighbor;
while( x_next!=-1 ) {
@@ -384,7 +384,7 @@
int p=_head, q=a;
int curr=_data.size();
_data.push_back(Store());
-
+
while( p!=-1 || q!=-1 ) {
if( q==-1 || ( p!=-1 && _data[p].degree<_data[q].degree ) ) {
_data[curr].right_neighbor=p;
@@ -397,7 +397,7 @@
q=_data[q].right_neighbor;
}
}
-
+
_head=_data.back().right_neighbor;
_data.pop_back();
}
diff --git a/lemon/bits/array_map.h b/lemon/bits/array_map.h
--- a/lemon/bits/array_map.h
+++ b/lemon/bits/array_map.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -70,7 +70,7 @@
typedef typename ItemSetTraits<_Graph, _Item>::ItemNotifier Notifier;
private:
-
+
// The MapBase of the Map which imlements the core regisitry function.
typedef typename Notifier::ObserverBase Parent;
diff --git a/lemon/bits/default_map.h b/lemon/bits/default_map.h
--- a/lemon/bits/default_map.h
+++ b/lemon/bits/default_map.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -157,7 +157,7 @@
public:
typedef DefaultMap<_Graph, _Item, _Value> Map;
-
+
typedef typename Parent::GraphType GraphType;
typedef typename Parent::Value Value;
diff --git a/lemon/bits/edge_set_extender.h b/lemon/bits/edge_set_extender.h
--- a/lemon/bits/edge_set_extender.h
+++ b/lemon/bits/edge_set_extender.h
@@ -1,8 +1,8 @@
-/* -*- C++ -*-
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
*
- * This file is a part of LEMON, a generic C++ optimization library
+ * This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -63,11 +63,11 @@
Node oppositeNode(const Node &n, const Arc &e) const {
if (n == Parent::source(e))
- return Parent::target(e);
+ return Parent::target(e);
else if(n==Parent::target(e))
- return Parent::source(e);
+ return Parent::source(e);
else
- return INVALID;
+ return INVALID;
}
@@ -91,7 +91,7 @@
// Iterable extensions
- class NodeIt : public Node {
+ class NodeIt : public Node {
const Digraph* digraph;
public:
@@ -100,21 +100,21 @@
NodeIt(Invalid i) : Node(i) { }
explicit NodeIt(const Digraph& _graph) : digraph(&_graph) {
- _graph.first(static_cast(*this));
+ _graph.first(static_cast(*this));
}
- NodeIt(const Digraph& _graph, const Node& node)
- : Node(node), digraph(&_graph) {}
+ NodeIt(const Digraph& _graph, const Node& node)
+ : Node(node), digraph(&_graph) {}
- NodeIt& operator++() {
- digraph->next(*this);
- return *this;
+ NodeIt& operator++() {
+ digraph->next(*this);
+ return *this;
}
};
- class ArcIt : public Arc {
+ class ArcIt : public Arc {
const Digraph* digraph;
public:
@@ -123,21 +123,21 @@
ArcIt(Invalid i) : Arc(i) { }
explicit ArcIt(const Digraph& _graph) : digraph(&_graph) {
- _graph.first(static_cast(*this));
+ _graph.first(static_cast(*this));
}
- ArcIt(const Digraph& _graph, const Arc& e) :
- Arc(e), digraph(&_graph) { }
+ ArcIt(const Digraph& _graph, const Arc& e) :
+ Arc(e), digraph(&_graph) { }
- ArcIt& operator++() {
- digraph->next(*this);
- return *this;
+ ArcIt& operator++() {
+ digraph->next(*this);
+ return *this;
}
};
- class OutArcIt : public Arc {
+ class OutArcIt : public Arc {
const Digraph* digraph;
public:
@@ -145,23 +145,23 @@
OutArcIt(Invalid i) : Arc(i) { }
- OutArcIt(const Digraph& _graph, const Node& node)
- : digraph(&_graph) {
- _graph.firstOut(*this, node);
+ OutArcIt(const Digraph& _graph, const Node& node)
+ : digraph(&_graph) {
+ _graph.firstOut(*this, node);
}
- OutArcIt(const Digraph& _graph, const Arc& arc)
- : Arc(arc), digraph(&_graph) {}
+ OutArcIt(const Digraph& _graph, const Arc& arc)
+ : Arc(arc), digraph(&_graph) {}
- OutArcIt& operator++() {
- digraph->nextOut(*this);
- return *this;
+ OutArcIt& operator++() {
+ digraph->nextOut(*this);
+ return *this;
}
};
- class InArcIt : public Arc {
+ class InArcIt : public Arc {
const Digraph* digraph;
public:
@@ -169,17 +169,17 @@
InArcIt(Invalid i) : Arc(i) { }
- InArcIt(const Digraph& _graph, const Node& node)
- : digraph(&_graph) {
- _graph.firstIn(*this, node);
+ InArcIt(const Digraph& _graph, const Node& node)
+ : digraph(&_graph) {
+ _graph.firstIn(*this, node);
}
- InArcIt(const Digraph& _graph, const Arc& arc) :
- Arc(arc), digraph(&_graph) {}
+ InArcIt(const Digraph& _graph, const Arc& arc) :
+ Arc(arc), digraph(&_graph) {}
- InArcIt& operator++() {
- digraph->nextIn(*this);
- return *this;
+ InArcIt& operator++() {
+ digraph->nextIn(*this);
+ return *this;
}
};
@@ -215,26 +215,26 @@
using Parent::first;
// Mappable extension
-
+
template
- class ArcMap
+ class ArcMap
: public MapExtender > {
typedef MapExtender > Parent;
public:
- explicit ArcMap(const Digraph& _g)
- : Parent(_g) {}
- ArcMap(const Digraph& _g, const _Value& _v)
- : Parent(_g, _v) {}
+ explicit ArcMap(const Digraph& _g)
+ : Parent(_g) {}
+ ArcMap(const Digraph& _g, const _Value& _v)
+ : Parent(_g, _v) {}
ArcMap& operator=(const ArcMap& cmap) {
- return operator=(cmap);
+ return operator=(cmap);
}
template
ArcMap& operator=(const CMap& cmap) {
Parent::operator=(cmap);
- return *this;
+ return *this;
}
};
@@ -247,7 +247,7 @@
notifier(Arc()).add(arc);
return arc;
}
-
+
void clear() {
notifier(Arc()).clear();
Parent::clear();
@@ -310,11 +310,11 @@
Node oppositeNode(const Node &n, const Edge &e) const {
if( n == Parent::u(e))
- return Parent::v(e);
+ return Parent::v(e);
else if( n == Parent::v(e))
- return Parent::u(e);
+ return Parent::u(e);
else
- return INVALID;
+ return INVALID;
}
Arc oppositeArc(const Arc &e) const {
@@ -338,7 +338,7 @@
public:
using Parent::notifier;
-
+
ArcNotifier& notifier(Arc) const {
return arc_notifier;
}
@@ -348,7 +348,7 @@
}
- class NodeIt : public Node {
+ class NodeIt : public Node {
const Graph* graph;
public:
@@ -357,21 +357,21 @@
NodeIt(Invalid i) : Node(i) { }
explicit NodeIt(const Graph& _graph) : graph(&_graph) {
- _graph.first(static_cast(*this));
+ _graph.first(static_cast(*this));
}
- NodeIt(const Graph& _graph, const Node& node)
- : Node(node), graph(&_graph) {}
+ NodeIt(const Graph& _graph, const Node& node)
+ : Node(node), graph(&_graph) {}
- NodeIt& operator++() {
- graph->next(*this);
- return *this;
+ NodeIt& operator++() {
+ graph->next(*this);
+ return *this;
}
};
- class ArcIt : public Arc {
+ class ArcIt : public Arc {
const Graph* graph;
public:
@@ -380,21 +380,21 @@
ArcIt(Invalid i) : Arc(i) { }
explicit ArcIt(const Graph& _graph) : graph(&_graph) {
- _graph.first(static_cast(*this));
+ _graph.first(static_cast(*this));
}
- ArcIt(const Graph& _graph, const Arc& e) :
- Arc(e), graph(&_graph) { }
+ ArcIt(const Graph& _graph, const Arc& e) :
+ Arc(e), graph(&_graph) { }
- ArcIt& operator++() {
- graph->next(*this);
- return *this;
+ ArcIt& operator++() {
+ graph->next(*this);
+ return *this;
}
};
- class OutArcIt : public Arc {
+ class OutArcIt : public Arc {
const Graph* graph;
public:
@@ -402,23 +402,23 @@
OutArcIt(Invalid i) : Arc(i) { }
- OutArcIt(const Graph& _graph, const Node& node)
- : graph(&_graph) {
- _graph.firstOut(*this, node);
+ OutArcIt(const Graph& _graph, const Node& node)
+ : graph(&_graph) {
+ _graph.firstOut(*this, node);
}
- OutArcIt(const Graph& _graph, const Arc& arc)
- : Arc(arc), graph(&_graph) {}
+ OutArcIt(const Graph& _graph, const Arc& arc)
+ : Arc(arc), graph(&_graph) {}
- OutArcIt& operator++() {
- graph->nextOut(*this);
- return *this;
+ OutArcIt& operator++() {
+ graph->nextOut(*this);
+ return *this;
}
};
- class InArcIt : public Arc {
+ class InArcIt : public Arc {
const Graph* graph;
public:
@@ -426,23 +426,23 @@
InArcIt(Invalid i) : Arc(i) { }
- InArcIt(const Graph& _graph, const Node& node)
- : graph(&_graph) {
- _graph.firstIn(*this, node);
+ InArcIt(const Graph& _graph, const Node& node)
+ : graph(&_graph) {
+ _graph.firstIn(*this, node);
}
- InArcIt(const Graph& _graph, const Arc& arc) :
- Arc(arc), graph(&_graph) {}
+ InArcIt(const Graph& _graph, const Arc& arc) :
+ Arc(arc), graph(&_graph) {}
- InArcIt& operator++() {
- graph->nextIn(*this);
- return *this;
+ InArcIt& operator++() {
+ graph->nextIn(*this);
+ return *this;
}
};
- class EdgeIt : public Parent::Edge {
+ class EdgeIt : public Parent::Edge {
const Graph* graph;
public:
@@ -451,15 +451,15 @@
EdgeIt(Invalid i) : Edge(i) { }
explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
- _graph.first(static_cast(*this));
+ _graph.first(static_cast(*this));
}
- EdgeIt(const Graph& _graph, const Edge& e) :
- Edge(e), graph(&_graph) { }
+ EdgeIt(const Graph& _graph, const Edge& e) :
+ Edge(e), graph(&_graph) { }
- EdgeIt& operator++() {
- graph->next(*this);
- return *this;
+ EdgeIt& operator++() {
+ graph->next(*this);
+ return *this;
}
};
@@ -475,17 +475,17 @@
IncEdgeIt(Invalid i) : Edge(i), direction(false) { }
IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
- _graph.firstInc(*this, direction, n);
+ _graph.firstInc(*this, direction, n);
}
IncEdgeIt(const Graph& _graph, const Edge &ue, const Node &n)
- : graph(&_graph), Edge(ue) {
- direction = (_graph.source(ue) == n);
+ : graph(&_graph), Edge(ue) {
+ direction = (_graph.source(ue) == n);
}
IncEdgeIt& operator++() {
- graph->nextInc(*this, direction);
- return *this;
+ graph->nextInc(*this, direction);
+ return *this;
}
};
@@ -532,49 +532,49 @@
template
- class ArcMap
+ class ArcMap
: public MapExtender > {
typedef MapExtender > Parent;
public:
- explicit ArcMap(const Graph& _g)
- : Parent(_g) {}
- ArcMap(const Graph& _g, const _Value& _v)
- : Parent(_g, _v) {}
+ explicit ArcMap(const Graph& _g)
+ : Parent(_g) {}
+ ArcMap(const Graph& _g, const _Value& _v)
+ : Parent(_g, _v) {}
ArcMap& operator=(const ArcMap& cmap) {
- return operator=(cmap);
+ return operator=(cmap);
}
template
ArcMap& operator=(const CMap& cmap) {
Parent::operator=(cmap);
- return *this;
+ return *this;
}
};
template
- class EdgeMap
+ class EdgeMap
: public MapExtender > {
typedef MapExtender > Parent;
public:
- explicit EdgeMap(const Graph& _g)
- : Parent(_g) {}
+ explicit EdgeMap(const Graph& _g)
+ : Parent(_g) {}
- EdgeMap(const Graph& _g, const _Value& _v)
- : Parent(_g, _v) {}
+ EdgeMap(const Graph& _g, const _Value& _v)
+ : Parent(_g, _v) {}
EdgeMap& operator=(const EdgeMap& cmap) {
- return operator=(cmap);
+ return operator=(cmap);
}
template
EdgeMap& operator=(const CMap& cmap) {
Parent::operator=(cmap);
- return *this;
+ return *this;
}
};
@@ -591,7 +591,7 @@
notifier(Arc()).add(arcs);
return edge;
}
-
+
void clear() {
notifier(Arc()).clear();
notifier(Edge()).clear();
@@ -617,7 +617,7 @@
edge_notifier.clear();
arc_notifier.clear();
}
-
+
};
}
diff --git a/lemon/bits/solver_bits.h b/lemon/bits/solver_bits.h
--- a/lemon/bits/solver_bits.h
+++ b/lemon/bits/solver_bits.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
diff --git a/lemon/bits/windows.cc b/lemon/bits/windows.cc
--- a/lemon/bits/windows.cc
+++ b/lemon/bits/windows.cc
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -96,7 +96,7 @@
SYSTEMTIME time;
GetSystemTime(&time);
char buf1[11], buf2[9], buf3[5];
- if (GetDateFormat(MY_LOCALE, 0, &time,
+ if (GetDateFormat(MY_LOCALE, 0, &time,
("ddd MMM dd"), buf1, 11) &&
GetTimeFormat(MY_LOCALE, 0, &time,
("HH':'mm':'ss"), buf2, 9) &&
diff --git a/lemon/bucket_heap.h b/lemon/bucket_heap.h
--- a/lemon/bucket_heap.h
+++ b/lemon/bucket_heap.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -384,7 +384,7 @@
/// key increasing and decreasing.
///
/// Note that this implementation does not conform to the
- /// \ref concepts::Heap "heap concept" due to the lack of some
+ /// \ref concepts::Heap "heap concept" due to the lack of some
/// functionality.
///
/// \tparam IM A read-writable item map with \c int values, used
diff --git a/lemon/capacity_scaling.h b/lemon/capacity_scaling.h
--- a/lemon/capacity_scaling.h
+++ b/lemon/capacity_scaling.h
@@ -1,8 +1,8 @@
-/* -*- C++ -*-
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
*
- * This file is a part of LEMON, a generic C++ optimization library
+ * This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -133,7 +133,7 @@
/// these cases.
UNBOUNDED
};
-
+
private:
TEMPLATE_DIGRAPH_TYPEDEFS(GR);
@@ -184,7 +184,7 @@
IntVector _pred;
public:
-
+
/// \brief Constant for infinite upper bounds (capacities).
///
/// Constant for infinite upper bounds (capacities).
@@ -211,10 +211,10 @@
const ValueVector &_excess;
CostVector &_pi;
IntVector &_pred;
-
+
IntVector _proc_nodes;
CostVector _dist;
-
+
public:
ResidualDijkstra(CapacityScaling& cs) :
@@ -439,7 +439,7 @@
_supply[_node_id[t]] = -k;
return *this;
}
-
+
/// @}
/// \name Execution control
@@ -575,7 +575,7 @@
_upper.resize(_res_arc_num);
_cost.resize(_res_arc_num);
_supply.resize(_node_num);
-
+
_res_cap.resize(_res_arc_num);
_pi.resize(_node_num);
_excess.resize(_node_num);
@@ -619,7 +619,7 @@
_reverse[fi] = bi;
_reverse[bi] = fi;
}
-
+
// Reset parameters
resetParams();
return *this;
@@ -728,7 +728,7 @@
_sum_supply += _supply[i];
}
if (_sum_supply > 0) return INFEASIBLE;
-
+
// Initialize vectors
for (int i = 0; i != _root; ++i) {
_pi[i] = 0;
@@ -776,7 +776,7 @@
}
}
}
-
+
// Handle GEQ supply type
if (_sum_supply < 0) {
_pi[_root] = 0;
@@ -844,9 +844,9 @@
if (_sum_supply < 0 || pr > 0) {
for (int i = 0; i != _node_num; ++i) {
_pi[i] -= pr;
- }
+ }
}
-
+
return pt;
}
diff --git a/lemon/cbc.h b/lemon/cbc.h
--- a/lemon/cbc.h
+++ b/lemon/cbc.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -121,7 +121,7 @@
int _message_level;
-
+
};
diff --git a/lemon/circulation.h b/lemon/circulation.h
--- a/lemon/circulation.h
+++ b/lemon/circulation.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -59,8 +59,8 @@
/// \brief The type of supply map.
///
- /// The type of the map that stores the signed supply values of the
- /// nodes.
+ /// The type of the map that stores the signed supply values of the
+ /// nodes.
/// It must conform to the \ref concepts::ReadMap "ReadMap" concept.
typedef SM SupplyMap;
@@ -141,7 +141,7 @@
\f[ \sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu)
\geq sup(u) \quad \forall u\in V, \f]
\f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A. \f]
-
+
The sum of the supply values, i.e. \f$\sum_{u\in V} sup(u)\f$ must be
zero or negative in order to have a feasible solution (since the sum
of the expressions on the left-hand side of the inequalities is zero).
@@ -151,7 +151,7 @@
If \f$\sum_{u\in V} sup(u)\f$ is zero, then all the supply/demand
constraints have to be satisfied with equality, i.e. all demands
have to be satisfied and all supplies have to be used.
-
+
If you need the opposite inequalities in the supply/demand constraints
(i.e. the total demand is less than the total supply and all the demands
have to be satisfied while there could be supplies that are not used),
@@ -337,7 +337,7 @@
///
/// \param graph The digraph the algorithm runs on.
/// \param lower The lower bounds for the flow values on the arcs.
- /// \param upper The upper bounds (capacities) for the flow values
+ /// \param upper The upper bounds (capacities) for the flow values
/// on the arcs.
/// \param supply The signed supply values of the nodes.
Circulation(const Digraph &graph, const LowerMap &lower,
diff --git a/lemon/clp.cc b/lemon/clp.cc
--- a/lemon/clp.cc
+++ b/lemon/clp.cc
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
diff --git a/lemon/clp.h b/lemon/clp.h
--- a/lemon/clp.h
+++ b/lemon/clp.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -138,7 +138,7 @@
virtual void _clear();
virtual void _messageLevel(MessageLevel);
-
+
public:
///Solves LP with primal simplex method.
diff --git a/lemon/concepts/digraph.h b/lemon/concepts/digraph.h
--- a/lemon/concepts/digraph.h
+++ b/lemon/concepts/digraph.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -434,7 +434,7 @@
private:
///Copy constructor
- NodeMap(const NodeMap& nm) :
+ NodeMap(const NodeMap& nm) :
ReferenceMap(nm) { }
///Assignment operator
template
diff --git a/lemon/concepts/graph.h b/lemon/concepts/graph.h
--- a/lemon/concepts/graph.h
+++ b/lemon/concepts/graph.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -43,7 +43,7 @@
/// undirected graphs should compile with this class, but it will not
/// run properly, of course.
/// An actual graph implementation like \ref ListGraph or
- /// \ref SmartGraph may have additional functionality.
+ /// \ref SmartGraph may have additional functionality.
///
/// The undirected graphs also fulfill the concept of \ref Digraph
/// "directed graphs", since each edge can also be regarded as two
@@ -85,7 +85,7 @@
/// \brief Undirected graphs should be tagged with \c UndirectedTag.
///
/// Undirected graphs should be tagged with \c UndirectedTag.
- ///
+ ///
/// This tag helps the \c enable_if technics to make compile time
/// specializations for undirected graphs.
typedef True UndirectedTag;
@@ -360,7 +360,7 @@
bool operator<(Arc) const { return false; }
/// Converison to \c Edge
-
+
/// Converison to \c Edge.
///
operator Edge() const { return Edge(); }
diff --git a/lemon/concepts/graph_components.h b/lemon/concepts/graph_components.h
--- a/lemon/concepts/graph_components.h
+++ b/lemon/concepts/graph_components.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -38,7 +38,7 @@
///
/// \note This class is a template class so that we can use it to
/// create graph skeleton classes. The reason for this is that \c Node
- /// and \c Arc (or \c Edge) types should \e not derive from the same
+ /// and \c Arc (or \c Edge) types should \e not derive from the same
/// base class. For \c Node you should instantiate it with character
/// \c 'n', for \c Arc with \c 'a' and for \c Edge with \c 'e'.
#ifndef DOXYGEN
@@ -89,7 +89,7 @@
/// \brief Ordering operator.
///
/// This operator defines an ordering of the items.
- /// It makes possible to use graph item types as key types in
+ /// It makes possible to use graph item types as key types in
/// associative containers (e.g. \c std::map).
///
/// \note This operator only has to define some strict ordering of
@@ -122,7 +122,7 @@
///
/// This class describes the base interface of directed graph types.
/// All digraph %concepts have to conform to this class.
- /// It just provides types for nodes and arcs and functions
+ /// It just provides types for nodes and arcs and functions
/// to get the source and the target nodes of arcs.
class BaseDigraphComponent {
public:
@@ -426,7 +426,7 @@
/// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types.
///
- /// This class describes the concept of \c NodeIt, \c ArcIt and
+ /// This class describes the concept of \c NodeIt, \c ArcIt and
/// \c EdgeIt subtypes of digraph and graph types.
template
class GraphItemIt : public Item {
@@ -466,7 +466,7 @@
/// This operator increments the iterator, i.e. assigns it to the
/// next item.
GraphItemIt& operator++() { return *this; }
-
+
/// \brief Equality operator
///
/// Equality operator.
@@ -501,15 +501,15 @@
};
};
- /// \brief Concept class for \c InArcIt, \c OutArcIt and
+ /// \brief Concept class for \c InArcIt, \c OutArcIt and
/// \c IncEdgeIt types.
///
- /// This class describes the concept of \c InArcIt, \c OutArcIt
+ /// This class describes the concept of \c InArcIt, \c OutArcIt
/// and \c IncEdgeIt subtypes of digraph and graph types.
///
/// \note Since these iterator classes do not inherit from the same
/// base class, there is an additional template parameter (selector)
- /// \c sel. For \c InArcIt you should instantiate it with character
+ /// \c sel. For \c InArcIt you should instantiate it with character
/// \c 'i', for \c OutArcIt with \c 'o' and for \c IncEdgeIt with \c 'e'.
template
@@ -1045,7 +1045,7 @@
, _Map>();
_Map m1(g);
_Map m2(g,t);
-
+
// Copy constructor
// _Map m3(m);
@@ -1068,7 +1068,7 @@
/// \brief Skeleton class for mappable directed graphs.
///
/// This class describes the interface of mappable directed graphs.
- /// It extends \ref BaseDigraphComponent with the standard digraph
+ /// It extends \ref BaseDigraphComponent with the standard digraph
/// map classes, namely \c NodeMap and \c ArcMap.
/// This concept is part of the Digraph concept.
template
@@ -1205,7 +1205,7 @@
/// \brief Skeleton class for mappable undirected graphs.
///
/// This class describes the interface of mappable undirected graphs.
- /// It extends \ref MappableDigraphComponent with the standard graph
+ /// It extends \ref MappableDigraphComponent with the standard graph
/// map class for edges (\c EdgeMap).
/// This concept is part of the Graph concept.
template
@@ -1290,7 +1290,7 @@
/// \brief Skeleton class for extendable directed graphs.
///
/// This class describes the interface of extendable directed graphs.
- /// It extends \ref BaseDigraphComponent with functions for adding
+ /// It extends \ref BaseDigraphComponent with functions for adding
/// nodes and arcs to the digraph.
/// This concept requires \ref AlterableDigraphComponent.
template
@@ -1334,7 +1334,7 @@
/// \brief Skeleton class for extendable undirected graphs.
///
/// This class describes the interface of extendable undirected graphs.
- /// It extends \ref BaseGraphComponent with functions for adding
+ /// It extends \ref BaseGraphComponent with functions for adding
/// nodes and edges to the graph.
/// This concept requires \ref AlterableGraphComponent.
template
@@ -1378,7 +1378,7 @@
/// \brief Skeleton class for erasable directed graphs.
///
/// This class describes the interface of erasable directed graphs.
- /// It extends \ref BaseDigraphComponent with functions for removing
+ /// It extends \ref BaseDigraphComponent with functions for removing
/// nodes and arcs from the digraph.
/// This concept requires \ref AlterableDigraphComponent.
template
@@ -1391,7 +1391,7 @@
/// \brief Erase a node from the digraph.
///
- /// This function erases the given node from the digraph and all arcs
+ /// This function erases the given node from the digraph and all arcs
/// connected to the node.
void erase(const Node&) {}
@@ -1417,7 +1417,7 @@
/// \brief Skeleton class for erasable undirected graphs.
///
/// This class describes the interface of erasable undirected graphs.
- /// It extends \ref BaseGraphComponent with functions for removing
+ /// It extends \ref BaseGraphComponent with functions for removing
/// nodes and edges from the graph.
/// This concept requires \ref AlterableGraphComponent.
template
diff --git a/lemon/concepts/heap.h b/lemon/concepts/heap.h
--- a/lemon/concepts/heap.h
+++ b/lemon/concepts/heap.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -92,7 +92,7 @@
explicit Heap(ItemIntMap &map) {}
#else
explicit Heap(ItemIntMap&) {}
-#endif
+#endif
/// \brief Constructor.
///
@@ -106,7 +106,7 @@
explicit Heap(ItemIntMap &map, const CMP &comp) {}
#else
explicit Heap(ItemIntMap&, const CMP&) {}
-#endif
+#endif
/// \brief The number of items stored in the heap.
///
@@ -138,7 +138,7 @@
void push(const Item &i, const Prio &p) {}
#else
void push(const Item&, const Prio&) {}
-#endif
+#endif
/// \brief Return the item having minimum priority.
///
@@ -168,7 +168,7 @@
void erase(const Item &i) {}
#else
void erase(const Item&) {}
-#endif
+#endif
/// \brief The priority of the given item.
///
@@ -179,7 +179,7 @@
Prio operator[](const Item &i) const {}
#else
Prio operator[](const Item&) const { return Prio(); }
-#endif
+#endif
/// \brief Set the priority of an item or insert it, if it is
/// not stored in the heap.
@@ -194,7 +194,7 @@
void set(const Item &i, const Prio &p) {}
#else
void set(const Item&, const Prio&) {}
-#endif
+#endif
/// \brief Decrease the priority of an item to the given value.
///
@@ -206,7 +206,7 @@
void decrease(const Item &i, const Prio &p) {}
#else
void decrease(const Item&, const Prio&) {}
-#endif
+#endif
/// \brief Increase the priority of an item to the given value.
///
@@ -218,7 +218,7 @@
void increase(const Item &i, const Prio &p) {}
#else
void increase(const Item&, const Prio&) {}
-#endif
+#endif
/// \brief Return the state of an item.
///
@@ -232,7 +232,7 @@
State state(const Item &i) const {}
#else
State state(const Item&) const { return PRE_HEAP; }
-#endif
+#endif
/// \brief Set the state of an item in the heap.
///
@@ -245,7 +245,7 @@
void state(const Item& i, State st) {}
#else
void state(const Item&, State) {}
-#endif
+#endif
template
diff --git a/lemon/connectivity.h b/lemon/connectivity.h
--- a/lemon/connectivity.h
+++ b/lemon/connectivity.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -258,7 +258,7 @@
///
/// \return \c true if the digraph is strongly connected.
/// \note By definition, the empty digraph is strongly connected.
- ///
+ ///
/// \see countStronglyConnectedComponents(), stronglyConnectedComponents()
/// \see connected()
template
@@ -310,7 +310,7 @@
/// \ingroup graph_properties
///
- /// \brief Count the number of strongly connected components of a
+ /// \brief Count the number of strongly connected components of a
/// directed graph
///
/// This function counts the number of strongly connected components of
@@ -744,7 +744,7 @@
///
/// \brief Check whether an undirected graph is bi-node-connected.
///
- /// This function checks whether the given undirected graph is
+ /// This function checks whether the given undirected graph is
/// bi-node-connected, i.e. any two edges are on same circle.
///
/// \return \c true if the graph bi-node-connected.
@@ -758,7 +758,7 @@
/// \ingroup graph_properties
///
- /// \brief Count the number of bi-node-connected components of an
+ /// \brief Count the number of bi-node-connected components of an
/// undirected graph.
///
/// This function counts the number of bi-node-connected components of
@@ -812,7 +812,7 @@
/// \param graph The undirected graph.
/// \retval compMap A writable edge map. The values will be set from 0
/// to the number of the bi-node-connected components minus one. Each
- /// value of the map will be set exactly once, and the values of a
+ /// value of the map will be set exactly once, and the values of a
/// certain component will be set continuously.
/// \return The number of bi-node-connected components.
///
@@ -858,7 +858,7 @@
/// the components.
///
/// \param graph The undirected graph.
- /// \retval cutMap A writable node map. The values will be set to
+ /// \retval cutMap A writable node map. The values will be set to
/// \c true for the nodes that separate two or more components
/// (exactly once for each cut node), and will not be changed for
/// other nodes.
@@ -1085,7 +1085,7 @@
///
/// \brief Check whether an undirected graph is bi-edge-connected.
///
- /// This function checks whether the given undirected graph is
+ /// This function checks whether the given undirected graph is
/// bi-edge-connected, i.e. any two nodes are connected with at least
/// two edge-disjoint paths.
///
@@ -1192,7 +1192,7 @@
/// \brief Find the bi-edge-connected cut edges in an undirected graph.
///
/// This function finds the bi-edge-connected cut edges in the given
- /// undirected graph.
+ /// undirected graph.
///
/// The bi-edge-connected components are the classes of an equivalence
/// relation on the nodes of an undirected graph. Two nodes are in the
@@ -1349,7 +1349,7 @@
///
/// \param digraph The digraph.
/// \retval order A readable and writable node map. The values will be
- /// set from 0 to the number of the nodes in the digraph minus one.
+ /// set from 0 to the number of the nodes in the digraph minus one.
/// Each value of the map will be set exactly once, and the values will
/// be set descending order.
/// \return \c false if the digraph is not DAG.
diff --git a/lemon/core.h b/lemon/core.h
--- a/lemon/core.h
+++ b/lemon/core.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -1239,7 +1239,8 @@
protected:
- class AutoNodeMap : public ItemSetTraits::template Map::Type {
+ class AutoNodeMap : public ItemSetTraits::template Map::Type
+ {
typedef typename ItemSetTraits::template Map::Type Parent;
public:
@@ -1278,7 +1279,7 @@
}
};
- protected:
+ protected:
const Digraph &_g;
AutoNodeMap _head;
diff --git a/lemon/cost_scaling.h b/lemon/cost_scaling.h
--- a/lemon/cost_scaling.h
+++ b/lemon/cost_scaling.h
@@ -1,8 +1,8 @@
-/* -*- C++ -*-
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
*
- * This file is a part of LEMON, a generic C++ optimization library
+ * This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -92,7 +92,7 @@
/// \ref CostScaling implements a cost scaling algorithm that performs
/// push/augment and relabel operations for finding a \ref min_cost_flow
/// "minimum cost flow" \ref amo93networkflows, \ref goldberg90approximation,
- /// \ref goldberg97efficient, \ref bunnagel98efficient.
+ /// \ref goldberg97efficient, \ref bunnagel98efficient.
/// It is a highly efficient primal-dual solution method, which
/// can be viewed as the generalization of the \ref Preflow
/// "preflow push-relabel" algorithm for the maximum flow problem.
@@ -189,7 +189,7 @@
/// Augment operations are used, i.e. flow is moved on admissible
/// paths from a node with excess to a node with deficit.
AUGMENT,
- /// Partial augment operations are used, i.e. flow is moved on
+ /// Partial augment operations are used, i.e. flow is moved on
/// admissible paths started from a node with excess, but the
/// lengths of these paths are limited. This method can be viewed
/// as a combined version of the previous two operations.
@@ -208,15 +208,15 @@
// Note: vector is used instead of vector for efficiency reasons
private:
-
+
template
class StaticVectorMap {
public:
typedef KT Key;
typedef VT Value;
-
+
StaticVectorMap(std::vector& v) : _v(v) {}
-
+
const Value& operator[](const Key& key) const {
return _v[StaticDigraph::id(key)];
}
@@ -224,7 +224,7 @@
Value& operator[](const Key& key) {
return _v[StaticDigraph::id(key)];
}
-
+
void set(const Key& key, const Value& val) {
_v[StaticDigraph::id(key)] = val;
}
@@ -283,7 +283,7 @@
IntVector _bucket_prev;
IntVector _rank;
int _max_rank;
-
+
// Data for a StaticDigraph structure
typedef std::pair IntPair;
StaticDigraph _sgr;
@@ -291,9 +291,9 @@
std::vector _cost_vec;
LargeCostArcMap _cost_map;
LargeCostNodeMap _pi_map;
-
+
public:
-
+
/// \brief Constant for infinite upper bounds (capacities).
///
/// Constant for infinite upper bounds (capacities).
@@ -348,7 +348,7 @@
"The flow type of CostScaling must be signed");
LEMON_ASSERT(std::numeric_limits::is_signed,
"The cost type of CostScaling must be signed");
-
+
// Reset data structures
reset();
}
@@ -464,7 +464,7 @@
_supply[_node_id[t]] = -k;
return *this;
}
-
+
/// @}
/// \name Execution control
@@ -566,7 +566,7 @@
_upper[j] = INF;
_scost[j] = 0;
_scost[_reverse[j]] = 0;
- }
+ }
_have_lower = false;
return *this;
}
@@ -601,7 +601,7 @@
_upper.resize(_res_arc_num);
_scost.resize(_res_arc_num);
_supply.resize(_res_node_num);
-
+
_res_cap.resize(_res_arc_num);
_cost.resize(_res_arc_num);
_pi.resize(_res_node_num);
@@ -649,7 +649,7 @@
_reverse[fi] = bi;
_reverse[bi] = fi;
}
-
+
// Reset parameters
resetParams();
return *this;
@@ -758,14 +758,14 @@
_sum_supply += _supply[i];
}
if (_sum_supply > 0) return INFEASIBLE;
-
+
// Initialize vectors
for (int i = 0; i != _res_node_num; ++i) {
_pi[i] = 0;
_excess[i] = _supply[i];
}
-
+
// Remove infinite upper bounds and check negative arcs
const Value MAX = std::numeric_limits::max();
int last_out;
@@ -885,7 +885,7 @@
_cost[ra] = 0;
}
}
-
+
return OPTIMAL;
}
@@ -894,13 +894,13 @@
// Maximum path length for partial augment
const int MAX_PATH_LENGTH = 4;
- // Initialize data structures for buckets
+ // Initialize data structures for buckets
_max_rank = _alpha * _res_node_num;
_buckets.resize(_max_rank);
_bucket_next.resize(_res_node_num + 1);
_bucket_prev.resize(_res_node_num + 1);
_rank.resize(_res_node_num + 1);
-
+
// Execute the algorithm
switch (method) {
case PUSH:
@@ -939,7 +939,7 @@
}
}
}
-
+
// Initialize a cost scaling phase
void initPhase() {
// Saturate arcs not satisfying the optimality condition
@@ -957,7 +957,7 @@
}
}
}
-
+
// Find active nodes (i.e. nodes with positive excess)
for (int u = 0; u != _res_node_num; ++u) {
if (_excess[u] > 0) _active_nodes.push_back(u);
@@ -968,7 +968,7 @@
_next_out[u] = _first_out[u];
}
}
-
+
// Early termination heuristic
bool earlyTermination() {
const double EARLY_TERM_FACTOR = 3.0;
@@ -998,7 +998,7 @@
// Global potential update heuristic
void globalUpdate() {
int bucket_end = _root + 1;
-
+
// Initialize buckets
for (int r = 0; r != _max_rank; ++r) {
_buckets[r] = bucket_end;
@@ -1024,7 +1024,7 @@
// Remove the first node from the current bucket
int u = _buckets[r];
_buckets[r] = _bucket_next[u];
-
+
// Search the incomming arcs of u
LargeCost pi_u = _pi[u];
int last_out = _first_out[u+1];
@@ -1039,12 +1039,12 @@
int new_rank_v = old_rank_v;
if (nrc < LargeCost(_max_rank))
new_rank_v = r + 1 + int(nrc);
-
+
// Change the rank of v
if (new_rank_v < old_rank_v) {
_rank[v] = new_rank_v;
_next_out[v] = _first_out[v];
-
+
// Remove v from its old bucket
if (old_rank_v < _max_rank) {
if (_buckets[old_rank_v] == v) {
@@ -1054,7 +1054,7 @@
_bucket_prev[_bucket_next[v]] = _bucket_prev[v];
}
}
-
+
// Insert v to its new bucket
_bucket_next[v] = _buckets[new_rank_v];
_bucket_prev[_buckets[new_rank_v]] = v;
@@ -1072,7 +1072,7 @@
}
if (total_excess <= 0) break;
}
-
+
// Relabel nodes
for (int u = 0; u != _res_node_num; ++u) {
int k = std::min(_rank[u], r);
@@ -1092,9 +1092,9 @@
const int global_update_freq = int(GLOBAL_UPDATE_FACTOR *
(_res_node_num + _sup_node_num * _sup_node_num));
int next_update_limit = global_update_freq;
-
+
int relabel_cnt = 0;
-
+
// Perform cost scaling phases
std::vector path;
for ( ; _epsilon >= 1; _epsilon = _epsilon < _alpha && _epsilon > 1 ?
@@ -1104,10 +1104,10 @@
if (_epsilon <= EARLY_TERM_EPSILON_LIMIT) {
if (earlyTermination()) break;
}
-
+
// Initialize current phase
initPhase();
-
+
// Perform partial augment and relabel operations
while (true) {
// Select an active node (FIFO selection)
@@ -1196,7 +1196,7 @@
int next_update_limit = global_update_freq;
int relabel_cnt = 0;
-
+
// Perform cost scaling phases
BoolVector hyper(_res_node_num, false);
LargeCostVector hyper_cost(_res_node_num);
@@ -1207,7 +1207,7 @@
if (_epsilon <= EARLY_TERM_EPSILON_LIMIT) {
if (earlyTermination()) break;
}
-
+
// Initialize current phase
initPhase();
@@ -1222,7 +1222,7 @@
n = _active_nodes.front();
last_out = _first_out[n+1];
pi_n = _pi[n];
-
+
// Perform push operations if there are admissible arcs
if (_excess[n] > 0) {
for (a = _next_out[n]; a != last_out; ++a) {
@@ -1236,7 +1236,7 @@
int last_out_t = _first_out[t+1];
LargeCost pi_t = _pi[t];
for (int ta = _next_out[t]; ta != last_out_t; ++ta) {
- if (_res_cap[ta] > 0 &&
+ if (_res_cap[ta] > 0 &&
_cost[ta] + pi_t - _pi[_target[ta]] < 0)
ahead += _res_cap[ta];
if (ahead >= delta) break;
@@ -1287,7 +1287,7 @@
hyper[n] = false;
++relabel_cnt;
}
-
+
// Remove nodes that are not active nor hyper
remove_nodes:
while ( _active_nodes.size() > 0 &&
@@ -1295,7 +1295,7 @@
!hyper[_active_nodes.front()] ) {
_active_nodes.pop_front();
}
-
+
// Global update heuristic
if (relabel_cnt >= next_update_limit) {
globalUpdate();
diff --git a/lemon/cplex.cc b/lemon/cplex.cc
--- a/lemon/cplex.cc
+++ b/lemon/cplex.cc
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -111,7 +111,7 @@
return i;
}
- int CplexBase::_addRow(Value lb, ExprIterator b,
+ int CplexBase::_addRow(Value lb, ExprIterator b,
ExprIterator e, Value ub) {
int i = CPXgetnumrows(cplexEnv(), _prob);
if (lb == -INF) {
@@ -489,7 +489,7 @@
}
void CplexBase::_applyMessageLevel() {
- CPXsetintparam(cplexEnv(), CPX_PARAM_SCRIND,
+ CPXsetintparam(cplexEnv(), CPX_PARAM_SCRIND,
_message_enabled ? CPX_ON : CPX_OFF);
}
diff --git a/lemon/cycle_canceling.h b/lemon/cycle_canceling.h
--- a/lemon/cycle_canceling.h
+++ b/lemon/cycle_canceling.h
@@ -1,8 +1,8 @@
-/* -*- C++ -*-
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
*
- * This file is a part of LEMON, a generic C++ optimization library
+ * This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -142,7 +142,7 @@
private:
TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-
+
typedef std::vector IntVector;
typedef std::vector DoubleVector;
typedef std::vector ValueVector;
@@ -151,15 +151,15 @@
// Note: vector is used instead of vector for efficiency reasons
private:
-
+
template
class StaticVectorMap {
public:
typedef KT Key;
typedef VT Value;
-
+
StaticVectorMap(std::vector& v) : _v(v) {}
-
+
const Value& operator[](const Key& key) const {
return _v[StaticDigraph::id(key)];
}
@@ -167,7 +167,7 @@
Value& operator[](const Key& key) {
return _v[StaticDigraph::id(key)];
}
-
+
void set(const Key& key, const Value& val) {
_v[StaticDigraph::id(key)] = val;
}
@@ -221,9 +221,9 @@
IntVector _id_vec;
CostArcMap _cost_map;
CostNodeMap _pi_map;
-
+
public:
-
+
/// \brief Constant for infinite upper bounds (capacities).
///
/// Constant for infinite upper bounds (capacities).
@@ -366,7 +366,7 @@
_supply[_node_id[t]] = -k;
return *this;
}
-
+
/// @}
/// \name Execution control
@@ -466,7 +466,7 @@
_upper[j] = INF;
_cost[j] = 0;
_cost[_reverse[j]] = 0;
- }
+ }
_have_lower = false;
return *this;
}
@@ -508,7 +508,7 @@
_upper.resize(_res_arc_num);
_cost.resize(_res_arc_num);
_supply.resize(_res_node_num);
-
+
_res_cap.resize(_res_arc_num);
_pi.resize(_res_node_num);
@@ -554,7 +554,7 @@
_reverse[fi] = bi;
_reverse[bi] = fi;
}
-
+
// Reset parameters
resetParams();
return *this;
@@ -663,14 +663,14 @@
_sum_supply += _supply[i];
}
if (_sum_supply > 0) return INFEASIBLE;
-
+
// Initialize vectors
for (int i = 0; i != _res_node_num; ++i) {
_pi[i] = 0;
}
ValueVector excess(_supply);
-
+
// Remove infinite upper bounds and check negative arcs
const Value MAX = std::numeric_limits::max();
int last_out;
@@ -770,10 +770,10 @@
_cost[ra] = 0;
}
}
-
+
return OPTIMAL;
}
-
+
// Build a StaticDigraph structure containing the current
// residual network
void buildResidualNetwork() {
@@ -829,14 +829,14 @@
// Constants for computing the iteration limits
const int BF_FIRST_LIMIT = 2;
const double BF_LIMIT_FACTOR = 1.5;
-
+
typedef StaticVectorMap FilterMap;
typedef FilterArcs ResDigraph;
typedef StaticVectorMap PredMap;
typedef typename BellmanFord
::template SetDistMap
::template SetPredMap::Create BF;
-
+
// Build the residual network
_arc_vec.clear();
_cost_vec.clear();
@@ -926,7 +926,7 @@
typedef typename SPath::ArcIt SPathArcIt;
typedef typename HowardMmc
::template SetPath::Create MMC;
-
+
SPath cycle;
MMC mmc(_sgr, _cost_map);
mmc.cycle(cycle);
@@ -949,7 +949,7 @@
_res_cap[_reverse[j]] += delta;
}
- // Rebuild the residual network
+ // Rebuild the residual network
buildResidualNetwork();
}
}
@@ -1143,7 +1143,7 @@
epsilon = -mmc.cycleMean();
Cost cycle_cost = mmc.cycleCost();
int cycle_size = mmc.cycleSize();
-
+
// Compute feasible potentials for the current epsilon
for (int i = 0; i != int(_cost_vec.size()); ++i) {
_cost_vec[i] = cycle_size * _cost_vec[i] - cycle_cost;
@@ -1155,7 +1155,7 @@
for (int u = 0; u != _res_node_num; ++u) {
pi[u] = static_cast(_pi[u]) / cycle_size;
}
-
+
iter = limit;
}
}
diff --git a/lemon/dfs.h b/lemon/dfs.h
--- a/lemon/dfs.h
+++ b/lemon/dfs.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -82,7 +82,8 @@
///The type of the map that indicates which nodes are reached.
///The type of the map that indicates which nodes are reached.
- ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ ///It must conform to
+ ///the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
typedef typename Digraph::template NodeMap ReachedMap;
///Instantiates a \c ReachedMap.
@@ -270,7 +271,8 @@
///
///\ref named-templ-param "Named parameter" for setting
///\c ReachedMap type.
- ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ ///It must conform to
+ ///the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
template
struct SetReachedMap : public Dfs< Digraph, SetReachedMapTraits > {
typedef Dfs< Digraph, SetReachedMapTraits > Create;
@@ -802,7 +804,8 @@
///The type of the map that indicates which nodes are reached.
///The type of the map that indicates which nodes are reached.
- ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ ///It must conform to
+ ///the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
typedef typename Digraph::template NodeMap ReachedMap;
///Instantiates a ReachedMap.
@@ -1207,7 +1210,8 @@
/// \brief The type of the map that indicates which nodes are reached.
///
/// The type of the map that indicates which nodes are reached.
- /// It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ /// It must conform to the
+ /// \ref concepts::ReadWriteMap "ReadWriteMap" concept.
typedef typename Digraph::template NodeMap ReachedMap;
/// \brief Instantiates a ReachedMap.
diff --git a/lemon/dijkstra.h b/lemon/dijkstra.h
--- a/lemon/dijkstra.h
+++ b/lemon/dijkstra.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
diff --git a/lemon/dimacs.h b/lemon/dimacs.h
--- a/lemon/dimacs.h
+++ b/lemon/dimacs.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -61,7 +61,7 @@
///Discover the type of a DIMACS file
///This function starts seeking the beginning of the given file for the
- ///problem type and size info.
+ ///problem type and size info.
///The found data is returned in a special struct that can be evaluated
///and passed to the appropriate reader function.
DimacsDescriptor dimacsType(std::istream& is)
@@ -212,7 +212,7 @@
infty = std::numeric_limits::has_infinity ?
std::numeric_limits::infinity() :
std::numeric_limits