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

Detailed Description

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

This class provides a special graph map type which can store a bool value for graph items (Node, Arc or Edge). For both true and false values it is possible to iterate on the keys mapped to the value.

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

Template Parameters
GRThe graph type.
KThe key type of the map (GR::Node, GR::Arc or GR::Edge).
See Also
IterableIntMap, IterableValueMap
CrossRefMap

#include <lemon/maps.h>

Inherits Type< GR, K >.

Classes

class  FalseIt
 Iterator for the keys mapped to false. More...
 
class  ItemIt
 Iterator for the keys mapped to a given value. More...
 
class  Reference
 Reference to the value of the map. More...
 
class  TrueIt
 Iterator for the keys mapped to true. More...
 

Public Types

typedef True ReferenceMapTag
 Indicates that the map is reference map.
 
typedef K Key
 The key type.
 
typedef bool Value
 The value type.
 
typedef const ValueConstReference
 The const reference type.
 

Public Member Functions

 IterableBoolMap (const Graph &graph, bool def=false)
 Constructor of the map with a default value. More...
 
bool operator[] (const Key &key) const
 Const subscript operator of the map. More...
 
Reference operator[] (const Key &key)
 Subscript operator of the map. More...
 
void set (const Key &key, bool value)
 Set operation of the map. More...
 
void setAll (bool value)
 Set all items. More...
 
int trueNum () const
 Returns the number of the keys mapped to true. More...
 
int falseNum () const
 Returns the number of the keys mapped to false. More...
 

Constructor & Destructor Documentation

IterableBoolMap ( const Graph &  graph,
bool  def = false 
)
inlineexplicit

Constructor of the map with a default value.

Member Function Documentation

bool operator[] ( const Key key) const
inline

Const subscript operator of the map.

Reference operator[] ( const Key key)
inline

Subscript operator of the map.

void set ( const Key key,
bool  value 
)
inline

Set operation of the map.

void setAll ( bool  value)
inline

Set all items in the map.

Note
Constant time operation.
int trueNum ( ) const
inline

Returns the number of the keys mapped to true.

int falseNum ( ) const
inline

Returns the number of the keys mapped to false.