FillBoolMap< Map > Class Template Reference
[Map Adaptors]


Detailed Description

template<typename Map>
class lemon::FillBoolMap< Map >

Writable bool map for filling each true assigned element with a given value. The value can set the container.

The following code finds the connected components of a graph and stores it in the comp map:

      typedef UGraph::NodeMap<int> ComponentMap;
      ComponentMap comp(ugraph);
      typedef FillBoolMap<UGraph::NodeMap<int> > ComponentFillerMap;
      ComponentFillerMap filler(comp, 0);
     
      Dfs<UGraph>::DefProcessedMap<ComponentFillerMap>::Create dfs(ugraph);
      dfs.processedMap(filler);
      dfs.init();
      for (NodeIt it(ugraph); it != INVALID; ++it) {
        if (!dfs.reached(it)) {
          dfs.addSource(it);
          dfs.start();
          ++filler.fillValue();
        }
      }
#include <lemon/maps.h>

List of all members.

Public Member Functions

 FillBoolMap (Map &_map, const typename Map::Value &_fill)
 Constructor.
 FillBoolMap (Map &_map)
 Constructor.
const Map::Value & fillValue () const
 Gives back the current fill value.
Map::Value & fillValue ()
 Gives back the current fill value.
void fillValue (const typename Map::Value &_fill)
 Sets the current fill value.
void set (const Key &key, Value value)
 The set function of the map.


Generated on Thu Jun 4 04:06:15 2009 for LEMON by  doxygen 1.5.9