AbsMap Class Template Reference
[Map Adaptors]

#include <lemon/maps.h>

Inherits MapBase< M::Key, M::Value >.

Inheritance diagram for AbsMap:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename M>
class lemon::AbsMap< M >

This read only map returns the absolute value of the value returned by the given map. Its Key and Value will be inherited from M. Value must be comparable to 0 and the unary - operator must be defined for it, of course.

Bug:
We need a unified way to handle the situation below:
       struct _UnConvertible {};
       template<class A> inline A t_abs(A a) {return _UnConvertible();}
       template<> inline int t_abs<>(int n) {return abs(n);}
       template<> inline long int t_abs<>(long int n) {return labs(n);}
       template<> inline long long int t_abs<>(long long int n) {return ::llabs(n);}
       template<> inline float t_abs<>(float n) {return fabsf(n);}
       template<> inline double t_abs<>(double n) {return fabs(n);}
       template<> inline long double t_abs<>(long double n) {return fabsl(n);}


Public Member Functions

 AbsMap (const M &_m)
 Constructor.

Related Functions

(Note that these are not member functions.)

AbsMap< M > absMap (const M &m)
 Returns a AbsMap class.


The documentation for this class was generated from the following file:
Generated on Fri Feb 3 18:42:21 2006 for LEMON by  doxygen 1.4.6