ScaleWriteMap

Declared in lemon/maps.h, in the group Map Adaptors; the same class on the Doxygen site.

template< typename M , typename C = typename M::Value >
class ScaleWriteMap : public MapBase< M::Key , M::Value >

Scales a map with a constant (read-write version).

This read-write map returns the value of the given map multiplied from the left side with a constant value. Its Key and Value are inherited from M. It can also be used as write map if the / operator is defined between Value and C and the given multiplier is not zero.

The simplest way of using this map is through the scaleWriteMap() function.

See also

ScaleMap

Public Types

typedef M::Key Key

typedef M::Value Value

Public Functions

inline ScaleWriteMap( M & m , const C & v )

Constructor.

Parameters:
  • m – The undelying map.

  • v – The constant value.

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

inline void set( const Key & k , const Value & v )