CMS 3D CMS Logo

Composition.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_Composition_h
2 #define PhysicsTools_Utilities_Composition_h
3 
4 namespace funct {
5  template <typename A, typename B>
7  CompositionStruct(const A& a, const B& b) : _1(a), _2(b) {}
8  double operator()() const { return _1(_2()); }
9  operator double() const { return _1(_2()); }
10  double operator()(double x) const { return _1(_2(x)); }
11  double operator()(double x, double y) const { return _1(_2(x, y)); }
12  A _1;
13  B _2;
14  };
15 
16  template <typename A, typename B>
17  struct Composition {
19  static type compose(const A& a, const B& b) { return type(a, b); }
20  };
21 
22  template <typename A, typename B>
23  inline typename funct::Composition<A, B>::type compose(const A& a, const B& b) {
25  }
26 
27 } // namespace funct
28 
29 #endif
funct::CompositionStruct::_2
B _2
Definition: Composition.h:13
funct::B
TEMPL(T2) struct Divides B
Definition: Factorize.h:24
funct::CompositionStruct::operator()
double operator()(double x) const
Definition: Composition.h:10
funct::CompositionStruct::operator()
double operator()(double x, double y) const
Definition: Composition.h:11
funct::CompositionStruct
Definition: Composition.h:6
funct::Composition::compose
static type compose(const A &a, const B &b)
Definition: Composition.h:19
b
double b
Definition: hdecay.h:118
funct::Composition
Definition: Composition.h:17
a
double a
Definition: hdecay.h:119
A
funct::CompositionStruct::CompositionStruct
CompositionStruct(const A &a, const B &b)
Definition: Composition.h:7
funct::CompositionStruct::_1
A _1
Definition: Composition.h:12
funct
Definition: Abs.h:5
funct::Composition::type
CompositionStruct< A, B > type
Definition: Composition.h:18
funct::compose
funct::Composition< A, B >::type compose(const A &a, const B &b)
Definition: Composition.h:23
funct::CompositionStruct::operator()
double operator()() const
Definition: Composition.h:8