COIN-OR::LEMON - Graph Library

Changeset 2163:bef3457be038 in lemon-0.x


Ignore:
Timestamp:
07/24/06 18:08:34 (13 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2878
Message:

Improving UGraph and BpUGraph concept classes

Location:
lemon/concept
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/concept/bpugraph.h

    r2126 r2163  
    5656    ///
    5757    /// The bipartite graph stores two types of nodes which are named
    58     /// ANode and BNode. The graph type contains two types ANode and BNode
    59     /// which are inherited from Node type. Moreover they have
    60     /// constructor which converts Node to either ANode or BNode when it is
    61     /// possible. Therefor everywhere the Node type can be used instead of
    62     /// ANode and BNode. So the usage of the ANode and BNode is suggested. 
     58    /// ANode and BNode. The graph type contains two types ANode and
     59    /// BNode which are inherited from Node type. Moreover they have
     60    /// constructor which converts Node to either ANode or BNode when
     61    /// it is possible. Therefor everywhere the Node type can be used
     62    /// instead of ANode and BNode. So the usage of the ANode and
     63    /// BNode is not suggested.
    6364    ///
    6465    /// The iteration on the partition can be done with the ANodeIt and
     
    6970    class BpUGraph {
    7071    public:
    71       /// \todo undocumented
    72       ///
     72      /// \brief The undirected graph should be tagged by the
     73      /// UndirectedTag.
     74      ///
     75      /// The undirected graph should be tagged by the UndirectedTag. This
     76      /// tag helps the enable_if technics to make compile time
     77      /// specializations for undirected graphs. 
    7378      typedef True UndirectedTag;
    7479
     
    123128      };
    124129
    125       /// \brief The base type of anode iterators,
    126       /// or in other words, the trivial anode iterator.
    127       ///
    128       /// This is the base type of each anode iterator,
    129       /// thus each kind of anode iterator converts to this.
    130       /// More precisely each kind of node iterator should be inherited
    131       /// from the trivial anode iterator. The ANode class should be used
    132       /// only in special cases. Usually the Node type should be used insted
    133       /// of it.
     130      /// \brief Helper class for ANodes.
     131      ///
     132      /// This class is just a helper class for ANodes, it is not
     133      /// suggested to use it directly. It can be converted easily to
     134      /// node and vice versa. The usage of this class is limited
     135      /// two use just as template parameters for special map types.
    134136      class ANode {
    135137      public:
     
    180182      };
    181183
    182       /// \brief The base type of bnode iterators,
    183       /// or in other words, the trivial bnode iterator.
    184       ///
    185       /// This is the base type of each anode iterator,
    186       /// thus each kind of anode iterator converts to this.
    187       /// More precisely each kind of node iterator should be inherited
    188       /// from the trivial anode iterator. The BNode class should be used
    189       /// only in special cases. Usually the Node type should be used insted
    190       /// of it.
     184      /// \brief Helper class for BNodes.
     185      ///
     186      /// This class is just a helper class for BNodes, it is not
     187      /// suggested to use it directly. It can be converted easily to
     188      /// node and vice versa. The usage of this class is limited
     189      /// two use just as template parameters for special map types.
    191190      class BNode {
    192191      public:
     
    291290      /// for (Graph::ANodeIt n(g); n!=INVALID; ++n) ++count;
    292291      ///\endcode
    293       class ANodeIt : public ANode {
     292      class ANodeIt : public Node {
    294293      public:
    295294        /// Default constructor
     
    336335      /// for (Graph::BNodeIt n(g); n!=INVALID; ++n) ++count;
    337336      ///\endcode
    338       class BNodeIt : public BNode {
     337      class BNodeIt : public Node {
    339338      public:
    340339        /// Default constructor
     
    819818      ///
    820819      /// Direct the given undirected edge. The returned edge source
    821       /// will be the given edge.
     820      /// will be the given node.
    822821      Edge direct(const UEdge&, const Node&) const {
    823822        return INVALID;
     
    826825      /// \brief Direct the given undirected edge.
    827826      ///
    828       /// Direct the given undirected edge. The returned edge source
    829       /// will be the source of the undirected edge if the given bool
    830       /// is true.
     827      /// Direct the given undirected edge. The returned edge
     828      /// represents the given undireted edge and the direction comes
     829      /// from the given bool.  The source of the undirected edge and
     830      /// the directed edge is the same when the given bool is true.
    831831      Edge direct(const UEdge&, bool) const {
    832832        return INVALID;
     
    856856      ///
    857857      /// Returns whether the given directed edge is same orientation as
    858       /// the corresponding undirected edge.
     858      /// the corresponding undirected edge's default orientation.
    859859      bool direction(Edge) const { return true; }
    860860
     
    866866      /// \brief Opposite node on an edge
    867867      ///
    868       /// \return the opposite of the given Node on the given Edge
     868      /// \return the opposite of the given Node on the given UEdge
    869869      Node oppositeNode(Node, UEdge) const { return INVALID; }
    870870
     
    873873      /// \return the first node of the given UEdge.
    874874      ///
    875       /// Naturally uectected edges don't have direction and thus
     875      /// Naturally undirected edges don't have direction and thus
    876876      /// don't have source and target node. But we use these two methods
    877877      /// to query the two endnodes of the edge. The direction of the edge
  • lemon/concept/ugraph.h

    r2126 r2163  
    3636
    3737
    38     /// Class describing the concept of Undirected Graphs.
    39 
     38    /// \brief Class describing the concept of Undirected Graphs.
     39    ///
    4040    /// This class describes the common interface of all Undirected
    4141    /// Graphs.
     
    4444    /// without any sensible implementation. So any algorithm for
    4545    /// undirected graph should compile with this class, but it will not
    46     /// run properly, of couse.
     46    /// run properly, of course.
    4747    ///
    48     /// In LEMON undirected graphs also fulfill the concept of directed
    49     /// graphs (\ref lemon::concept::Graph "Graph Concept"). For
    50     /// explanation of this and more see also the page \ref graphs,
    51     /// a tutorial about graphs.
     48    /// The LEMON undirected graphs also fulfill the concept of
     49    /// directed graphs (\ref lemon::concept::Graph "Graph
     50    /// Concept"). Each undirected edges can be seen as two opposite
     51    /// directed edge and consequently the undirected graph can be
     52    /// seen as the direceted graph of these directed edges. The
     53    /// UGraph has the UEdge inner class for the undirected edges and
     54    /// the Edge type for the directed edges. The Edge type is
     55    /// convertible to UEdge or inherited from it so from a directed
     56    /// edge we can get the represented undirected edge.
    5257    ///
    53     /// You can assume that all undirected graph can be handled
    54     /// as a directed graph. This way it is fully conform
    55     /// to the Graph concept.
    56 
     58    /// In the sense of the LEMON each undirected edge has a default
     59    /// direction (it should be in every computer implementation,
     60    /// because the order of undirected edge's nodes defines an
     61    /// orientation). With the default orientation we can define that
     62    /// the directed edge is forward or backward directed. With the \c
     63    /// direction() and \c direct() function we can get the direction
     64    /// of the directed edge and we can direct an undirected edge.
     65    ///
     66    /// The UEdgeIt is an iterator for the undirected edges. We can use
     67    /// the UEdgeMap to map values for the undirected edges. The InEdgeIt and
     68    /// OutEdgeIt iterates on the same undirected edges but with opposite
     69    /// direction. The IncEdgeIt iterates also on the same undirected edges
     70    /// as the OutEdgeIt and InEdgeIt but it is not convertible to Edge just
     71    /// to UEdge. 
    5772    class UGraph {
    5873    public:
    59       ///\e
    60 
    61       ///\todo undocumented
    62       ///
     74      /// \brief The undirected graph should be tagged by the
     75      /// UndirectedTag.
     76      ///
     77      /// The undirected graph should be tagged by the UndirectedTag. This
     78      /// tag helps the enable_if technics to make compile time
     79      /// specializations for undirected graphs. 
    6380      typedef True UndirectedTag;
    6481
     
    297314
    298315      /// The directed edge type. It can be converted to the
    299       /// undirected edge.
     316      /// undirected edge or it should be inherited from the undirected
     317      /// edge.
    300318      class Edge : public UEdge {
    301319      public:
     
    563581      ///
    564582      /// Direct the given undirected edge. The returned edge source
    565       /// will be the given edge.
     583      /// will be the given node.
    566584      Edge direct(const UEdge&, const Node&) const {
    567585        return INVALID;
     
    570588      /// \brief Direct the given undirected edge.
    571589      ///
    572       /// Direct the given undirected edge. The returned edge source
    573       /// will be the source of the undirected edge if the given bool
    574       /// is true.
     590      /// Direct the given undirected edge. The returned edge
     591      /// represents the given undireted edge and the direction comes
     592      /// from the given bool.  The source of the undirected edge and
     593      /// the directed edge is the same when the given bool is true.
    575594      Edge direct(const UEdge&, bool) const {
    576595        return INVALID;
     
    580599      ///
    581600      /// Returns whether the given directed edge is same orientation as
    582       /// the corresponding undirected edge.
     601      /// the corresponding undirected edge's default orientation.
    583602      bool direction(Edge) const { return true; }
    584603
     
    590609      /// \brief Opposite node on an edge
    591610      ///
    592       /// \return the opposite of the given Node on the given Edge
     611      /// \return the opposite of the given Node on the given UEdge
    593612      Node oppositeNode(Node, UEdge) const { return INVALID; }
    594613
     
    597616      /// \return the first node of the given UEdge.
    598617      ///
    599       /// Naturally uectected edges don't have direction and thus
     618      /// Naturally undirected edges don't have direction and thus
    600619      /// don't have source and target node. But we use these two methods
    601       /// to query the two endnodes of the edge. The direction of the edge
     620      /// to query the two nodes of the edge. The direction of the edge
    602621      /// which arises this way is called the inherent direction of the
    603622      /// undirected edge, and is used to define the "default" direction
Note: See TracChangeset for help on using the changeset viewer.