|
|
Go to the documentation of this file. 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>
149 template <
typename Result,
typename Arg1,
typename Arg2>
153 inline Result
operator()(
const Arg1& x,
const Arg2& y)
const {
return fcn_(x, y); }
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>
313 return left /= right;
323 template <
typename T1,
typename T2>
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_
Result operator()(const Arg1 &a) const
T1 & operator()(T1 &left, const T2 &right) const
virtual Result operator()(const Arg1 &) const =0
virtual Result operator()(const Arg1 &, const Arg2 &) const =0
Result operator()(const Arg1 &x, const Arg2 &y, const Arg3 &z) const
T2 & operator()(const T1 &left, T2 &right) const
Result operator()() const
FcnFunctor2(Result(*fcn)(Arg1, Arg2))
T1 & operator()(T1 &left, const T2 &right) const
T2 & operator()(const T1 &left, T2 &right) const
Arg2 second_argument_type
Result operator()(const Arg1 &x, const Arg2 &y) const
virtual Result operator()(const Arg1 &, const Arg2 &, const Arg3 &) const =0
void fcn(int &, double *, double &, double *, int)
diveq_left_0by0isC(const T1 &value)
Arg2 second_argument_type
T1 & operator()(T1 &left, const T2 &right) const
diveq_right_0by0isC(const T2 &value)
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
FcnFunctor3(Result(*fcn)(Arg1, Arg2, Arg3))
Result operator()(const Arg1 &) const
const Result & operator()(const Result &a) const
FcnFunctor0(Result(*fcn)())
Element1DAt(const unsigned long index)
addmul_right(const double weight)
T1 & operator()(T1 &left, const T2 &right) const
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
Result operator()() const
T2 & operator()(const T1 &left, T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const
virtual Result operator()() const =0
T1 & operator()(T1 &left, const T2 &right) const
T2 & operator()(const T1 &left, T2 &right) const
Result(* fcn_)(Arg1, Arg2, Arg3)
Result operator()(const Result &a) const override
T1 & operator()(T1 &left, const T2 &right) const
T2 & operator()(const T1 &left, T2 &right) const
Result operator()(const Arg1 &, const Arg2 &) const
T2 & operator()(const T1 &left, T2 &right) const
Result operator()(const Arg1 &a) const
T1 & operator()(T1 &left, const T2 &right) const
T1 & operator()(T1 &left, const T2 &right) const
Result(* fcn_)(Arg1, Arg2)
addmul_left(const double weight)
Result operator()(const Container &c) const
Element1D(const unsigned long index)
Result operator()(const Container &c) const
FcnFunctor1(Result(*fcn)(Arg1))
T2 & operator()(const T1 &left, T2 &right) const
Result operator()(const Arg1 &, const Arg2 &, const Arg3 &) const