1 #ifndef NPSTAT_SIMPLEFUNCTORS_HH_ 2 #define NPSTAT_SIMPLEFUNCTORS_HH_ 17 template <
typename Result>
27 template <
typename Result,
typename Arg1>
34 virtual Result
operator()(
const Arg1&)
const = 0;
38 template <
typename Result,
typename Arg1,
typename Arg2>
46 virtual Result
operator()(
const Arg1&,
const Arg2&)
const = 0;
50 template <
typename Result,
typename Arg1,
typename Arg2,
typename Arg3>
59 virtual Result
operator()(
const Arg1&,
const Arg2&,
const Arg3&)
const=0;
63 template <
typename Result>
66 inline Result
operator()(
const Result&
a)
const override {
return a;}
70 template <
typename Result>
80 template <
typename Result>
90 template <
typename Result,
typename Arg1>
93 inline Result
operator()(
const Arg1&)
const {
return Result();}
100 template <
typename Result,
typename Arg1,
typename Arg2>
111 template <
typename Result,
typename Arg1,
typename Arg2,
typename Arg3>
114 inline Result
operator()(
const Arg1&,
const Arg2&,
const Arg3&)
const 122 template <
typename Result,
typename Arg1,
typename CastType>
126 {
return Result(static_cast<CastType>(a));}
133 template <
typename Result>
149 template <
typename Result,
typename Arg1>
158 Result (*fcn_)(Arg1);
165 template <
typename Result,
typename Arg1,
typename Arg2>
175 Result (*fcn_)(Arg1, Arg2);
182 template <
typename Result,
typename Arg1,
typename Arg2,
typename Arg3>
187 inline Result
operator()(
const Arg1&x,
const Arg2&y,
const Arg3&z)
const 188 {
return fcn_(x, y, z);}
192 Result (*fcn_)(Arg1, Arg2, Arg3);
199 template <
class Container,
class Result =
typename Container::value_type>
215 template <
class Container,
class Result =
typename Container::value_type>
231 template <
typename T1,
typename T2>
235 {
return left = right;}
242 template <
typename T1,
typename T2>
246 {
return right = left;}
250 template <
typename T1,
typename T2>
254 {
return left += right;}
258 template <
typename T1,
typename T2>
262 {
return right += left;}
269 template <
typename T1,
typename T2>
275 {
return left += w_*right;}
286 template <
typename T1,
typename T2>
292 {
return right += w_*left;}
300 template <
typename T1,
typename T2>
304 {
return left -= right;}
308 template <
typename T1,
typename T2>
312 {
return right -= left;}
316 template <
typename T1,
typename T2>
320 {
return left *= right;}
324 template <
typename T1,
typename T2>
328 {
return right *= left;}
332 template <
typename T1,
typename T2>
336 {
return left /= right;}
340 template <
typename T1,
typename T2>
344 {
return right /= left;}
348 template <
typename T1,
typename T2>
352 C(T1()), leftZero(T1()), rightZero(T2()) {}
354 C(value), leftZero(T1()), rightZero(T2()) {}
358 if (right == rightZero)
359 if (left == leftZero)
364 return left /= right;
374 template <
typename T1,
typename T2>
378 C(T2()), leftZero(T1()), rightZero(T2()) {}
380 C(value), leftZero(T1()), rightZero(T2()) {}
384 if (left == leftZero)
385 if (right == rightZero)
390 return right /= left;
400 template <
typename T1,
typename T2,
typename T3=T1>
404 {
return left =
static_cast<T3
>(right);}
408 template <
typename T1,
typename T2,
typename T3=T2>
412 {
return right =
static_cast<T3
>(left);}
416 template <
typename T1,
typename T2,
typename T3=T1>
420 {
return left +=
static_cast<T3
>(right);}
424 template <
typename T1,
typename T2,
typename T3=T2>
428 {
return right +=
static_cast<T3
>(left);}
432 template <
typename T1,
typename T2,
typename T3=T1>
436 {
return left -=
static_cast<T3
>(right);}
440 template <
typename T1,
typename T2,
typename T3=T2>
444 {
return right -=
static_cast<T3
>(left);}
448 #endif // NPSTAT_SIMPLEFUNCTORS_HH_
virtual Result operator()() const =0
addmul_left(const double weight)
diveq_right_0by0isC(const T2 &value)
T2 & operator()(const T1 &left, T2 &right) const
Result operator()() const
T1 & operator()(T1 &left, const T2 &right) const
T2 & operator()(const T1 &left, T2 &right) const
Result operator()(const Arg1 &) const
T2 & operator()(const T1 &left, T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const
T2 & operator()(const T1 &left, T2 &right) const
Arg2 second_argument_type
Element1D(const unsigned long index)
diveq_left_0by0isC(const T1 &value)
Result operator()(const Arg1 &x, const Arg2 &y, const Arg3 &z) const
Result operator()(const Container &c) const
Arg2 second_argument_type
T2 & operator()(const T1 &left, T2 &right) const
Result operator()(const Arg1 &, const Arg2 &, const Arg3 &) const
Result operator()(const Arg1 &x, const Arg2 &y) const
FcnFunctor2(Result(*fcn)(Arg1, Arg2))
Result operator()(const Arg1 &, const Arg2 &) const
Result operator()(const Arg1 &a) const
Result operator()(const Arg1 &a) const
FcnFunctor3(Result(*fcn)(Arg1, Arg2, Arg3))
T1 & operator()(T1 &left, const T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const
FcnFunctor1(Result(*fcn)(Arg1))
T1 & operator()(T1 &left, const T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const
T2 & operator()(const T1 &left, T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const
void fcn(int &, double *, double &, double *, int)
T1 & operator()(T1 &left, const T2 &right) const
Result operator()() const
FcnFunctor0(Result(*fcn)())
const Result & operator()(const Result &a) const
Result operator()(const Result &a) const override
T1 & operator()(T1 &left, const T2 &right) const
T2 & operator()(const T1 &left, T2 &right) const
T2 & operator()(const T1 &left, T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const
addmul_right(const double weight)
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
Element1DAt(const unsigned long index)
T2 & operator()(const T1 &left, T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const
Result operator()(const Container &c) const