21 #ifndef CPPNAM_UTIL_COMPARISON_HPP 22 #define CPPNAM_UTIL_COMPARISON_HPP 39 template <
int Threshold,
typename F>
70 return make_comperator<Threshold, F>(
f,
f(t1, t2));
72 return make_comperator<Threshold, F>(
f,
res);
81 template <
int Threshold,
typename F>
88 static auto smaller(
const T &t1,
const T &t2)
90 return make_comperator<1>([](
const T &t1,
const T &t2) {
91 return (t1 < t2) ? 1 : ((t1 == t2) ? 0 : -1);
97 return make_comperator<0>([](
const T &t1,
const T &t2) {
98 return (t1 < t2) ? 1 : ((t1 == t2) ? 0 : -1);
102 static auto larger(
const T &t1,
const T &t2)
104 return make_comperator<1>([](
const T &t1,
const T &t2) {
105 return (t1 > t2) ? 1 : ((t1 == t2) ? 0 : -1);
111 return make_comperator<0>([](
const T &t1,
const T &t2) {
112 return (t1 > t2) ? 1 : ((t1 == t2) ? 0 : -1);
116 static auto equals(
const T &t1,
const T &t2)
118 return make_comperator<0>([](
const T &t1,
const T &t2) {
119 return (t1 == t2) ? 0 : -1;
125 return make_comperator<1>([](
const T &t1,
const T &t2) {
126 return (t1 != t2) ? 1 : 0;
static auto smaller_equals(const T &t1, const T &t2)
Definition: comperator.hpp:95
static auto larger(const T &t1, const T &t2)
Definition: comperator.hpp:102
const int res
Definition: comperator.hpp:49
static auto equals(const T &t1, const T &t2)
Definition: comperator.hpp:116
bool operator()() const
Definition: comperator.hpp:78
static ComperatorFunctor< Threshold, F > make_comperator(const F &f, int res=0)
Definition: comperator.hpp:82
static auto smaller(const T &t1, const T &t2)
Definition: comperator.hpp:88
ComperatorFunctor(const F &f, int res=0)
Definition: comperator.hpp:57
const F & f
Definition: comperator.hpp:44
Definition: comperator.hpp:40
Definition: brainscales_lib.hpp:39
ComperatorFunctor< Threshold, F > operator()(const T &t1, const T &t2) const
Definition: comperator.hpp:66
Definition: comperator.hpp:34
static auto inequal(const T &t1, const T &t2)
Definition: comperator.hpp:123
static auto larger_equals(const T &t1, const T &t2)
Definition: comperator.hpp:109