diff --git a/doc/groups.dox b/doc/groups.dox
--- a/doc/groups.dox
+++ b/doc/groups.dox
@@ -20,7 +20,7 @@
/**
@defgroup datas Data Structures
-This group describes the several data structures implemented in LEMON.
+This group contains the several data structures implemented in LEMON.
*/
/**
@@ -142,7 +142,7 @@
@ingroup graphs
\brief Graph types between real graphs and graph adaptors.
-This group describes some graph types between real graphs and graph adaptors.
+This group contains some graph types between real graphs and graph adaptors.
These classes wrap graphs to give new functionality as the adaptors do it.
On the other hand they are not light-weight structures as the adaptors.
*/
@@ -152,7 +152,7 @@
@ingroup datas
\brief Map structures implemented in LEMON.
-This group describes the map structures implemented in LEMON.
+This group contains the map structures implemented in LEMON.
LEMON provides several special purpose maps and map adaptors that e.g. combine
new maps from existing ones.
@@ -165,7 +165,7 @@
@ingroup maps
\brief Special graph-related maps.
-This group describes maps that are specifically designed to assign
+This group contains maps that are specifically designed to assign
values to the nodes and arcs/edges of graphs.
If you are looking for the standard graph maps (\c NodeMap, \c ArcMap,
@@ -177,7 +177,7 @@
\ingroup maps
\brief Tools to create new maps from existing ones
-This group describes map adaptors that are used to create "implicit"
+This group contains map adaptors that are used to create "implicit"
maps from other maps.
Most of them are \ref concepts::ReadMap "read-only maps".
@@ -240,7 +240,7 @@
@ingroup datas
\brief Two dimensional data storages implemented in LEMON.
-This group describes two dimensional data storages implemented in LEMON.
+This group contains two dimensional data storages implemented in LEMON.
*/
/**
@@ -248,7 +248,7 @@
@ingroup datas
\brief %Path structures implemented in LEMON.
-This group describes the path structures implemented in LEMON.
+This group contains the path structures implemented in LEMON.
LEMON provides flexible data structures to work with paths.
All of them have similar interfaces and they can be copied easily with
@@ -264,16 +264,16 @@
@ingroup datas
\brief Auxiliary data structures implemented in LEMON.
-This group describes some data structures implemented in LEMON in
+This group contains some data structures implemented in LEMON in
order to make it easier to implement combinatorial algorithms.
*/
/**
@defgroup algs Algorithms
-\brief This group describes the several algorithms
+\brief This group contains the several algorithms
implemented in LEMON.
-This group describes the several algorithms
+This group contains the several algorithms
implemented in LEMON.
*/
@@ -282,7 +282,7 @@
@ingroup algs
\brief Common graph search algorithms.
-This group describes the common graph search algorithms, namely
+This group contains the common graph search algorithms, namely
\e breadth-first \e search (BFS) and \e depth-first \e search (DFS).
*/
@@ -291,7 +291,7 @@
@ingroup algs
\brief Algorithms for finding shortest paths.
-This group describes the algorithms for finding shortest paths in digraphs.
+This group contains the algorithms for finding shortest paths in digraphs.
- \ref Dijkstra algorithm for finding shortest paths from a source node
when all arc lengths are non-negative.
@@ -312,7 +312,7 @@
@ingroup algs
\brief Algorithms for finding maximum flows.
-This group describes the algorithms for finding maximum flows and
+This group contains the algorithms for finding maximum flows and
feasible circulations.
The \e maximum \e flow \e problem is to find a flow of maximum value between
@@ -345,7 +345,7 @@
\brief Algorithms for finding minimum cost flows and circulations.
-This group describes the algorithms for finding minimum cost flows and
+This group contains the algorithms for finding minimum cost flows and
circulations.
The \e minimum \e cost \e flow \e problem is to find a feasible flow of
@@ -382,7 +382,7 @@
\brief Algorithms for finding minimum cut in graphs.
-This group describes the algorithms for finding minimum cut in graphs.
+This group contains the algorithms for finding minimum cut in graphs.
The \e minimum \e cut \e problem is to find a non-empty and non-complete
\f$X\f$ subset of the nodes with minimum overall capacity on
@@ -399,7 +399,7 @@
in directed graphs.
- \ref NagamochiIbaraki "Nagamochi-Ibaraki algorithm" for
calculating minimum cut in undirected graphs.
-- \ref GomoryHuTree "Gomory-Hu tree computation" for calculating
+- \ref GomoryHu "Gomory-Hu tree computation" for calculating
all-pairs minimum cut in undirected graphs.
If you want to find minimum cut just between two distinict nodes,
@@ -411,7 +411,7 @@
@ingroup algs
\brief Algorithms for discovering the graph properties
-This group describes the algorithms for discovering the graph properties
+This group contains the algorithms for discovering the graph properties
like connectivity, bipartiteness, euler property, simplicity etc.
\image html edge_biconnected_components.png
@@ -423,7 +423,7 @@
@ingroup algs
\brief Algorithms for planarity checking, embedding and drawing
-This group describes the algorithms for planarity checking,
+This group contains the algorithms for planarity checking,
embedding and drawing.
\image html planar.png
@@ -474,7 +474,7 @@
@ingroup algs
\brief Algorithms for finding a minimum cost spanning tree in a graph.
-This group describes the algorithms for finding a minimum cost spanning
+This group contains the algorithms for finding a minimum cost spanning
tree in a graph.
*/
@@ -483,7 +483,7 @@
@ingroup algs
\brief Auxiliary algorithms implemented in LEMON.
-This group describes some algorithms implemented in LEMON
+This group contains some algorithms implemented in LEMON
in order to make it easier to implement complex algorithms.
*/
@@ -492,16 +492,16 @@
@ingroup algs
\brief Approximation algorithms.
-This group describes the approximation and heuristic algorithms
+This group contains the approximation and heuristic algorithms
implemented in LEMON.
*/
/**
@defgroup gen_opt_group General Optimization Tools
-\brief This group describes some general optimization frameworks
+\brief This group contains some general optimization frameworks
implemented in LEMON.
-This group describes some general optimization frameworks
+This group contains some general optimization frameworks
implemented in LEMON.
*/
@@ -510,7 +510,7 @@
@ingroup gen_opt_group
\brief Lp and Mip solver interfaces for LEMON.
-This group describes Lp and Mip solver interfaces for LEMON. The
+This group contains Lp and Mip solver interfaces for LEMON. The
various LP solvers could be used in the same manner with this
interface.
*/
@@ -529,7 +529,7 @@
@ingroup gen_opt_group
\brief Metaheuristics for LEMON library.
-This group describes some metaheuristic optimization tools.
+This group contains some metaheuristic optimization tools.
*/
/**
@@ -544,7 +544,7 @@
@ingroup utils
\brief Simple basic graph utilities.
-This group describes some simple basic graph utilities.
+This group contains some simple basic graph utilities.
*/
/**
@@ -552,7 +552,7 @@
@ingroup utils
\brief Tools for development, debugging and testing.
-This group describes several useful tools for development,
+This group contains several useful tools for development,
debugging and testing.
*/
@@ -561,7 +561,7 @@
@ingroup misc
\brief Simple tools for measuring the performance of algorithms.
-This group describes simple tools for measuring the performance
+This group contains simple tools for measuring the performance
of algorithms.
*/
@@ -570,14 +570,14 @@
@ingroup utils
\brief Exceptions defined in LEMON.
-This group describes the exceptions defined in LEMON.
+This group contains the exceptions defined in LEMON.
*/
/**
@defgroup io_group Input-Output
\brief Graph Input-Output methods
-This group describes the tools for importing and exporting graphs
+This group contains the tools for importing and exporting graphs
and graph related data. Now it supports the \ref lgf-format
"LEMON Graph Format", the \c DIMACS format and the encapsulated
postscript (EPS) format.
@@ -588,7 +588,7 @@
@ingroup io_group
\brief Reading and writing LEMON Graph Format.
-This group describes methods for reading and writing
+This group contains methods for reading and writing
\ref lgf-format "LEMON Graph Format".
*/
@@ -597,7 +597,7 @@
@ingroup io_group
\brief General \c EPS drawer and graph exporter
-This group describes general \c EPS drawing methods and special
+This group contains general \c EPS drawing methods and special
graph exporting tools.
*/
@@ -621,7 +621,7 @@
@defgroup concept Concepts
\brief Skeleton classes and concept checking classes
-This group describes the data/algorithm skeletons and concept checking
+This group contains the data/algorithm skeletons and concept checking
classes implemented in LEMON.
The purpose of the classes in this group is fourfold.
@@ -651,7 +651,7 @@
@ingroup concept
\brief Skeleton and concept checking classes for graph structures
-This group describes the skeletons and concept checking classes of LEMON's
+This group contains the skeletons and concept checking classes of LEMON's
graph structures and helper classes used to implement these.
*/
@@ -660,7 +660,7 @@
@ingroup concept
\brief Skeleton and concept checking classes for maps
-This group describes the skeletons and concept checking classes of maps.
+This group contains the skeletons and concept checking classes of maps.
*/
/**
diff --git a/doc/mainpage.dox b/doc/mainpage.dox
--- a/doc/mainpage.dox
+++ b/doc/mainpage.dox
@@ -45,16 +45,11 @@
take a look at our \ref quicktour
"Quick Tour to LEMON" which will guide you along.
-If you already feel like using our library, see the page that tells you
-\ref getstart "How to start using LEMON".
-
-If you
-want to see how LEMON works, see
-some \ref demoprograms "demo programs".
+If you already feel like using our library, see the
+LEMON Tutorial.
If you know what you are looking for then try to find it under the
-Modules
-section.
+Modules section.
If you are a user of the old (0.x) series of LEMON, please check out the
\ref migration "Migration Guide" for the backward incompatibilities.
diff --git a/lemon/adaptors.h b/lemon/adaptors.h
--- a/lemon/adaptors.h
+++ b/lemon/adaptors.h
@@ -2254,26 +2254,27 @@
///
/// This map adaptor class adapts two arc maps of the underlying
/// digraph to get an arc map of the undirected graph.
- /// Its value type is inherited from the first arc map type
- /// (\c %ForwardMap).
- template
+ /// Its value type is inherited from the first arc map type (\c FW).
+ /// \tparam FW The type of the "foward" arc map.
+ /// \tparam BK The type of the "backward" arc map.
+ template
class CombinedArcMap {
public:
/// The key type of the map
typedef typename Parent::Arc Key;
/// The value type of the map
- typedef typename ForwardMap::Value Value;
-
- typedef typename MapTraits::ReferenceMapTag ReferenceMapTag;
-
- typedef typename MapTraits::ReturnValue ReturnValue;
- typedef typename MapTraits::ConstReturnValue ConstReturnValue;
- typedef typename MapTraits::ReturnValue Reference;
- typedef typename MapTraits::ConstReturnValue ConstReference;
+ typedef typename FW::Value Value;
+
+ typedef typename MapTraits::ReferenceMapTag ReferenceMapTag;
+
+ typedef typename MapTraits::ReturnValue ReturnValue;
+ typedef typename MapTraits::ConstReturnValue ConstReturnValue;
+ typedef typename MapTraits::ReturnValue Reference;
+ typedef typename MapTraits::ConstReturnValue ConstReference;
/// Constructor
- CombinedArcMap(ForwardMap& forward, BackwardMap& backward)
+ CombinedArcMap(FW& forward, BK& backward)
: _forward(&forward), _backward(&backward) {}
/// Sets the value associated with the given key.
@@ -2305,39 +2306,36 @@
protected:
- ForwardMap* _forward;
- BackwardMap* _backward;
+ FW* _forward;
+ BK* _backward;
};
/// \brief Returns a combined arc map
///
/// This function just returns a combined arc map.
- template
- static CombinedArcMap
- combinedArcMap(ForwardMap& forward, BackwardMap& backward) {
- return CombinedArcMap(forward, backward);
+ template
+ static CombinedArcMap
+ combinedArcMap(FW& forward, BK& backward) {
+ return CombinedArcMap(forward, backward);
}
- template
- static CombinedArcMap
- combinedArcMap(const ForwardMap& forward, BackwardMap& backward) {
- return CombinedArcMap(forward, backward);
+ template
+ static CombinedArcMap
+ combinedArcMap(const FW& forward, BK& backward) {
+ return CombinedArcMap(forward, backward);
}
- template
- static CombinedArcMap
- combinedArcMap(ForwardMap& forward, const BackwardMap& backward) {
- return CombinedArcMap(forward, backward);
+ template
+ static CombinedArcMap
+ combinedArcMap(FW& forward, const BK& backward) {
+ return CombinedArcMap(forward, backward);
}
- template
- static CombinedArcMap
- combinedArcMap(const ForwardMap& forward, const BackwardMap& backward) {
- return CombinedArcMap(forward, backward);
+ template
+ static CombinedArcMap
+ combinedArcMap(const FW& forward, const BK& backward) {
+ return CombinedArcMap(forward, backward);
}
};
@@ -3406,25 +3404,26 @@
///
/// 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 InNodeMap).
- template
+ /// 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 OUT The type of the node map for the out-nodes.
+ template
class CombinedNodeMap {
public:
/// The key type of the map
typedef Node Key;
/// The value type of the map
- typedef typename InNodeMap::Value Value;
-
- typedef typename MapTraits::ReferenceMapTag ReferenceMapTag;
- typedef typename MapTraits::ReturnValue ReturnValue;
- typedef typename MapTraits::ConstReturnValue ConstReturnValue;
- typedef typename MapTraits::ReturnValue Reference;
- typedef typename MapTraits::ConstReturnValue ConstReference;
+ typedef typename IN::Value Value;
+
+ typedef typename MapTraits::ReferenceMapTag ReferenceMapTag;
+ typedef typename MapTraits::ReturnValue ReturnValue;
+ typedef typename MapTraits::ConstReturnValue ConstReturnValue;
+ typedef typename MapTraits::ReturnValue Reference;
+ typedef typename MapTraits::ConstReturnValue ConstReference;
/// Constructor
- CombinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map)
+ CombinedNodeMap(IN& in_map, OUT& out_map)
: _in_map(in_map), _out_map(out_map) {}
/// Returns the value associated with the given key.
@@ -3456,8 +3455,8 @@
private:
- InNodeMap& _in_map;
- OutNodeMap& _out_map;
+ IN& _in_map;
+ OUT& _out_map;
};
@@ -3465,29 +3464,28 @@
/// \brief Returns a combined node map
///
/// This function just returns a combined node map.
- template
- static CombinedNodeMap
- combinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map) {
- return CombinedNodeMap(in_map, out_map);
+ template
+ static CombinedNodeMap
+ combinedNodeMap(IN& in_map, OUT& out_map) {
+ return CombinedNodeMap(in_map, out_map);
}
- template
- static CombinedNodeMap
- combinedNodeMap(const InNodeMap& in_map, OutNodeMap& out_map) {
- return CombinedNodeMap(in_map, out_map);
+ template
+ static CombinedNodeMap
+ combinedNodeMap(const IN& in_map, OUT& out_map) {
+ return CombinedNodeMap(in_map, out_map);
}
- template
- static CombinedNodeMap
- combinedNodeMap(InNodeMap& in_map, const OutNodeMap& out_map) {
- return CombinedNodeMap(in_map, out_map);
+ template
+ static CombinedNodeMap
+ combinedNodeMap(IN& in_map, const OUT& out_map) {
+ return CombinedNodeMap(in_map, out_map);
}
- template
- static CombinedNodeMap
- combinedNodeMap(const InNodeMap& in_map, const OutNodeMap& out_map) {
- return CombinedNodeMap(in_map, out_map);
+ template
+ static CombinedNodeMap
+ combinedNodeMap(const IN& in_map, const OUT& out_map) {
+ return CombinedNodeMap(in_map, out_map);
}
/// \brief Arc map combined from an arc map and a node map of the
@@ -3495,25 +3493,26 @@
///
/// This map adaptor class adapts an arc map and a node map of the
/// original digraph to get an arc map of the split digraph.
- /// Its value type is inherited from the original arc map type
- /// (\c ArcMap).
- template
+ /// Its value type is inherited from the original arc map type (\c AM).
+ /// \tparam AM The type of the arc map.
+ /// \tparam NM the type of the node map.
+ template
class CombinedArcMap {
public:
/// The key type of the map
typedef Arc Key;
/// The value type of the map
- typedef typename ArcMap::Value Value;
-
- typedef typename MapTraits::ReferenceMapTag ReferenceMapTag;
- typedef typename MapTraits::ReturnValue ReturnValue;
- typedef typename MapTraits::ConstReturnValue ConstReturnValue;
- typedef typename MapTraits::ReturnValue Reference;
- typedef typename MapTraits::ConstReturnValue ConstReference;
+ typedef typename AM::Value Value;
+
+ typedef typename MapTraits::ReferenceMapTag ReferenceMapTag;
+ typedef typename MapTraits::ReturnValue ReturnValue;
+ typedef typename MapTraits::ConstReturnValue ConstReturnValue;
+ typedef typename MapTraits::ReturnValue Reference;
+ typedef typename MapTraits::ConstReturnValue ConstReference;
/// Constructor
- CombinedArcMap(ArcMap& arc_map, NodeMap& node_map)
+ CombinedArcMap(AM& arc_map, NM& node_map)
: _arc_map(arc_map), _node_map(node_map) {}
/// Returns the value associated with the given key.
@@ -3544,8 +3543,10 @@
}
private:
- ArcMap& _arc_map;
- NodeMap& _node_map;
+
+ AM& _arc_map;
+ NM& _node_map;
+
};
/// \brief Returns a combined arc map
diff --git a/lemon/bin_heap.h b/lemon/bin_heap.h
--- a/lemon/bin_heap.h
+++ b/lemon/bin_heap.h
@@ -33,35 +33,36 @@
///
///\brief A Binary Heap implementation.
///
- ///This class implements the \e binary \e heap data structure. A \e heap
- ///is a data structure for storing items with specified values called \e
- ///priorities in such a way that finding the item with minimum priority is
- ///efficient. \c Compare specifies the ordering of the priorities. In a heap
- ///one can change the priority of an item, add or erase an item, etc.
+ ///This class implements the \e binary \e heap data structure.
+ ///
+ ///A \e heap is a data structure for storing items with specified values
+ ///called \e priorities in such a way that finding the item with minimum
+ ///priority is efficient. \c Comp specifies the ordering of the priorities.
+ ///In a heap one can change the priority of an item, add or erase an
+ ///item, etc.
///
- ///\tparam _Prio Type of the priority of the items.
- ///\tparam _ItemIntMap A read and writable Item int map, used internally
+ ///\tparam PR Type of the priority of the items.
+ ///\tparam IM A read and writable item map with int values, used internally
///to handle the cross references.
- ///\tparam _Compare A class for the ordering of the priorities. The
- ///default is \c std::less<_Prio>.
+ ///\tparam Comp A functor class for the ordering of the priorities.
+ ///The default is \c std::less.
///
///\sa FibHeap
///\sa Dijkstra
- template >
+ template >
class BinHeap {
public:
///\e
- typedef _ItemIntMap ItemIntMap;
+ typedef IM ItemIntMap;
///\e
- typedef _Prio Prio;
+ typedef PR Prio;
///\e
typedef typename ItemIntMap::Key Item;
///\e
typedef std::pair- Pair;
///\e
- typedef _Compare Compare;
+ typedef Comp Compare;
/// \brief Type to represent the items states.
///
@@ -69,49 +70,49 @@
/// "pre heap" or "post heap". The latter two are indifferent from the
/// heap's point of view, but may be useful to the user.
///
- /// The ItemIntMap \e should be initialized in such way that it maps
- /// PRE_HEAP (-1) to any element to be put in the heap...
+ /// The item-int map must be initialized in such way that it assigns
+ /// \c PRE_HEAP (-1) to any element to be put in the heap.
enum State {
- IN_HEAP = 0,
- PRE_HEAP = -1,
- POST_HEAP = -2
+ IN_HEAP = 0, ///< \e
+ PRE_HEAP = -1, ///< \e
+ POST_HEAP = -2 ///< \e
};
private:
- std::vector data;
- Compare comp;
- ItemIntMap &iim;
+ std::vector _data;
+ Compare _comp;
+ ItemIntMap &_iim;
public:
/// \brief The constructor.
///
/// The constructor.
- /// \param _iim should be given to the constructor, since it is used
+ /// \param map should be given to the constructor, since it is used
/// internally to handle the cross references. The value of the map
- /// should be PRE_HEAP (-1) for each element.
- explicit BinHeap(ItemIntMap &_iim) : iim(_iim) {}
+ /// must be \c PRE_HEAP (-1) for every item.
+ explicit BinHeap(ItemIntMap &map) : _iim(map) {}
/// \brief The constructor.
///
/// The constructor.
- /// \param _iim should be given to the constructor, since it is used
+ /// \param map should be given to the constructor, since it is used
/// internally to handle the cross references. The value of the map
/// should be PRE_HEAP (-1) for each element.
///
- /// \param _comp The comparator function object.
- BinHeap(ItemIntMap &_iim, const Compare &_comp)
- : iim(_iim), comp(_comp) {}
+ /// \param comp The comparator function object.
+ BinHeap(ItemIntMap &map, const Compare &comp)
+ : _iim(map), _comp(comp) {}
/// The number of items stored in the heap.
///
/// \brief Returns the number of items stored in the heap.
- int size() const { return data.size(); }
+ int size() const { return _data.size(); }
/// \brief Checks if the heap stores no items.
///
/// Returns \c true if and only if the heap stores no items.
- bool empty() const { return data.empty(); }
+ bool empty() const { return _data.empty(); }
/// \brief Make empty this heap.
///
@@ -120,7 +121,7 @@
/// the heap and after that you should set the cross reference map for
/// each item to \c PRE_HEAP.
void clear() {
- data.clear();
+ _data.clear();
}
private:
@@ -128,13 +129,13 @@
static int second_child(int i) { return 2*i+2; }
bool less(const Pair &p1, const Pair &p2) const {
- return comp(p1.second, p2.second);
+ return _comp(p1.second, p2.second);
}
int bubble_up(int hole, Pair p) {
int par = parent(hole);
- while( hole>0 && less(p,data[par]) ) {
- move(data[par],hole);
+ while( hole>0 && less(p,_data[par]) ) {
+ move(_data[par],hole);
hole = par;
par = parent(hole);
}
@@ -145,18 +146,18 @@
int bubble_down(int hole, Pair p, int length) {
int child = second_child(hole);
while(child < length) {
- if( less(data[child-1], data[child]) ) {
+ if( less(_data[child-1], _data[child]) ) {
--child;
}
- if( !less(data[child], p) )
+ if( !less(_data[child], p) )
goto ok;
- move(data[child], hole);
+ move(_data[child], hole);
hole = child;
child = second_child(hole);
}
child--;
- if( child 0) {
- bubble_down(0, data[n], n);
+ bubble_down(0, _data[n], n);
}
- data.pop_back();
+ _data.pop_back();
}
/// \brief Deletes \c i from the heap.
@@ -224,26 +225,26 @@
/// \param i The item to erase.
/// \pre The item should be in the heap.
void erase(const Item &i) {
- int h = iim[i];
- int n = data.size()-1;
- iim.set(data[h].first, POST_HEAP);
+ int h = _iim[i];
+ int n = _data.size()-1;
+ _iim.set(_data[h].first, POST_HEAP);
if( h < n ) {
- if ( bubble_up(h, data[n]) == h) {
- bubble_down(h, data[n], n);
+ if ( bubble_up(h, _data[n]) == h) {
+ bubble_down(h, _data[n], n);
}
}
- data.pop_back();
+ _data.pop_back();
}
/// \brief Returns the priority of \c i.
///
/// This function returns the priority of item \c i.
+ /// \param i The item.
/// \pre \c i must be in the heap.
- /// \param i The item.
Prio operator[](const Item &i) const {
- int idx = iim[i];
- return data[idx].second;
+ int idx = _iim[i];
+ return _data[idx].second;
}
/// \brief \c i gets to the heap with priority \c p independently
@@ -254,40 +255,40 @@
/// \param i The item.
/// \param p The priority.
void set(const Item &i, const Prio &p) {
- int idx = iim[i];
+ int idx = _iim[i];
if( idx < 0 ) {
push(i,p);
}
- else if( comp(p, data[idx].second) ) {
+ else if( _comp(p, _data[idx].second) ) {
bubble_up(idx, Pair(i,p));
}
else {
- bubble_down(idx, Pair(i,p), data.size());
+ bubble_down(idx, Pair(i,p), _data.size());
}
}
/// \brief Decreases the priority of \c i to \c p.
///
/// This method decreases the priority of item \c i to \c p.
+ /// \param i The item.
+ /// \param p The priority.
/// \pre \c i must be stored in the heap with priority at least \c
/// p relative to \c Compare.
- /// \param i The item.
- /// \param p The priority.
void decrease(const Item &i, const Prio &p) {
- int idx = iim[i];
+ int idx = _iim[i];
bubble_up(idx, Pair(i,p));
}
/// \brief Increases the priority of \c i to \c p.
///
/// This method sets the priority of item \c i to \c p.
+ /// \param i The item.
+ /// \param p The priority.
/// \pre \c i must be stored in the heap with priority at most \c
/// p relative to \c Compare.
- /// \param i The item.
- /// \param p The priority.
void increase(const Item &i, const Prio &p) {
- int idx = iim[i];
- bubble_down(idx, Pair(i,p), data.size());
+ int idx = _iim[i];
+ bubble_down(idx, Pair(i,p), _data.size());
}
/// \brief Returns if \c item is in, has already been in, or has
@@ -299,7 +300,7 @@
/// get back to the heap again.
/// \param i The item.
State state(const Item &i) const {
- int s = iim[i];
+ int s = _iim[i];
if( s>=0 )
s=0;
return State(s);
@@ -319,7 +320,7 @@
if (state(i) == IN_HEAP) {
erase(i);
}
- iim[i] = st;
+ _iim[i] = st;
break;
case IN_HEAP:
break;
@@ -333,10 +334,10 @@
/// \c i item will out of the heap and \c j will be in the heap
/// with the same prioriority as prevoiusly the \c i item.
void replace(const Item& i, const Item& j) {
- int idx = iim[i];
- iim.set(i, iim[j]);
- iim.set(j, idx);
- data[idx].first = j;
+ int idx = _iim[i];
+ _iim.set(i, _iim[j]);
+ _iim.set(j, idx);
+ _data[idx].first = j;
}
}; // class BinHeap
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
@@ -24,14 +24,14 @@
#include
#include
-///\ingroup digraphbits
-///\file
-///\brief Extenders for the arc set types
+//\ingroup digraphbits
+//\file
+//\brief Extenders for the arc set types
namespace lemon {
- /// \ingroup digraphbits
- ///
- /// \brief Extender for the ArcSets
+ // \ingroup digraphbits
+ //
+ // \brief Extender for the ArcSets
template
class ArcSetExtender : public Base {
public:
@@ -72,7 +72,7 @@
// Alteration notifier extensions
- /// The arc observer registry.
+ // The arc observer registry.
typedef AlterationNotifier ArcNotifier;
protected:
@@ -83,9 +83,7 @@
using Parent::notifier;
- /// \brief Gives back the arc alteration notifier.
- ///
- /// Gives back the arc alteration notifier.
+ // Gives back the arc alteration notifier.
ArcNotifier& notifier(Arc) const {
return arc_notifier;
}
@@ -185,30 +183,30 @@
};
- /// \brief Base node of the iterator
- ///
- /// Returns the base node (ie. the source in this case) of the iterator
+ // \brief Base node of the iterator
+ //
+ // Returns the base node (ie. the source in this case) of the iterator
Node baseNode(const OutArcIt &e) const {
return Parent::source(static_cast(e));
}
- /// \brief Running node of the iterator
- ///
- /// Returns the running node (ie. the target in this case) of the
- /// iterator
+ // \brief Running node of the iterator
+ //
+ // Returns the running node (ie. the target in this case) of the
+ // iterator
Node runningNode(const OutArcIt &e) const {
return Parent::target(static_cast(e));
}
- /// \brief Base node of the iterator
- ///
- /// Returns the base node (ie. the target in this case) of the iterator
+ // \brief Base node of the iterator
+ //
+ // Returns the base node (ie. the target in this case) of the iterator
Node baseNode(const InArcIt &e) const {
return Parent::target(static_cast(e));
}
- /// \brief Running node of the iterator
- ///
- /// Returns the running node (ie. the source in this case) of the
- /// iterator
+ // \brief Running node of the iterator
+ //
+ // Returns the running node (ie. the source in this case) of the
+ // iterator
Node runningNode(const InArcIt &e) const {
return Parent::source(static_cast(e));
}
@@ -271,9 +269,9 @@
};
- /// \ingroup digraphbits
- ///
- /// \brief Extender for the EdgeSets
+ // \ingroup digraphbits
+ //
+ // \brief Extender for the EdgeSets
template
class EdgeSetExtender : public Base {
@@ -492,43 +490,43 @@
}
};
- /// \brief Base node of the iterator
- ///
- /// Returns the base node (ie. the source in this case) of the iterator
+ // \brief Base node of the iterator
+ //
+ // Returns the base node (ie. the source in this case) of the iterator
Node baseNode(const OutArcIt &e) const {
return Parent::source(static_cast(e));
}
- /// \brief Running node of the iterator
- ///
- /// Returns the running node (ie. the target in this case) of the
- /// iterator
+ // \brief Running node of the iterator
+ //
+ // Returns the running node (ie. the target in this case) of the
+ // iterator
Node runningNode(const OutArcIt &e) const {
return Parent::target(static_cast(e));
}
- /// \brief Base node of the iterator
- ///
- /// Returns the base node (ie. the target in this case) of the iterator
+ // \brief Base node of the iterator
+ //
+ // Returns the base node (ie. the target in this case) of the iterator
Node baseNode(const InArcIt &e) const {
return Parent::target(static_cast(e));
}
- /// \brief Running node of the iterator
- ///
- /// Returns the running node (ie. the source in this case) of the
- /// iterator
+ // \brief Running node of the iterator
+ //
+ // Returns the running node (ie. the source in this case) of the
+ // iterator
Node runningNode(const InArcIt &e) const {
return Parent::source(static_cast(e));
}
- /// Base node of the iterator
- ///
- /// Returns the base node of the iterator
+ // Base node of the iterator
+ //
+ // Returns the base node of the iterator
Node baseNode(const IncEdgeIt &e) const {
return e.direction ? u(e) : v(e);
}
- /// Running node of the iterator
- ///
- /// Returns the running node of the iterator
+ // Running node of the iterator
+ //
+ // Returns the running node of the iterator
Node runningNode(const IncEdgeIt &e) const {
return e.direction ? v(e) : u(e);
}
diff --git a/lemon/circulation.h b/lemon/circulation.h
--- a/lemon/circulation.h
+++ b/lemon/circulation.h
@@ -215,9 +215,9 @@
///@{
- template
+ template
struct SetFlowMapTraits : public Traits {
- typedef _FlowMap FlowMap;
+ typedef T FlowMap;
static FlowMap *createFlowMap(const Digraph&) {
LEMON_ASSERT(false, "FlowMap is not initialized");
return 0; // ignore warnings
@@ -229,17 +229,17 @@
///
/// \ref named-templ-param "Named parameter" for setting FlowMap
/// type.
- template
+ template
struct SetFlowMap
: public Circulation > {
+ SetFlowMapTraits > {
typedef Circulation > Create;
+ SetFlowMapTraits > Create;
};
- template
+ template
struct SetElevatorTraits : public Traits {
- typedef _Elevator Elevator;
+ typedef T Elevator;
static Elevator *createElevator(const Digraph&, int) {
LEMON_ASSERT(false, "Elevator is not initialized");
return 0; // ignore warnings
@@ -255,17 +255,17 @@
/// \ref elevator(Elevator&) "elevator()" function before calling
/// \ref run() or \ref init().
/// \sa SetStandardElevator
- template
+ template
struct SetElevator
: public Circulation > {
+ SetElevatorTraits > {
typedef Circulation > Create;
+ SetElevatorTraits > Create;
};
- template
+ template
struct SetStandardElevatorTraits : public Traits {
- typedef _Elevator Elevator;
+ typedef T Elevator;
static Elevator *createElevator(const Digraph& digraph, int max_level) {
return new Elevator(digraph, max_level);
}
@@ -283,12 +283,12 @@
/// algorithm with the \ref elevator(Elevator&) "elevator()" function
/// before calling \ref run() or \ref init().
/// \sa SetElevator
- template
+ template
struct SetStandardElevator
: public Circulation > {
+ SetStandardElevatorTraits > {
typedef Circulation > Create;
+ SetStandardElevatorTraits > Create;
};
/// @}
@@ -682,7 +682,7 @@
/// empty set, so \c bar[v] will be \c false for all nodes \c v.
///
/// \note This function calls \ref barrier() for each node,
- /// so it runs in \f$O(n)\f$ time.
+ /// so it runs in O(n) time.
///
/// \pre Either \ref run() or \ref init() must be called before
/// using this function.
diff --git a/lemon/concepts/graph.h b/lemon/concepts/graph.h
--- a/lemon/concepts/graph.h
+++ b/lemon/concepts/graph.h
@@ -601,23 +601,35 @@
/// \brief Opposite node on an arc
///
- /// \return the opposite of the given Node on the given Edge
+ /// \return The opposite of the given node on the given edge.
Node oppositeNode(Node, Edge) const { return INVALID; }
/// \brief First node of the edge.
///
- /// \return the first node of the given Edge.
+ /// \return The first node of the given edge.
///
/// Naturally edges don't have direction and thus
- /// don't have source and target node. But we use these two methods
- /// to query the two nodes of the arc. The direction of the arc
- /// which arises this way is called the inherent direction of the
+ /// don't have source and target node. However we use \c u() and \c v()
+ /// methods to query the two nodes of the arc. The direction of the
+ /// arc which arises this way is called the inherent direction of the
/// edge, and is used to define the "default" direction
/// of the directed versions of the arcs.
- /// \sa direction
+ /// \sa v()
+ /// \sa direction()
Node u(Edge) const { return INVALID; }
/// \brief Second node of the edge.
+ ///
+ /// \return The second node of the given edge.
+ ///
+ /// Naturally edges don't have direction and thus
+ /// don't have source and target node. However we use \c u() and \c v()
+ /// methods to query the two nodes of the arc. The direction of the
+ /// arc which arises this way is called the inherent direction of the
+ /// edge, and is used to define the "default" direction
+ /// of the directed versions of the arcs.
+ /// \sa u()
+ /// \sa direction()
Node v(Edge) const { return INVALID; }
/// \brief Source node of the directed arc.
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
@@ -20,7 +20,6 @@
///\file
///\brief The concept of graph components.
-
#ifndef LEMON_CONCEPTS_GRAPH_COMPONENTS_H
#define LEMON_CONCEPTS_GRAPH_COMPONENTS_H
@@ -44,7 +43,7 @@
/// with 'a'.
#ifndef DOXYGEN
- template
+ template
#endif
class GraphItem {
public:
@@ -296,11 +295,11 @@
/// core id functions for the digraph structure.
/// The most of the base digraphs should conform to this concept.
/// The id's are unique and immutable.
- template
- class IDableDigraphComponent : public _Base {
+ template
+ class IDableDigraphComponent : public BAS {
public:
- typedef _Base Base;
+ typedef BAS Base;
typedef typename Base::Node Node;
typedef typename Base::Arc Arc;
@@ -374,14 +373,14 @@
/// core id functions for the undirected graph structure. The
/// most of the base undirected graphs should conform to this
/// concept. The id's are unique and immutable.
- template
- class IDableGraphComponent : public IDableDigraphComponent<_Base> {
+ template
+ class IDableGraphComponent : public IDableDigraphComponent {
public:
- typedef _Base Base;
+ typedef BAS Base;
typedef typename Base::Edge Edge;
- using IDableDigraphComponent<_Base>::id;
+ using IDableDigraphComponent::id;
/// \brief Gives back an unique integer id for the Edge.
///
@@ -425,8 +424,8 @@
///
/// Skeleton class for graph NodeIt and ArcIt.
///
- template
- class GraphItemIt : public _Item {
+ template
+ class GraphItemIt : public Item {
public:
/// \brief Default constructor.
///
@@ -442,7 +441,7 @@
///
/// Sets the iterator to the first item of \c the graph.
///
- explicit GraphItemIt(const _Graph&) {}
+ explicit GraphItemIt(const GR&) {}
/// \brief Invalid constructor \& conversion.
///
/// This constructor initializes the item to be invalid.
@@ -479,24 +478,24 @@
++it2 = it1;
++(++it1);
- _Item bi = it1;
+ Item bi = it1;
bi = it2;
}
- _Graph& g;
+ GR& g;
};
};
/// \brief Skeleton class for graph InArcIt and OutArcIt
///
/// \note Because InArcIt and OutArcIt may not inherit from the same
- /// base class, the _selector is a additional template parameter. For
- /// InArcIt you should instantiate it with character 'i' and for
+ /// base class, the \c sel is a additional template parameter (selector).
+ /// For InArcIt you should instantiate it with character 'i' and for
/// OutArcIt with 'o'.
- template
- class GraphIncIt : public _Item {
+ template
+ class GraphIncIt : public Item {
public:
/// \brief Default constructor.
///
@@ -507,14 +506,14 @@
///
/// Copy constructor.
///
- GraphIncIt(GraphIncIt const& gi) : _Item(gi) {}
+ GraphIncIt(GraphIncIt const& gi) : Item(gi) {}
/// \brief Sets the iterator to the first arc incoming into or outgoing
/// from the node.
///
/// Sets the iterator to the first arc incoming into or outgoing
/// from the node.
///
- explicit GraphIncIt(const _Graph&, const _Base&) {}
+ explicit GraphIncIt(const GR&, const Base&) {}
/// \brief Invalid constructor \& conversion.
///
/// This constructor initializes the item to be invalid.
@@ -546,21 +545,21 @@
template
struct Constraints {
void constraints() {
- checkConcept, _GraphIncIt>();
+ checkConcept, _GraphIncIt>();
_GraphIncIt it1(graph, node);
_GraphIncIt it2;
it2 = ++it1;
++it2 = it1;
++(++it1);
- _Item e = it1;
+ Item e = it1;
e = it2;
}
- _Item arc;
- _Base node;
- _Graph graph;
+ Item arc;
+ Base node;
+ GR graph;
_GraphIncIt it;
};
};
@@ -571,12 +570,12 @@
/// This class provides beside the core digraph features
/// iterator based iterable interface for the digraph structure.
/// This concept is part of the Digraph concept.
- template
- class IterableDigraphComponent : public _Base {
+ template
+ class IterableDigraphComponent : public BAS {
public:
- typedef _Base Base;
+ typedef BAS Base;
typedef typename Base::Node Node;
typedef typename Base::Arc Arc;
@@ -756,11 +755,11 @@
/// This class provides beside the core graph features iterator
/// based iterable interface for the undirected graph structure.
/// This concept is part of the Graph concept.
- template
- class IterableGraphComponent : public IterableDigraphComponent<_Base> {
+ template
+ class IterableGraphComponent : public IterableDigraphComponent {
public:
- typedef _Base Base;
+ typedef BAS Base;
typedef typename Base::Node Node;
typedef typename Base::Arc Arc;
typedef typename Base::Edge Edge;
@@ -773,8 +772,8 @@
/// This interface provides functions for iteration on graph items
/// @{
- using IterableDigraphComponent<_Base>::first;
- using IterableDigraphComponent<_Base>::next;
+ using IterableDigraphComponent::first;
+ using IterableDigraphComponent::next;
/// \brief Gives back the first edge in the iterating
/// order.
@@ -808,8 +807,8 @@
/// use it.
void nextInc(Edge&, bool&) const {}
- using IterableDigraphComponent<_Base>::baseNode;
- using IterableDigraphComponent<_Base>::runningNode;
+ using IterableDigraphComponent::baseNode;
+ using IterableDigraphComponent::runningNode;
/// @}
@@ -875,7 +874,6 @@
}
const _Graph& graph;
-
};
};
@@ -887,11 +885,11 @@
/// obsevers can be registered into the notifier and whenever an
/// alteration occured in the digraph all the observers will
/// notified about it.
- template
- class AlterableDigraphComponent : public _Base {
+ template
+ class AlterableDigraphComponent : public BAS {
public:
- typedef _Base Base;
+ typedef BAS Base;
typedef typename Base::Node Node;
typedef typename Base::Arc Arc;
@@ -945,11 +943,11 @@
/// obsevers can be registered into the notifier and whenever an
/// alteration occured in the graph all the observers will
/// notified about it.
- template
- class AlterableGraphComponent : public AlterableDigraphComponent<_Base> {
+ template
+ class AlterableGraphComponent : public AlterableDigraphComponent {
public:
- typedef _Base Base;
+ typedef BAS Base;
typedef typename Base::Edge Edge;
@@ -974,9 +972,7 @@
}
const _Graph& graph;
-
};
-
};
/// \brief Class describing the concept of graph maps
@@ -984,18 +980,18 @@
/// This class describes the common interface of the graph maps
/// (NodeMap, ArcMap), that is maps that can be used to
/// associate data to graph descriptors (nodes or arcs).
- template
- class GraphMap : public ReadWriteMap<_Item, _Value> {
+ template
+ class GraphMap : public ReadWriteMap {
public:
- typedef ReadWriteMap<_Item, _Value> Parent;
+ typedef ReadWriteMap Parent;
/// The graph type of the map.
- typedef _Graph Graph;
+ typedef GR Graph;
/// The key type of the map.
- typedef _Item Key;
+ typedef K Key;
/// The value type of the map.
- typedef _Value Value;
+ typedef V Value;
/// \brief Construct a new map.
///
@@ -1055,11 +1051,11 @@
/// This class provides beside the core digraph features
/// map interface for the digraph structure.
/// This concept is part of the Digraph concept.
- template
- class MappableDigraphComponent : public _Base {
+ template
+ class MappableDigraphComponent : public BAS {
public:
- typedef _Base Base;
+ typedef BAS Base;
typedef typename Base::Node Node;
typedef typename Base::Arc Arc;
@@ -1069,10 +1065,10 @@
///
/// ReadWrite map of the nodes.
///
- template
- class NodeMap : public GraphMap {
+ template
+ class NodeMap : public GraphMap {
public:
- typedef GraphMap Parent;
+ typedef GraphMap Parent;
/// \brief Construct a new map.
///
@@ -1083,7 +1079,7 @@
/// \brief Construct a new map with default value.
///
/// Construct a new map for the digraph and initalise the values.
- NodeMap(const MappableDigraphComponent& digraph, const _Value& value)
+ NodeMap(const MappableDigraphComponent& digraph, const V& value)
: Parent(digraph, value) {}
private:
@@ -1097,7 +1093,7 @@
/// Assign operator.
template
NodeMap& operator=(const CMap&) {
- checkConcept, CMap>();
+ checkConcept, CMap>();
return *this;
}
@@ -1107,10 +1103,10 @@
///
/// ReadWrite map of the arcs.
///
- template
- class ArcMap : public GraphMap {
+ template
+ class ArcMap : public GraphMap {
public:
- typedef GraphMap Parent;
+ typedef GraphMap Parent;
/// \brief Construct a new map.
///
@@ -1121,7 +1117,7 @@
/// \brief Construct a new map with default value.
///
/// Construct a new map for the digraph and initalise the values.
- ArcMap(const MappableDigraphComponent& digraph, const _Value& value)
+ ArcMap(const MappableDigraphComponent& digraph, const V& value)
: Parent(digraph, value) {}
private:
@@ -1135,7 +1131,7 @@
/// Assign operator.
template
ArcMap& operator=(const CMap&) {
- checkConcept, CMap>();
+ checkConcept, CMap>();
return *this;
}
@@ -1191,11 +1187,11 @@
/// This class provides beside the core graph features
/// map interface for the graph structure.
/// This concept is part of the Graph concept.
- template
- class MappableGraphComponent : public MappableDigraphComponent<_Base> {
+ template
+ class MappableGraphComponent : public MappableDigraphComponent {
public:
- typedef _Base Base;
+ typedef BAS Base;
typedef typename Base::Edge Edge;
typedef MappableGraphComponent Graph;
@@ -1204,10 +1200,10 @@
///
/// ReadWrite map of the edges.
///
- template
- class EdgeMap : public GraphMap {
+ template
+ class EdgeMap : public GraphMap {
public:
- typedef GraphMap Parent;
+ typedef GraphMap Parent;
/// \brief Construct a new map.
///
@@ -1218,7 +1214,7 @@
/// \brief Construct a new map with default value.
///
/// Construct a new map for the graph and initalise the values.
- EdgeMap(const MappableGraphComponent& graph, const _Value& value)
+ EdgeMap(const MappableGraphComponent& graph, const V& value)
: Parent(graph, value) {}
private:
@@ -1232,7 +1228,7 @@
/// Assign operator.
template
EdgeMap& operator=(const CMap&) {
- checkConcept, CMap>();
+ checkConcept, CMap>();
return *this;
}
@@ -1276,13 +1272,13 @@
/// extendable interface for the digraph structure. The main
/// difference between the base and this interface is that the
/// digraph alterations should handled already on this level.
- template
- class ExtendableDigraphComponent : public _Base {
+ template
+ class ExtendableDigraphComponent : public BAS {
public:
- typedef _Base Base;
+ typedef BAS Base;
- typedef typename _Base::Node Node;
- typedef typename _Base::Arc Arc;
+ typedef typename Base::Node Node;
+ typedef typename Base::Arc Arc;
/// \brief Adds a new node to the digraph.
///
@@ -1321,13 +1317,13 @@
/// The main difference between the base and this interface is
/// that the graph alterations should handled already on this
/// level.
- template
- class ExtendableGraphComponent : public _Base {
+ template
+ class ExtendableGraphComponent : public BAS {
public:
- typedef _Base Base;
- typedef typename _Base::Node Node;
- typedef typename _Base::Edge Edge;
+ typedef BAS Base;
+ typedef typename Base::Node Node;
+ typedef typename Base::Edge Edge;
/// \brief Adds a new node to the graph.
///
@@ -1365,11 +1361,11 @@
/// functions for the digraph structure. The main difference between
/// the base and this interface is that the digraph alterations
/// should handled already on this level.
- template
- class ErasableDigraphComponent : public _Base {
+ template
+ class ErasableDigraphComponent : public BAS {
public:
- typedef _Base Base;
+ typedef BAS Base;
typedef typename Base::Node Node;
typedef typename Base::Arc Arc;
@@ -1405,11 +1401,11 @@
/// core erase functions for the undirceted graph structure. The
/// main difference between the base and this interface is that
/// the graph alterations should handled already on this level.
- template
- class ErasableGraphComponent : public _Base {
+ template
+ class ErasableGraphComponent : public BAS {
public:
- typedef _Base Base;
+ typedef BAS Base;
typedef typename Base::Node Node;
typedef typename Base::Edge Edge;
@@ -1445,11 +1441,11 @@
/// functions for the digraph structure. The main difference between
/// the base and this interface is that the digraph alterations
/// should handled already on this level.
- template
- class ClearableDigraphComponent : public _Base {
+ template
+ class ClearableDigraphComponent : public BAS {
public:
- typedef _Base Base;
+ typedef BAS Base;
/// \brief Erase all nodes and arcs from the digraph.
///
@@ -1474,11 +1470,11 @@
/// core clear functions for the undirected graph structure. The
/// main difference between the base and this interface is that
/// the graph alterations should handled already on this level.
- template
- class ClearableGraphComponent : public ClearableDigraphComponent<_Base> {
+ template
+ class ClearableGraphComponent : public ClearableDigraphComponent {
public:
- typedef _Base Base;
+ typedef BAS Base;
template
struct Constraints {
diff --git a/lemon/concepts/heap.h b/lemon/concepts/heap.h
--- a/lemon/concepts/heap.h
+++ b/lemon/concepts/heap.h
@@ -35,17 +35,32 @@
/// \brief The heap concept.
///
- /// Concept class describing the main interface of heaps.
- template
+ /// Concept class describing the main interface of heaps. A \e heap
+ /// is a data structure for storing items with specified values called
+ /// \e priorities in such a way that finding the item with minimum
+ /// priority is efficient. In a heap one can change the priority of an
+ /// item, add or erase an item, etc.
+ ///
+ /// \tparam PR Type of the priority of the items.
+ /// \tparam IM A read and writable item map with int values, used
+ /// internally to handle the cross references.
+ /// \tparam Comp A functor class for the ordering of the priorities.
+ /// The default is \c std::less.
+#ifdef DOXYGEN
+ template >
+#else
+ template
+#endif
class Heap {
public:
+ /// Type of the item-int map.
+ typedef IM ItemIntMap;
+ /// Type of the priorities.
+ typedef PR Prio;
/// Type of the items stored in the heap.
typedef typename ItemIntMap::Key Item;
- /// Type of the priorities.
- typedef Priority Prio;
-
/// \brief Type to represent the states of the items.
///
/// Each item has a state associated to it. It can be "in heap",
@@ -53,12 +68,12 @@
/// from the point of view of the heap, but may be useful for
/// the user.
///
- /// The \c ItemIntMap must be initialized in such a way, that it
- /// assigns \c PRE_HEAP (-1) to every item.
+ /// The item-int map must be initialized in such way that it assigns
+ /// \c PRE_HEAP (-1) to any element to be put in the heap.
enum State {
- IN_HEAP = 0,
- PRE_HEAP = -1,
- POST_HEAP = -2
+ IN_HEAP = 0, ///< The "in heap" state constant.
+ PRE_HEAP = -1, ///< The "pre heap" state constant.
+ POST_HEAP = -2 ///< The "post heap" state constant.
};
/// \brief The constructor.
@@ -119,8 +134,8 @@
/// \brief The priority of an item.
///
/// Returns the priority of the given item.
+ /// \param i The item.
/// \pre \c i must be in the heap.
- /// \param i The item.
Prio operator[](const Item &i) const {}
/// \brief Sets the priority of an item or inserts it, if it is
@@ -137,17 +152,17 @@
/// \brief Decreases the priority of an item to the given value.
///
/// Decreases the priority of an item to the given value.
- /// \pre \c i must be stored in the heap with priority at least \c p.
/// \param i The item.
/// \param p The priority.
+ /// \pre \c i must be stored in the heap with priority at least \c p.
void decrease(const Item &i, const Prio &p) {}
/// \brief Increases the priority of an item to the given value.
///
/// Increases the priority of an item to the given value.
- /// \pre \c i must be stored in the heap with priority at most \c p.
/// \param i The item.
/// \param p The priority.
+ /// \pre \c i must be stored in the heap with priority at most \c p.
void increase(const Item &i, const Prio &p) {}
/// \brief Returns if an item is in, has already been in, or has
diff --git a/lemon/concepts/path.h b/lemon/concepts/path.h
--- a/lemon/concepts/path.h
+++ b/lemon/concepts/path.h
@@ -38,19 +38,19 @@
///
/// A skeleton structure for representing directed paths in a
/// digraph.
- /// \tparam _Digraph The digraph type in which the path is.
+ /// \tparam GR The digraph type in which the path is.
///
/// In a sense, the path can be treated as a list of arcs. The
/// lemon path type stores just this list. As a consequence it
/// cannot enumerate the nodes in the path and the zero length
/// paths cannot store the source.
///
- template
+ template
class Path {
public:
/// Type of the underlying digraph.
- typedef _Digraph Digraph;
+ typedef GR Digraph;
/// Arc type of the underlying digraph.
typedef typename Digraph::Arc Arc;
@@ -205,18 +205,17 @@
/// LEMON such algorithms gives back a path dumper what can
/// assigned to a real path and the dumpers can be implemented as
/// an adaptor class to the predecessor map.
-
- /// \tparam _Digraph The digraph type in which the path is.
+ ///
+ /// \tparam GR The digraph type in which the path is.
///
/// The paths can be constructed from any path type by a
/// template constructor or a template assignment operator.
- ///
- template
+ template
class PathDumper {
public:
/// Type of the underlying digraph.
- typedef _Digraph Digraph;
+ typedef GR Digraph;
/// Arc type of the underlying digraph.
typedef typename Digraph::Arc Arc;
diff --git a/lemon/connectivity.h b/lemon/connectivity.h
--- a/lemon/connectivity.h
+++ b/lemon/connectivity.h
@@ -46,7 +46,7 @@
///
/// Check whether the given undirected graph is connected.
/// \param graph The undirected graph.
- /// \return %True when there is path between any two nodes in the graph.
+ /// \return \c true when there is path between any two nodes in the graph.
/// \note By definition, the empty graph is connected.
template
bool connected(const Graph& graph) {
@@ -234,7 +234,7 @@
/// Check whether the given directed graph is strongly connected. The
/// graph is strongly connected when any two nodes of the graph are
/// connected with directed paths in both direction.
- /// \return %False when the graph is not strongly connected.
+ /// \return \c false when the graph is not strongly connected.
/// \see connected
///
/// \note By definition, the empty graph is strongly connected.
@@ -709,7 +709,7 @@
/// on same circle.
///
/// \param graph The graph.
- /// \return %True when the graph bi-node-connected.
+ /// \return \c true when the graph bi-node-connected.
template
bool biNodeConnected(const Graph& graph) {
return countBiNodeConnectedComponents(graph) <= 1;
@@ -1230,7 +1230,7 @@
/// from 0 to the number of the nodes in the graph minus one. Each values
/// of the map will be set exactly once, the values will be set descending
/// order.
- /// \return %False when the graph is not DAG.
+ /// \return \c false when the graph is not DAG.
///
/// \see topologicalSort
/// \see dag
@@ -1279,7 +1279,7 @@
///
/// Check that the given directed graph is a DAG. The DAG is
/// an Directed Acyclic Digraph.
- /// \return %False when the graph is not DAG.
+ /// \return \c false when the graph is not DAG.
/// \see acyclic
template
bool dag(const Digraph& digraph) {
@@ -1321,7 +1321,7 @@
///
/// Check that the given undirected graph acyclic.
/// \param graph The undirected graph.
- /// \return %True when there is no circle in the graph.
+ /// \return \c true when there is no circle in the graph.
/// \see dag
template
bool acyclic(const Graph& graph) {
@@ -1355,7 +1355,7 @@
///
/// Check that the given undirected graph is tree.
/// \param graph The undirected graph.
- /// \return %True when the graph is acyclic and connected.
+ /// \return \c true when the graph is acyclic and connected.
template
bool tree(const Graph& graph) {
checkConcept();
@@ -1448,7 +1448,7 @@
/// The function checks if the given undirected \c graph graph is bipartite
/// or not. The \ref Bfs algorithm is used to calculate the result.
/// \param graph The undirected graph.
- /// \return %True if \c graph is bipartite, %false otherwise.
+ /// \return \c true if \c graph is bipartite, \c false otherwise.
/// \sa bipartitePartitions
template
inline bool bipartite(const Graph &graph){
@@ -1489,7 +1489,7 @@
/// \param graph The undirected graph.
/// \retval partMap A writable bool map of nodes. It will be set as the
/// two partitions of the graph.
- /// \return %True if \c graph is bipartite, %false otherwise.
+ /// \return \c true if \c graph is bipartite, \c false otherwise.
template
inline bool bipartitePartitions(const Graph &graph, NodeMap &partMap){
using namespace _connectivity_bits;
diff --git a/lemon/core.h b/lemon/core.h
--- a/lemon/core.h
+++ b/lemon/core.h
@@ -1034,11 +1034,11 @@
///
///\sa findArc()
///\sa ArcLookUp, AllArcLookUp, DynArcLookUp
- template
- class ConArcIt : public _Graph::Arc {
+ template
+ class ConArcIt : public GR::Arc {
public:
- typedef _Graph Graph;
+ typedef GR Graph;
typedef typename Graph::Arc Parent;
typedef typename Graph::Arc Arc;
@@ -1157,11 +1157,11 @@
///\endcode
///
///\sa findEdge()
- template
- class ConEdgeIt : public _Graph::Edge {
+ template
+ class ConEdgeIt : public GR::Edge {
public:
- typedef _Graph Graph;
+ typedef GR Graph;
typedef typename Graph::Edge Parent;
typedef typename Graph::Edge Edge;
@@ -1211,29 +1211,29 @@
///optimal time bound in a constant factor for any distribution of
///queries.
///
- ///\tparam G The type of the underlying digraph.
+ ///\tparam GR The type of the underlying digraph.
///
///\sa ArcLookUp
///\sa AllArcLookUp
- template
+ template
class DynArcLookUp
- : protected ItemSetTraits::ItemNotifier::ObserverBase
+ : protected ItemSetTraits::ItemNotifier::ObserverBase
{
public:
- typedef typename ItemSetTraits
+ typedef typename ItemSetTraits
::ItemNotifier::ObserverBase Parent;
- TEMPLATE_DIGRAPH_TYPEDEFS(G);
- typedef G Digraph;
+ TEMPLATE_DIGRAPH_TYPEDEFS(GR);
+ typedef GR Digraph;
protected:
- class AutoNodeMap : public ItemSetTraits::template Map::Type {
+ class AutoNodeMap : public ItemSetTraits::template Map::Type {
public:
- typedef typename ItemSetTraits::template Map::Type Parent;
+ typedef typename ItemSetTraits::template Map::Type Parent;
- AutoNodeMap(const G& digraph) : Parent(digraph, INVALID) {}
+ AutoNodeMap(const GR& digraph) : Parent(digraph, INVALID) {}
virtual void add(const Node& node) {
Parent::add(node);
@@ -1623,16 +1623,16 @@
///digraph changes. This is a time consuming (superlinearly proportional
///(O(m logm)) to the number of arcs).
///
- ///\tparam G The type of the underlying digraph.
+ ///\tparam GR The type of the underlying digraph.
///
///\sa DynArcLookUp
///\sa AllArcLookUp
- template
+ template
class ArcLookUp
{
public:
- TEMPLATE_DIGRAPH_TYPEDEFS(G);
- typedef G Digraph;
+ TEMPLATE_DIGRAPH_TYPEDEFS(GR);
+ typedef GR Digraph;
protected:
const Digraph &_g;
@@ -1733,20 +1733,20 @@
///digraph changes. This is a time consuming (superlinearly proportional
///(O(m logm)) to the number of arcs).
///
- ///\tparam G The type of the underlying digraph.
+ ///\tparam GR The type of the underlying digraph.
///
///\sa DynArcLookUp
///\sa ArcLookUp
- template
- class AllArcLookUp : public ArcLookUp
+ template
+ class AllArcLookUp : public ArcLookUp
{
- using ArcLookUp::_g;
- using ArcLookUp::_right;
- using ArcLookUp::_left;
- using ArcLookUp::_head;
+ using ArcLookUp::_g;
+ using ArcLookUp::_right;
+ using ArcLookUp::_left;
+ using ArcLookUp::_head;
- TEMPLATE_DIGRAPH_TYPEDEFS(G);
- typedef G Digraph;
+ TEMPLATE_DIGRAPH_TYPEDEFS(GR);
+ typedef GR Digraph;
typename Digraph::template ArcMap _next;
@@ -1773,7 +1773,7 @@
///
///It builds up the search database, which remains valid until the digraph
///changes.
- AllArcLookUp(const Digraph &g) : ArcLookUp(g), _next(g) {refreshNext();}
+ AllArcLookUp(const Digraph &g) : ArcLookUp(g), _next(g) {refreshNext();}
///Refresh the data structure at a node.
@@ -1783,7 +1783,7 @@
///the number of the outgoing arcs of \c n.
void refresh(Node n)
{
- ArcLookUp::refresh(n);
+ ArcLookUp