All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
List of all members | Public Types | Public Member Functions
InDegMap< GR > Class Template Reference

Detailed Description

template<typename GR>
class lemon::InDegMap< GR >

This map returns the in-degree of a node. Once it is constructed, the degrees are stored in a standard NodeMap, so each query is done in constant time. On the other hand, the values are updated automatically whenever the digraph changes.

Warning
Besides addNode() and addArc(), a digraph structure may provide alternative ways to modify the digraph. The correct behavior of InDegMap is not guarantied if these additional features are used. For example, the functions changeSource(), changeTarget() and reverseArc() of ListDigraph will not update the degree values correctly.
See Also
OutDegMap

#include <lemon/maps.h>

Inherits ObserverBase< GR, GR::Arc >.

Public Types

typedef GR Graph
 The graph type of InDegMap.
 
typedef Digraph::Node Key
 The key type.
 
typedef int Value
 The value type.
 

Public Member Functions

 InDegMap (const Digraph &graph)
 Constructor. More...
 
int operator[] (const Key &key) const
 Gives back the in-degree of a Node. More...
 

Constructor & Destructor Documentation

InDegMap ( const Digraph &  graph)
inlineexplicit

Constructor for creating an in-degree map.

Member Function Documentation

int operator[] ( const Key key) const
inline

Gives back the in-degree of a Node.