src/lemon/smart_graph.h
changeset 977 48962802d168
parent 974 785062a83f8e
child 980 0f1044b7a3af
equal deleted inserted replaced
7:c682ef4702ec 8:fb3ca6b0f1a7
    25 
    25 
    26 #include <lemon/invalid.h>
    26 #include <lemon/invalid.h>
    27 
    27 
    28 #include <lemon/clearable_graph_extender.h>
    28 #include <lemon/clearable_graph_extender.h>
    29 #include <lemon/extendable_graph_extender.h>
    29 #include <lemon/extendable_graph_extender.h>
    30 
       
    31 #include <lemon/idmappable_graph_extender.h>
    30 #include <lemon/idmappable_graph_extender.h>
    32 
       
    33 #include <lemon/iterable_graph_extender.h>
    31 #include <lemon/iterable_graph_extender.h>
    34 
       
    35 #include <lemon/alteration_observer_registry.h>
    32 #include <lemon/alteration_observer_registry.h>
    36 #include <lemon/default_map.h>
    33 #include <lemon/default_map.h>
    37 
    34 
    38 
    35 #include <lemon/utility.h>
    39 #include <lemon/graph_utils.h>
       
    40 
       
    41 
    36 
    42 namespace lemon {
    37 namespace lemon {
    43 
    38 
    44   /// \addtogroup graphs
    39   /// \addtogroup graphs
    45   /// @{
    40   /// @{
    82   public:
    77   public:
    83 
    78 
    84     SmartGraphBase() : nodes(), edges() { }
    79     SmartGraphBase() : nodes(), edges() { }
    85     SmartGraphBase(const SmartGraphBase &_g) : nodes(_g.nodes), edges(_g.edges) { }
    80     SmartGraphBase(const SmartGraphBase &_g) : nodes(_g.nodes), edges(_g.edges) { }
    86     
    81     
       
    82     typedef True NodeNumTag;
       
    83     typedef True EdgeNumTag;
       
    84 
    87     ///Number of nodes.
    85     ///Number of nodes.
    88     int nodeNum() const { return nodes.size(); }
    86     int nodeNum() const { return nodes.size(); }
    89     ///Number of edges.
    87     ///Number of edges.
    90     int edgeNum() const { return edges.size(); }
    88     int edgeNum() const { return edges.size(); }
    91 
    89 
   321 	nodes.pop_back();
   319 	nodes.pop_back();
   322       }
   320       }
   323     }
   321     }
   324   };
   322   };
   325   
   323   
   326   template <>
       
   327   int countNodes<SmartGraph>(const SmartGraph& graph) {
       
   328     return graph.nodeNum();
       
   329   }
       
   330 
       
   331   template <>
       
   332   int countEdges<SmartGraph>(const SmartGraph& graph) {
       
   333     return graph.edgeNum();
       
   334   }
       
   335 
       
   336   /// @}  
   324   /// @}  
   337 } //namespace lemon
   325 } //namespace lemon
   338 
   326 
   339 
   327 
   340 
       
   341 
       
   342 #endif //LEMON_SMART_GRAPH_H
   328 #endif //LEMON_SMART_GRAPH_H