src/lemon/smart_graph.h
changeset 950 d74557d1f100
parent 946 c94ef40a22ce
child 959 c80ef5912903
equal deleted inserted replaced
2:4f6752134420 3:a8e507ed7db0
    43 namespace lemon {
    43 namespace lemon {
    44 
    44 
    45   /// \addtogroup graphs
    45   /// \addtogroup graphs
    46   /// @{
    46   /// @{
    47 
    47 
    48   ///A smart graph class.
       
    49 
       
    50   ///This is a simple and fast graph implementation.
       
    51   ///It is also quite memory efficient, but at the price
       
    52   ///that <b> it does not support node and edge deletion</b>.
       
    53   ///It conforms to 
       
    54   ///the \ref skeleton::ExtendableGraph "ExtendableGraph" concept.
       
    55   ///\sa skeleton::ExtendableGraph.
       
    56   ///
       
    57   ///\todo Some member functions could be \c static.
       
    58   ///
       
    59   ///\todo A possibly useful functionality: a function saveState() would
       
    60   ///give back a data sturcture X and then the function restoreState(X)
       
    61   ///would remove the nodes and edges added after the call of saveState().
       
    62   ///Of course it should be used as a stack. (Maybe X is not necessary.)
       
    63   ///
       
    64   ///\author Alpar Juttner
       
    65   class SmartGraphBase {
    48   class SmartGraphBase {
    66 
    49 
    67     struct NodeT 
    50     struct NodeT 
    68     {
    51     {
    69       int first_in,first_out;      
    52       int first_in,first_out;      
   238   typedef IdMappableGraphExtender<IterableSmartGraphBase> IdMappableSmartGraphBase;
   221   typedef IdMappableGraphExtender<IterableSmartGraphBase> IdMappableSmartGraphBase;
   239   typedef DefaultMappableGraphExtender<IdMappableSmartGraphBase> MappableSmartGraphBase;
   222   typedef DefaultMappableGraphExtender<IdMappableSmartGraphBase> MappableSmartGraphBase;
   240   typedef ExtendableGraphExtender<MappableSmartGraphBase> ExtendableSmartGraphBase;
   223   typedef ExtendableGraphExtender<MappableSmartGraphBase> ExtendableSmartGraphBase;
   241   typedef ClearableGraphExtender<ExtendableSmartGraphBase> ClearableSmartGraphBase;
   224   typedef ClearableGraphExtender<ExtendableSmartGraphBase> ClearableSmartGraphBase;
   242 
   225 
   243   typedef ClearableSmartGraphBase SmartGraph;
   226   ///A smart graph class.
   244 
   227 
   245 
   228   ///This is a simple and fast graph implementation.
       
   229   ///It is also quite memory efficient, but at the price
       
   230   ///that <b> it does not support node and edge deletion</b>.
       
   231   ///It conforms to 
       
   232   ///the \ref skeleton::ExtendableGraph "ExtendableGraph" concept.
       
   233   ///\sa skeleton::ExtendableGraph.
       
   234   ///
       
   235   ///\todo Some member functions could be \c static.
       
   236   ///
       
   237   ///\todo A possibly useful functionality: a function saveState()
       
   238   ///(or snapshot() ) would
       
   239   ///give back a data sturcture X and then the function restoreState(X)
       
   240   ///(or rollBack() )
       
   241   ///would remove the nodes and edges added after the call of saveState().
       
   242   ///Of course it should be used as a stack. (Maybe X is not necessary.)
       
   243   ///
       
   244   ///\author Alpar Juttner
       
   245   class SmartGraph :public ClearableSmartGraphBase { };
       
   246   
   246   template <>
   247   template <>
   247   int countNodes<SmartGraph>(const SmartGraph& graph) {
   248   int countNodes<SmartGraph>(const SmartGraph& graph) {
   248     return graph.nodeNum();
   249     return graph.nodeNum();
   249   }
   250   }
   250 
   251