COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
12/06/04 01:30:44 (15 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1420
Message:

Undirected graph documentation and concept refinements.

  • quite a few bug fixes
  • concept::UndirGraph? is almost complete and looks quite good.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/concept/graph_component.h

    r1022 r1030  
    1515 */
    1616
    17 ///\ingroup concept
     17///\ingroup graph_concepts
    1818///\file
    1919///\brief The graph components.
     
    2929  namespace concept {
    3030
     31    /// \addtogroup graph_concepts
     32    /// @{
    3133
    3234    /****************   Graph iterator concepts   ****************/
    3335
    34     /// Skeleton class for graph Node and Edge
    35 
    36     /// \note Because Node and Edge are forbidden to inherit from the same
    37     /// base class, this is a template. For Node you should instantiate it
    38     /// with character 'n' and for Edge with 'e'.
    39 
    40     template<char _selector>
     36    /// Skeleton class for graph Node and Edge types
     37
     38    /// This class describes the interface of Node and Edge (and UndirEdge
     39    /// in undirected graphs) subtypes of graph types.
     40    ///
     41    /// \note This class is a template class so that we can use it to
     42    /// create graph skeleton classes. The reason for this is than Node
     43    /// and Edge types should \em not derive from the same base class.
     44    /// For Node you should instantiate it with character 'n' and for Edge
     45    /// with 'e'.
     46
     47#ifndef DOXYGEN
     48    template <char _selector = '0'>
     49#endif
    4150    class GraphItem {
    4251    public:
    4352      /// Default constructor.
    4453     
    45       /// @warning The default constructor sets the item
    46       /// to an undefined value.
     54      /// \warning The default constructor is not required to set
     55      /// the item to some well-defined value. So you should consider it
     56      /// as uninitialized.
    4757      GraphItem() {}
    4858      /// Copy constructor.
     
    7282      bool operator!=(GraphItem) const { return false; }
    7383
    74       // Technical requirement. Do we really need this?
    75       //      bool operator<(GraphItem) const { return false; }
    76 
     84      /// Artificial ordering operator.
     85
     86      /// To allow the use of graph descriptors as key type in std::map or
     87      /// similar associative container we require this.
     88      ///
     89      /// \note This operator only have to define some strict ordering of
     90      /// the items; this order has nothing to do with the iteration
     91      /// ordering of the items.
     92      ///
     93      /// \bug This is a technical requirement. Do we really need this?
     94      bool operator<(GraphItem) const { return false; }
    7795
    7896      template<typename _GraphItem>
     
    89107          b = (ia == ib) && (ia != ib);
    90108          b = (ia == INVALID) && (ib != INVALID);
     109          b = (ia < ib);
    91110        }
    92111
     
    95114      };
    96115    };
     116
     117    /// A type describing the concept of graph node
     118
     119    /// This is an instantiation of \ref GraphItem which can be used as a
     120    /// Node subtype in graph skeleton definitions
     121    typedef GraphItem<'n'> GraphNode;
     122
     123    /// A type describing the concept of graph edge
     124
     125    /// This is an instantiation of \ref GraphItem which can be used as a
     126    /// Edge subtype in graph skeleton definitions
     127    typedef GraphItem<'e'> GraphEdge;
     128
     129
     130    /**************** Basic features of graphs ****************/
    97131
    98132    /// An empty base graph class.
     
    630664
    631665
     666    /// Class describing the concept of graph maps
     667
     668    /// This class describes the common interface of the graph maps
     669    /// (NodeMap, EdgeMap), that is \ref maps "maps" which can be used to
     670    /// associate data to graph descriptors (nodes or edges).
    632671    template <typename Graph, typename Item, typename _Value>
    633672    class GraphMap : public ReadWriteMap<Item, _Value> {
     
    805844    };
    806845
     846    /// @}
     847
    807848  }
    808849
Note: See TracChangeset for help on using the changeset viewer.