1 #ifndef NPSTAT_SIMPLEFUNCTORS_HH_ 2 #define NPSTAT_SIMPLEFUNCTORS_HH_ 17 template <
typename Result>
26 template <
typename Result,
typename Arg1>
32 virtual Result
operator()(
const Arg1&)
const = 0;
36 template <
typename Result,
typename Arg1,
typename Arg2>
43 virtual Result
operator()(
const Arg1&,
const Arg2&)
const = 0;
47 template <
typename Result,
typename Arg1,
typename Arg2,
typename Arg3>
55 virtual Result
operator()(
const Arg1&,
const Arg2&,
const Arg3&)
const = 0;
59 template <
typename Result>
61 inline Result
operator()(
const Result&
a)
const override {
return a; }
65 template <
typename Result>
67 inline const Result&
operator()(
const Result&
a)
const {
return a; }
74 template <
typename Result>
83 template <
typename Result,
typename Arg1>
85 inline Result
operator()(
const Arg1&)
const {
return Result(); }
92 template <
typename Result,
typename Arg1,
typename Arg2>
94 inline Result
operator()(
const Arg1&,
const Arg2&)
const {
return Result(); }
101 template <
typename Result,
typename Arg1,
typename Arg2,
typename Arg3>
103 inline Result
operator()(
const Arg1&,
const Arg2&,
const Arg3&)
const {
return Result(); }
110 template <
typename Result,
typename Arg1,
typename CastType>
112 inline Result
operator()(
const Arg1&
a)
const {
return Result(static_cast<CastType>(
a)); }
119 template <
typename Result>
135 template <
typename Result,
typename Arg1>
151 template <
typename Result,
typename Arg1,
typename Arg2>
167 template <
typename Result,
typename Arg1,
typename Arg2,
typename Arg3>
171 inline Result
operator()(
const Arg1& x,
const Arg2& y,
const Arg3& z)
const {
return fcn_(
x, y, z); }
176 Result (*
fcn_)(Arg1, Arg2, Arg3);
183 template <
class Container,
class Result =
typename Container::value_type>
199 template <
class Container,
class Result =
typename Container::value_type>
215 template <
typename T1,
typename T2>
217 inline T1&
operator()(T1& left,
const T2& right)
const {
return left = right; }
224 template <
typename T1,
typename T2>
226 inline T2&
operator()(
const T1& left, T2& right)
const {
return right = left; }
230 template <
typename T1,
typename T2>
232 inline T1&
operator()(T1& left,
const T2& right)
const {
return left += right; }
236 template <
typename T1,
typename T2>
238 inline T2&
operator()(
const T1& left, T2& right)
const {
return right += left; }
245 template <
typename T1,
typename T2>
249 inline T1&
operator()(T1& left,
const T2& right)
const {
return left +=
w_ * right; }
261 template <
typename T1,
typename T2>
265 inline T1&
operator()(T1& left,
const T2& right)
const {
return right +=
w_ * left; }
274 template <
typename T1,
typename T2>
276 inline T1&
operator()(T1& left,
const T2& right)
const {
return left -= right; }
280 template <
typename T1,
typename T2>
282 inline T2&
operator()(
const T1& left, T2& right)
const {
return right -= left; }
286 template <
typename T1,
typename T2>
288 inline T1&
operator()(T1& left,
const T2& right)
const {
return left *= right; }
292 template <
typename T1,
typename T2>
294 inline T2&
operator()(
const T1& left, T2& right)
const {
return right *= left; }
298 template <
typename T1,
typename T2>
300 inline T1&
operator()(T1& left,
const T2& right)
const {
return left /= right; }
304 template <
typename T1,
typename T2>
306 inline T2&
operator()(
const T1& left, T2& right)
const {
return right /= left; }
310 template <
typename T1,
typename T2>
321 return left /= right;
331 template <
typename T1,
typename T2>
342 return right /= left;
352 template <
typename T1,
typename T2,
typename T3 = T1>
354 inline T1&
operator()(T1& left,
const T2& right)
const {
return left =
static_cast<T3
>(right); }
358 template <
typename T1,
typename T2,
typename T3 = T2>
360 inline T2&
operator()(
const T1& left, T2& right)
const {
return right =
static_cast<T3
>(left); }
364 template <
typename T1,
typename T2,
typename T3 = T1>
366 inline T1&
operator()(T1& left,
const T2& right)
const {
return left +=
static_cast<T3
>(right); }
370 template <
typename T1,
typename T2,
typename T3 = T2>
372 inline T2&
operator()(
const T1& left, T2& right)
const {
return right +=
static_cast<T3
>(left); }
376 template <
typename T1,
typename T2,
typename T3 = T1>
378 inline T1&
operator()(T1& left,
const T2& right)
const {
return left -=
static_cast<T3
>(right); }
382 template <
typename T1,
typename T2,
typename T3 = T2>
384 inline T2&
operator()(
const T1& left, T2& right)
const {
return right -=
static_cast<T3
>(left); }
388 #endif // NPSTAT_SIMPLEFUNCTORS_HH_ T1 & operator()(T1 &left, const T2 &right) const
Result operator()(const Container &c) const
T2 & operator()(const T1 &left, T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const
addmul_left(const double weight)
virtual Result operator()(const Arg1 &, const Arg2 &, const Arg3 &) const =0
diveq_right_0by0isC(const T2 &value)
virtual Result operator()(const Arg1 &, const Arg2 &) const =0
T2 & operator()(const T1 &left, T2 &right) const
Result(* fcn_)(Arg1, Arg2)
T2 & operator()(const T1 &left, T2 &right) const
Result(* fcn_)(Arg1, Arg2, Arg3)
Arg2 second_argument_type
T2 & operator()(const T1 &left, T2 &right) const
Element1D(const unsigned long index)
Result operator()(const Arg1 &x, const Arg2 &y, const Arg3 &z) const
T2 & operator()(const T1 &left, T2 &right) const
diveq_left_0by0isC(const T1 &value)
Result operator()(const Container &c) const
Result operator()(const Arg1 &, const Arg2 &, const Arg3 &) const
T2 & operator()(const T1 &left, T2 &right) const
Arg2 second_argument_type
virtual Result operator()(const Arg1 &) const =0
FcnFunctor2(Result(*fcn)(Arg1, Arg2))
const Result & operator()(const Result &a) const
FcnFunctor3(Result(*fcn)(Arg1, Arg2, Arg3))
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
Result operator()(const Arg1 &) const
T1 & operator()(T1 &left, const T2 &right) const
void fcn(int &, double *, double &, double *, int)
Result operator()(const Arg1 &a) const
T1 & operator()(T1 &left, const T2 &right) const
FcnFunctor0(Result(*fcn)())
Result operator()(const Arg1 &a) const
T2 & operator()(const T1 &left, T2 &right) const
Result operator()() const
Result operator()(const Result &a) const override
T1 & operator()(T1 &left, const T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const
virtual Result operator()() const =0
addmul_right(const double weight)
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
Element1DAt(const unsigned long index)
Result operator()(const Arg1 &, const Arg2 &) const
T1 & operator()(T1 &left, const T2 &right) const
Result operator()() const
T2 & operator()(const T1 &left, T2 &right) const
Result operator()(const Arg1 &x, const Arg2 &y) const
T2 & operator()(const T1 &left, T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const