NegWriteMap

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

template< typename M >
class NegWriteMap : public MapBase< M::Key , M::Value >

Negative of a map (read-write version).

This read-write map returns the negative of the values of the given map (using the unary - operator). Its Key and Value are inherited from M. It makes also possible to write the map.

If M::Value is int, double etc., then

NegWriteMap< M > neg( m );
is equivalent to
ScaleWriteMap< M > neg( m , -1 );

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

See also

NegMap

Public Types

typedef M::Key Key

typedef M::Value Value

Public Functions

inline NegWriteMap( M & m )

Constructor.

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

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