diff -r f3717c08e2be -r 91eb70983697 src/lemon/concept/graph.h --- a/src/lemon/concept/graph.h Mon May 16 21:49:35 2005 +0000 +++ b/src/lemon/concept/graph.h Wed May 18 09:39:06 2005 +0000 @@ -36,61 +36,61 @@ /**************** The full-featured graph concepts ****************/ - /// \brief Modular builded static graph class. + /// \brief Modular static graph class. /// /// It should be the same as the \c StaticGraph class. class _StaticGraph : virtual public BaseGraphComponent, - public IterableGraphComponent, public MappableGraphComponent { + public IterableGraphComponent, public MappableGraphComponent { public: typedef BaseGraphComponent::Node Node; typedef BaseGraphComponent::Edge Edge; template struct Constraints { - void constraints() { - checkConcept(); - checkConcept(); - } + void constraints() { + checkConcept(); + checkConcept(); + } }; }; - /// \brief Modular builded extendable graph class. + /// \brief Modular extendable graph class. /// /// It should be the same as the \c ExtendableGraph class. class _ExtendableGraph : virtual public BaseGraphComponent, public _StaticGraph, - public ExtendableGraphComponent, public ClearableGraphComponent { + public ExtendableGraphComponent, public ClearableGraphComponent { public: typedef BaseGraphComponent::Node Node; typedef BaseGraphComponent::Edge Edge; template struct Constraints { - void constraints() { - checkConcept<_StaticGraph, _Graph >(); - checkConcept(); - checkConcept(); - } + void constraints() { + checkConcept<_StaticGraph, _Graph >(); + checkConcept(); + checkConcept(); + } }; }; - /// \brief Modular builded erasable graph class. + /// \brief Modular erasable graph class. /// /// It should be the same as the \c ErasableGraph class. class _ErasableGraph : virtual public BaseGraphComponent, public _ExtendableGraph, - public ErasableGraphComponent { + public ErasableGraphComponent { public: typedef BaseGraphComponent::Node Node; typedef BaseGraphComponent::Edge Edge; template struct Constraints { - void constraints() { - checkConcept<_ExtendableGraph, _Graph >(); - checkConcept(); - } + void constraints() { + checkConcept<_ExtendableGraph, _Graph >(); + checkConcept(); + } }; }; @@ -135,33 +135,33 @@ /// from the trivial node iterator. class Node { public: - /// Default constructor + /// Default constructor - /// @warning The default constructor sets the iterator - /// to an undefined value. - Node() { } - /// Copy constructor. + /// @warning The default constructor sets the iterator + /// to an undefined value. + Node() { } + /// Copy constructor. - /// Copy constructor. - /// - Node(const Node&) { } + /// Copy constructor. + /// + Node(const Node&) { } - /// Invalid constructor \& conversion. + /// Invalid constructor \& conversion. - /// This constructor initializes the iterator to be invalid. - /// \sa Invalid for more details. - Node(Invalid) { } - /// Equality operator + /// This constructor initializes the iterator to be invalid. + /// \sa Invalid for more details. + Node(Invalid) { } + /// Equality operator - /// Two iterators are equal if and only if they point to the - /// same object or both are invalid. - bool operator==(Node) const { return true; } + /// Two iterators are equal if and only if they point to the + /// same object or both are invalid. + bool operator==(Node) const { return true; } - /// Inequality operator - - /// \sa operator==(Node n) - /// - bool operator!=(Node) const { return true; } + /// Inequality operator + + /// \sa operator==(Node n) + /// + bool operator!=(Node) const { return true; } }; @@ -172,42 +172,42 @@ /// of nodes in graph \c g of type \c Graph like this: /// \code /// int count=0; - /// for (Graph::NodeIt n(g); n!=INVALID ++n) ++count; + /// for (Graph::NodeIt n(g); n!=INVALID; ++n) ++count; /// \endcode class NodeIt : public Node { public: - /// Default constructor + /// Default constructor - /// @warning The default constructor sets the iterator - /// to an undefined value. - NodeIt() { } - /// Copy constructor. - - /// Copy constructor. - /// - NodeIt(const NodeIt& n) : Node(n) { } - /// Invalid constructor \& conversion. + /// @warning The default constructor sets the iterator + /// to an undefined value. + NodeIt() { } + /// Copy constructor. + + /// Copy constructor. + /// + NodeIt(const NodeIt& n) : Node(n) { } + /// Invalid constructor \& conversion. - /// Initialize the iterator to be invalid. - /// \sa Invalid for more details. - NodeIt(Invalid) { } - /// Sets the iterator to the first node. + /// Initialize the iterator to be invalid. + /// \sa Invalid for more details. + NodeIt(Invalid) { } + /// Sets the iterator to the first node. - /// Sets the iterator to the first node of \c g. - /// - NodeIt(const StaticGraph&) { } - /// Node -> NodeIt conversion. + /// Sets the iterator to the first node of \c g. + /// + NodeIt(const StaticGraph&) { } + /// Node -> NodeIt conversion. - /// Sets the iterator to the node of \c g pointed by the trivial - /// iterator n. - /// This feature necessitates that each time we - /// iterate the edge-set, the iteration order is the same. - NodeIt(const StaticGraph& g, const Node& n) { } - /// Next node. + /// Sets the iterator to the node of \c g pointed by the trivial + /// iterator n. + /// This feature necessitates that each time we + /// iterate the edge-set, the iteration order is the same. + NodeIt(const StaticGraph& g, const Node& n) { } + /// Next node. - /// Assign the iterator to the next node. - /// - NodeIt& operator++() { return *this; } + /// Assign the iterator to the next node. + /// + NodeIt& operator++() { return *this; } }; @@ -217,31 +217,31 @@ /// class Edge { public: - /// Default constructor + /// Default constructor - /// @warning The default constructor sets the iterator - /// to an undefined value. - Edge() { } - /// Copy constructor. + /// @warning The default constructor sets the iterator + /// to an undefined value. + Edge() { } + /// Copy constructor. - /// Copy constructor. - /// - Edge(const Edge&) { } - /// Initialize the iterator to be invalid. + /// Copy constructor. + /// + Edge(const Edge&) { } + /// Initialize the iterator to be invalid. - /// Initialize the iterator to be invalid. - /// - Edge(Invalid) { } - /// Equality operator + /// Initialize the iterator to be invalid. + /// + Edge(Invalid) { } + /// Equality operator - /// Two iterators are equal if and only if they point to the - /// same object or both are invalid. - bool operator==(Edge) const { return true; } - /// Inequality operator + /// Two iterators are equal if and only if they point to the + /// same object or both are invalid. + bool operator==(Edge) const { return true; } + /// Inequality operator - /// \sa operator==(Node n) - /// - bool operator!=(Edge) const { return true; } + /// \sa operator==(Node n) + /// + bool operator!=(Edge) const { return true; } }; /// This iterator goes trough the outgoing edges of a node. @@ -258,39 +258,39 @@ class OutEdgeIt : public Edge { public: - /// Default constructor + /// Default constructor - /// @warning The default constructor sets the iterator - /// to an undefined value. - OutEdgeIt() { } - /// Copy constructor. + /// @warning The default constructor sets the iterator + /// to an undefined value. + OutEdgeIt() { } + /// Copy constructor. - /// Copy constructor. - /// - OutEdgeIt(const OutEdgeIt& e) : Edge(e) { } - /// Initialize the iterator to be invalid. + /// Copy constructor. + /// + OutEdgeIt(const OutEdgeIt& e) : Edge(e) { } + /// Initialize the iterator to be invalid. - /// Initialize the iterator to be invalid. - /// - OutEdgeIt(Invalid) { } - /// This constructor sets the iterator to first outgoing edge. + /// Initialize the iterator to be invalid. + /// + OutEdgeIt(Invalid) { } + /// This constructor sets the iterator to the first outgoing edge. - /// This constructor set the iterator to the first outgoing edge of - /// node - ///@param n the node - ///@param g the graph - OutEdgeIt(const StaticGraph&, const Node&) { } - /// Edge -> OutEdgeIt conversion + /// This constructor sets the iterator to the first outgoing edge of + /// the node. + ///@param n the node + ///@param g the graph + OutEdgeIt(const StaticGraph&, const Node&) { } + /// Edge -> OutEdgeIt conversion - /// Sets the iterator to the value of the trivial iterator \c e. - /// This feature necessitates that each time we - /// iterate the edge-set, the iteration order is the same. - OutEdgeIt(const StaticGraph& g, const Edge& e) { } - ///Next outgoing edge - - /// Assign the iterator to the next - /// outgoing edge of the corresponding node. - OutEdgeIt& operator++() { return *this; } + /// Sets the iterator to the value of the trivial iterator \c e. + /// This feature necessitates that each time we + /// iterate the edge-set, the iteration order is the same. + OutEdgeIt(const StaticGraph& g, const Edge& e) { } + ///Next outgoing edge + + /// Assign the iterator to the next + /// outgoing edge of the corresponding node. + OutEdgeIt& operator++() { return *this; } }; /// This iterator goes trough the incoming edges of a node. @@ -307,39 +307,39 @@ class InEdgeIt : public Edge { public: - /// Default constructor + /// Default constructor - /// @warning The default constructor sets the iterator - /// to an undefined value. - InEdgeIt() { } - /// Copy constructor. + /// @warning The default constructor sets the iterator + /// to an undefined value. + InEdgeIt() { } + /// Copy constructor. - /// Copy constructor. - /// - InEdgeIt(const InEdgeIt& e) : Edge(e) { } - /// Initialize the iterator to be invalid. + /// Copy constructor. + /// + InEdgeIt(const InEdgeIt& e) : Edge(e) { } + /// Initialize the iterator to be invalid. - /// Initialize the iterator to be invalid. - /// - InEdgeIt(Invalid) { } - /// This constructor sets the iterator to first incoming edge. + /// Initialize the iterator to be invalid. + /// + InEdgeIt(Invalid) { } + /// This constructor sets the iterator to first incoming edge. - /// This constructor set the iterator to the first incoming edge of - /// node - ///@param n the node - ///@param g the graph - InEdgeIt(const StaticGraph&, const Node&) { } - /// Edge -> InEdgeIt conversion + /// This constructor set the iterator to the first incoming edge of + /// the node. + ///@param n the node + ///@param g the graph + InEdgeIt(const StaticGraph&, const Node&) { } + /// Edge -> InEdgeIt conversion - /// Sets the iterator to the value of the trivial iterator \c e. - /// This feature necessitates that each time we - /// iterate the edge-set, the iteration order is the same. - InEdgeIt(const StaticGraph&, const Edge&) { } - /// Next incoming edge + /// Sets the iterator to the value of the trivial iterator \c e. + /// This feature necessitates that each time we + /// iterate the edge-set, the iteration order is the same. + InEdgeIt(const StaticGraph&, const Edge&) { } + /// Next incoming edge - /// Assign the iterator to the next inedge of the corresponding node. - /// - InEdgeIt& operator++() { return *this; } + /// Assign the iterator to the next inedge of the corresponding node. + /// + InEdgeIt& operator++() { return *this; } }; /// This iterator goes through each edge. @@ -352,38 +352,36 @@ /// \endcode class EdgeIt : public Edge { public: - /// Default constructor + /// Default constructor - /// @warning The default constructor sets the iterator - /// to an undefined value. - EdgeIt() { } - /// Copy constructor. + /// @warning The default constructor sets the iterator + /// to an undefined value. + EdgeIt() { } + /// Copy constructor. - /// Copy constructor. - /// - EdgeIt(const EdgeIt& e) : Edge(e) { } - /// Initialize the iterator to be invalid. + /// Copy constructor. + /// + EdgeIt(const EdgeIt& e) : Edge(e) { } + /// Initialize the iterator to be invalid. - /// Initialize the iterator to be invalid. - /// - EdgeIt(Invalid) { } - /// This constructor sets the iterator to first edge. + /// Initialize the iterator to be invalid. + /// + EdgeIt(Invalid) { } + /// This constructor sets the iterator to the first edge. - /// This constructor set the iterator to the first edge of - /// node - ///@param g the graph - EdgeIt(const StaticGraph&) { } - /// Edge -> EdgeIt conversion + /// This constructor sets the iterator to the first edge of \c g. + ///@param g the graph + EdgeIt(const StaticGraph&) { } + /// Edge -> EdgeIt conversion - /// Sets the iterator to the value of the trivial iterator \c e. - /// This feature necessitates that each time we - /// iterate the edge-set, the iteration order is the same. - EdgeIt(const StaticGraph&, const Edge&) { } - ///Next edge - - /// Assign the iterator to the next - /// edge of the corresponding node. - EdgeIt& operator++() { return *this; } + /// Sets the iterator to the value of the trivial iterator \c e. + /// This feature necessitates that each time we + /// iterate the edge-set, the iteration order is the same. + EdgeIt(const StaticGraph&, const Edge&) { } + ///Next edge + + /// Assign the iterator to the next edge. + EdgeIt& operator++() { return *this; } }; ///Gives back the target node of an edge. @@ -407,16 +405,16 @@ { public: - ///\e - NodeMap(const StaticGraph&) { } - ///\e - NodeMap(const StaticGraph&, T) { } + ///\e + NodeMap(const StaticGraph&) { } + ///\e + NodeMap(const StaticGraph&, T) { } - ///Copy constructor - NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { } - ///Assignment operator - NodeMap& operator=(const NodeMap&) { return *this; } - // \todo fix this concept + ///Copy constructor + NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { } + ///Assignment operator + NodeMap& operator=(const NodeMap&) { return *this; } + // \todo fix this concept }; /// Read write map of the edges to type \c T. @@ -431,15 +429,15 @@ { public: - ///\e - EdgeMap(const StaticGraph&) { } - ///\e - EdgeMap(const StaticGraph&, T) { } - ///Copy constructor - EdgeMap(const EdgeMap& em) : ReadWriteMap(em) { } - ///Assignment operator - EdgeMap& operator=(const EdgeMap&) { return *this; } - // \todo fix this concept + ///\e + EdgeMap(const StaticGraph&) { } + ///\e + EdgeMap(const StaticGraph&, T) { } + ///Copy constructor + EdgeMap(const EdgeMap& em) : ReadWriteMap(em) { } + ///Assignment operator + EdgeMap& operator=(const EdgeMap&) { return *this; } + // \todo fix this concept }; template @@ -449,9 +447,8 @@ /// An empty non-static graph class. - /// This class provides everything that \ref StaticGraph - /// with additional functionality which enables to build a - /// graph from scratch. + /// This class provides everything that \ref StaticGraph does. + /// Additionally it enables building graphs from scratch. class ExtendableGraph : public StaticGraph { public: @@ -486,7 +483,7 @@ /// An empty erasable graph class. - /// This class is an extension of \ref ExtendableGraph. It also makes it + /// This class is an extension of \ref ExtendableGraph. It makes it /// possible to erase edges or nodes. class ErasableGraph : public ExtendableGraph {