COIN-OR::LEMON - Graph Library

Ticket #68: 68-3-6cab2ab9d8e7.patch

File 68-3-6cab2ab9d8e7.patch, 2.9 KB (added by Peter Kovacs, 15 years ago)
  • lemon/static_graph.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1251210767 -7200
    # Node ID 6cab2ab9d8e7df5a77ddbadbb4dabb920f9a913e
    # Parent  f4b5c2d5449d41268f349c0e86ca295896dbde4a
    Add documentation for StaticDigraph (#68)
    
    diff --git a/lemon/static_graph.h b/lemon/static_graph.h
    a b  
    226226  typedef DigraphExtender<StaticDigraphBase> ExtendedStaticDigraphBase;
    227227
    228228
     229  /// \ingroup graphs
     230  ///
     231  /// \brief A static directed graph class.
     232  ///
     233  /// \ref StaticDigraph is a highly efficient digraph implementation,
     234  /// but it is fully static.
     235  /// It stores only two \c int values for each node and only four \c int
     236  /// values for each arc. Moreover it provides faster item iteration than
     237  /// \ref ListDigraph and \ref SmartDigraph, especially using \c OutArcIt
     238  /// iterators, since its arcs are stored in an appropriate order.
     239  /// However it only provides build() and clear() functions and does not
     240  /// support any other modification of the digraph.
     241  ///
     242  /// This type fully conforms to the \ref concepts::Digraph "Digraph concept".
     243  /// Most of its member functions and nested classes are documented
     244  /// only in the concept class.
     245  ///
     246  /// \sa concepts::Digraph
    229247  class StaticDigraph : public ExtendedStaticDigraphBase {
    230248  public:
    231249
     
    233251 
    234252  public:
    235253 
     254    /// \brief Clear the digraph.
     255    ///
     256    /// This function erases all nodes and arcs from the digraph.
     257    void clear() {
     258      Parent::clear();
     259    }
     260   
     261    /// \brief Build the digraph copying another digraph.
     262    ///
     263    /// This function builds the digraph copying another digraph of any
     264    /// kind. It can be called more than once, but in such case, the whole
     265    /// structure and all maps will be cleared and rebuilt.
     266    ///
     267    /// This method also makes possible to copy a digraph to a StaticDigraph
     268    /// structure using \ref DigraphCopy.
     269    ///
     270    /// \param digraph An existing digraph to be copied.
     271    /// \param nodeRef The node references will be copied into this map.
     272    /// Its key type must be \c Digraph::Node and its value type must be
     273    /// \c StaticDigraph::Node.
     274    /// It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap"
     275    /// concept.
     276    /// \param arcRef The arc references will be copied into this map.
     277    /// Its key type must be \c Digraph::Arc and its value type must be
     278    /// \c StaticDigraph::Arc.
     279    /// It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     280    ///
     281    /// \note If you do not need the arc references, then you could use
     282    /// \ref NullMap for the last parameter. However the node references
     283    /// are required by the function itself, thus they must be readable
     284    /// from the map.
    236285    template <typename Digraph, typename NodeRefMap, typename ArcRefMap>
    237286    void build(const Digraph& digraph, NodeRefMap& nodeRef, ArcRefMap& arcRef) {
    238287      if (built) Parent::clear();