lemon/static_graph.h
changeset 775 6cab2ab9d8e7
parent 774 f4b5c2d5449d
child 776 eff1caf6d32e
     1.1 --- a/lemon/static_graph.h	Tue Aug 25 13:58:43 2009 +0200
     1.2 +++ b/lemon/static_graph.h	Tue Aug 25 16:32:47 2009 +0200
     1.3 @@ -226,6 +226,24 @@
     1.4    typedef DigraphExtender<StaticDigraphBase> ExtendedStaticDigraphBase;
     1.5  
     1.6  
     1.7 +  /// \ingroup graphs
     1.8 +  ///
     1.9 +  /// \brief A static directed graph class.
    1.10 +  ///
    1.11 +  /// \ref StaticDigraph is a highly efficient digraph implementation,
    1.12 +  /// but it is fully static.
    1.13 +  /// It stores only two \c int values for each node and only four \c int
    1.14 +  /// values for each arc. Moreover it provides faster item iteration than
    1.15 +  /// \ref ListDigraph and \ref SmartDigraph, especially using \c OutArcIt
    1.16 +  /// iterators, since its arcs are stored in an appropriate order.
    1.17 +  /// However it only provides build() and clear() functions and does not
    1.18 +  /// support any other modification of the digraph.
    1.19 +  ///
    1.20 +  /// This type fully conforms to the \ref concepts::Digraph "Digraph concept".
    1.21 +  /// Most of its member functions and nested classes are documented
    1.22 +  /// only in the concept class.
    1.23 +  ///
    1.24 +  /// \sa concepts::Digraph
    1.25    class StaticDigraph : public ExtendedStaticDigraphBase {
    1.26    public:
    1.27  
    1.28 @@ -233,6 +251,37 @@
    1.29    
    1.30    public:
    1.31    
    1.32 +    /// \brief Clear the digraph.
    1.33 +    ///
    1.34 +    /// This function erases all nodes and arcs from the digraph.
    1.35 +    void clear() {
    1.36 +      Parent::clear();
    1.37 +    }
    1.38 +    
    1.39 +    /// \brief Build the digraph copying another digraph.
    1.40 +    ///
    1.41 +    /// This function builds the digraph copying another digraph of any
    1.42 +    /// kind. It can be called more than once, but in such case, the whole
    1.43 +    /// structure and all maps will be cleared and rebuilt.
    1.44 +    ///
    1.45 +    /// This method also makes possible to copy a digraph to a StaticDigraph
    1.46 +    /// structure using \ref DigraphCopy.
    1.47 +    /// 
    1.48 +    /// \param digraph An existing digraph to be copied.
    1.49 +    /// \param nodeRef The node references will be copied into this map.
    1.50 +    /// Its key type must be \c Digraph::Node and its value type must be
    1.51 +    /// \c StaticDigraph::Node.
    1.52 +    /// It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap"
    1.53 +    /// concept.
    1.54 +    /// \param arcRef The arc references will be copied into this map.
    1.55 +    /// Its key type must be \c Digraph::Arc and its value type must be
    1.56 +    /// \c StaticDigraph::Arc.
    1.57 +    /// It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    1.58 +    ///
    1.59 +    /// \note If you do not need the arc references, then you could use
    1.60 +    /// \ref NullMap for the last parameter. However the node references
    1.61 +    /// are required by the function itself, thus they must be readable
    1.62 +    /// from the map.
    1.63      template <typename Digraph, typename NodeRefMap, typename ArcRefMap>
    1.64      void build(const Digraph& digraph, NodeRefMap& nodeRef, ArcRefMap& arcRef) {
    1.65        if (built) Parent::clear();