IterableIntMap< GR, K > Class Template Reference

- Main Page
- Modules
- Classes
- Namespaces
- Files
- Related Pages

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

## 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

  GR | The graph type.
  K | The key type of the map (`GR::Node`, `GR::Arc` or `GR::Edge`).

See Also
  IterableBoolMap, IterableValueMap
  CrossRefMap

`#include <lemon/maps.h>`

Inherits Type< GR, K >.

## 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 Value & | ConstReference
| The const reference type.

## Public Member Functions
| IterableIntMap (const Graph &graph)
| Constructor of the map. More...
| IterableIntMap (const Graph &graph, int value)
| Constructor of the map with a given value. More...
int | size () const
| Gives back the maximal value plus one. More...
void | set (const Key &key, const Value &value)
| Set operation of the map. More...
const Value & | operator[] (const Key &key) const
| Const subscript operator of the map. More...
Reference | operator[] (const Key &key)
| Subscript operator of the map. More...

## Constructor & Destructor Documentation

IterableIntMap | ( | const Graph & | graph | ) |
| inlineexplicit

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

IterableIntMap | ( | const Graph & | graph,
|  | int | value
| ) |  |
| inlineexplicit

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.