File indexing completed on 2025-01-18 10:10:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef ROOT_Minuit2_ABProd
0011 #define ROOT_Minuit2_ABProd
0012
0013 #include "Minuit2/ABObj.h"
0014
0015 namespace ROOT {
0016
0017 namespace Minuit2 {
0018
0019 template <class M1, class M2>
0020 class ABProd {
0021
0022 private:
0023 ABProd() : fA(M1()), fB(M2()) {}
0024
0025 ABProd &operator=(const ABProd &) { return *this; }
0026
0027 template <class MI1, class MI2>
0028 ABProd &operator=(const ABProd<MI1, MI2> &)
0029 {
0030 return *this;
0031 }
0032
0033 public:
0034 ABProd(const M1 &a, const M2 &b) : fA(a), fB(b) {}
0035
0036 ~ABProd() {}
0037
0038 ABProd(const ABProd &prod) : fA(prod.fA), fB(prod.fB) {}
0039
0040 template <class MI1, class MI2>
0041 ABProd(const ABProd<MI1, MI2> &prod) : fA(M1(prod.A())), fB(M2(prod.B()))
0042 {
0043 }
0044
0045 const M1 &A() const { return fA; }
0046 const M2 &B() const { return fB; }
0047
0048 private:
0049 M1 fA;
0050 M2 fB;
0051 };
0052
0053
0054 template <class atype, class A, class btype, class B, class T>
0055 inline ABObj<typename AlgebraicProdType<atype, btype>::Type, ABProd<ABObj<atype, A, T>, ABObj<btype, B, T>>, T>
0056 operator*(const ABObj<atype, A, T> &a, const ABObj<btype, B, T> &b)
0057 {
0058
0059 return ABObj<typename AlgebraicProdType<atype, btype>::Type, ABProd<ABObj<atype, A, T>, ABObj<btype, B, T>>, T>(
0060 ABProd<ABObj<atype, A, T>, ABObj<btype, B, T>>(a, b));
0061 }
0062
0063 }
0064
0065 }
0066
0067 #endif