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>
134 template <
typename Result,
typename Arg1>
142 Result (*fcn_)(Arg1);
149 template <
typename Result,
typename Arg1,
typename Arg2>
153 inline Result
operator()(
const Arg1& x,
const Arg2& y)
const {
return fcn_(x, y); }
157 Result (*fcn_)(Arg1, Arg2);
164 template <
typename Result,
typename Arg1,
typename Arg2,
typename Arg3>
168 inline Result
operator()(
const Arg1& x,
const Arg2& y,
const Arg3& z)
const {
return fcn_(x, y, z); }
172 Result (*fcn_)(Arg1, Arg2, Arg3);
179 template <
class Container,
class Result =
typename Container::value_type>
194 template <
class Container,
class Result =
typename Container::value_type>
209 template <
typename T1,
typename T2>
211 inline T1&
operator()(T1& left,
const T2& right)
const {
return left = right; }
218 template <
typename T1,
typename T2>
220 inline T2&
operator()(
const T1& left, T2& right)
const {
return right = left; }
224 template <
typename T1,
typename T2>
226 inline T1&
operator()(T1& left,
const T2& right)
const {
return left += right; }
230 template <
typename T1,
typename T2>
232 inline T2&
operator()(
const T1& left, T2& right)
const {
return right += left; }
239 template <
typename T1,
typename T2>
243 inline T1&
operator()(T1& left,
const T2& right)
const {
return left += w_ * right; }
254 template <
typename T1,
typename T2>
258 inline T1&
operator()(T1& left,
const T2& right)
const {
return right += w_ * left; }
266 template <
typename T1,
typename T2>
268 inline T1&
operator()(T1& left,
const T2& right)
const {
return left -= right; }
272 template <
typename T1,
typename T2>
274 inline T2&
operator()(
const T1& left, T2& right)
const {
return right -= left; }
278 template <
typename T1,
typename T2>
280 inline T1&
operator()(T1& left,
const T2& right)
const {
return left *= right; }
284 template <
typename T1,
typename T2>
286 inline T2&
operator()(
const T1& left, T2& right)
const {
return right *= left; }
290 template <
typename T1,
typename T2>
292 inline T1&
operator()(T1& left,
const T2& right)
const {
return left /= right; }
296 template <
typename T1,
typename T2>
298 inline T2&
operator()(
const T1& left, T2& right)
const {
return right /= left; }
302 template <
typename T1,
typename T2>
308 if (right == rightZero)
309 if (left == leftZero) {
313 return left /= right;
323 template <
typename T1,
typename T2>
329 if (left == leftZero)
330 if (right == rightZero) {
334 return right /= left;
344 template <
typename T1,
typename T2,
typename T3 = T1>
346 inline T1&
operator()(T1& left,
const T2& right)
const {
return left =
static_cast<T3
>(right); }
350 template <
typename T1,
typename T2,
typename T3 = T2>
352 inline T2&
operator()(
const T1& left, T2& right)
const {
return right =
static_cast<T3
>(left); }
356 template <
typename T1,
typename T2,
typename T3 = T1>
358 inline T1&
operator()(T1& left,
const T2& right)
const {
return left +=
static_cast<T3
>(right); }
362 template <
typename T1,
typename T2,
typename T3 = T2>
364 inline T2&
operator()(
const T1& left, T2& right)
const {
return right +=
static_cast<T3
>(left); }
368 template <
typename T1,
typename T2,
typename T3 = T1>
370 inline T1&
operator()(T1& left,
const T2& right)
const {
return left -=
static_cast<T3
>(right); }
374 template <
typename T1,
typename T2,
typename T3 = T2>
376 inline T2&
operator()(
const T1& left, T2& right)
const {
return right -=
static_cast<T3
>(left); }
380 #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