39 public binary_function< T, T, bool >
50 return ( std::abs(a - b) <
epsilon || (std::abs(a - b) / max(std::abs(a), std::abs(b))) <
epsilon ) ;
55 template <
typename T >
61 return abs( arg1 - arg2 );
66 template<
class IT,
class NT>
68 public binary_function< tuple<IT, IT, NT>, tuple<IT, IT, NT>, bool >
70 inline bool operator()(
const tuple<IT, IT, NT> & lhs,
const tuple<IT, IT, NT> & rhs)
const
72 return ( (get<0>(lhs) == get<0>(rhs)) && (get<1>(lhs) == get<1>(rhs)) );
82 template <
class IT,
class NT>
84 public binary_function< tuple<IT, IT, NT>, tuple<IT, IT, NT>, bool >
86 inline bool operator()(
const tuple<IT, IT, NT> & lhs,
const tuple<IT, IT, NT> & rhs)
const
88 if(get<1>(lhs) == get<1>(rhs))
90 return get<0>(lhs) < get<0>(rhs);
94 return get<1>(lhs) < get<1>(rhs);
99 template <
class IT,
class NT>
101 public binary_function< tuple<IT, IT, NT>, tuple<IT, IT, NT>, bool >
103 inline bool operator()(
const tuple<IT, IT, NT> & lhs,
const tuple<IT, IT, NT> & rhs)
const
105 if(get<0>(lhs) == get<0>(rhs))
107 return get<1>(lhs) < get<1>(rhs);
111 return get<0>(lhs) < get<0>(rhs);
118 template <
class IT,
class NT>
120 public binary_function< tuple<IT, IT, NT>, tuple<IT, IT, NT>, bool >
122 inline bool operator()(
const tuple<IT, IT, NT> & lhs,
const tuple<IT, IT, NT> & rhs)
const
124 return get<1>(lhs) < get<1>(rhs);
129 template <
class IT,
class NT>
131 public binary_function< tuple<IT, IT, NT>, tuple<IT, IT, NT>, bool >
133 inline bool operator()(
const tuple<IT, IT, NT> & lhs,
const tuple<IT, IT, NT> & rhs)
const
135 return get<0>(lhs) < get<0>(rhs);
139 template <
class IT,
class NT>
141 public binary_function< pair< tuple<IT, IT, NT> , int > , pair< tuple<IT, IT, NT> , int>, bool >
143 inline bool operator()(
const pair< tuple<IT, IT, NT> ,
int > & lhs,
const pair< tuple<IT, IT, NT> ,
int > & rhs)
const
145 if(get<1>(lhs.first) == get<1>(rhs.first))
147 return get<0>(lhs.first) < get<0>(rhs.first);
151 return get<1>(lhs.first) < get<1>(rhs.first);