Classes | Public Types | Public Member Functions

IterableIntMap< GR, K > Class Template Reference


Detailed Description

template<typename GR, typename K>
class lemon::IterableIntMap< GR, K >

This class provides a special graph map type which can store an integer value for graph items (Node, Arc or Edge). For each non-negative value it is possible to iterate on the keys mapped to the value.

This map is intended to be used with small integer values, for which it is efficient, and supports iteration only for non-negative values. If you need large values and/or iteration for negative integers, consider to use IterableValueMap instead.

This type is a reference map, so it can be modified with the subscript operator.

Note:
The size of the data structure depends on the largest value in the map.
Template Parameters:
GRThe graph type.
KThe key type of the map (GR::Node, GR::Arc or GR::Edge).
See also:
IterableBoolMap, IterableValueMap
CrossRefMap

#include <lemon/maps.h>

List of all members.

Classes

class  ItemIt
 Iterator for the keys with the same value. More...
class  Reference
 Reference to the value of the map. More...

Public Types

typedef K Key
 The key type.
typedef int Value
 The value type.
typedef GR Graph
 The graph type.
typedef True ReferenceMapTag
 Indicates that the map is reference map.
typedef const ValueConstReference
 The const reference type.

Public Member Functions

 IterableIntMap (const Graph &graph)
 Constructor of the map.
 IterableIntMap (const Graph &graph, int value)
int size () const
void set (const Key &key, const Value &value)
const Valueoperator[] (const Key &key) const
Reference operator[] (const Key &key)

Constructor & Destructor Documentation

IterableIntMap ( const Graph graph) [inline, explicit]

Constructor of the map. It sets all values to -1.

IterableIntMap ( const Graph graph,
int  value 
) [inline, explicit]

Constructor of the map with a given value.


Member Function Documentation

int size ( ) const [inline]

Gives back the maximal value plus one.

void set ( const Key key,
const Value value 
) [inline]

Set operation of the map.

const Value& operator[] ( const Key key) const [inline]

Const subscript operator of the map.

Reference operator[] ( const Key key) [inline]

Subscript operator of the map.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines