AbsMap< M > Class Template Reference
[Map Adaptors]
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 are 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);}
#include <lemon/maps.h>
List of all members.
|
Public Member Functions |
|
| AbsMap (const M &_m) |
| | Constructor.
|
|
Value | operator[] (Key k) const |
| |
|
Related Functions |
(Note that these are not member functions.)
|
| template<typename M > |
| AbsMap< M > | absMap (const M &m) |
| | Returns an AbsMap class.
|