ShiftMap

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 ShiftMap : public MapBase< M::Key , M::Value >

Shifts a map with a constant.

This read-only map returns the sum of the given map and a constant value (i.e. it shifts the map with the constant). Its Key and Value are inherited from M.

Actually,

ShiftMap< M > sh( m , v );
is equivalent to
ConstMap< M::Key , M::Value > cm( v );
AddMap< M , ConstMap< M::Key , M::Value > > sh( m , cm );

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

See also

ShiftWriteMap

Public Types

typedef M::Key Key

typedef M::Value Value

Public Functions

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

Constructor.

Parameters:
  • m – The undelying map.

  • v – The constant value.

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