ABProd.h

Go to the documentation of this file.
00001 // @(#)root/minuit2:$Id: ABProd.h 23970 2008-05-22 13:37:25Z moneta $
00002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005  
00003 
00004 /**********************************************************************
00005  *                                                                    *
00006  * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
00007  *                                                                    *
00008  **********************************************************************/
00009 
00010 #ifndef ROOT_Minuit2_ABProd
00011 #define ROOT_Minuit2_ABProd
00012 
00013 #include "Minuit2/ABObj.h"
00014 
00015 namespace ROOT {
00016 
00017    namespace Minuit2 {
00018 
00019 
00020 template<class M1, class M2>
00021 class ABProd {
00022 
00023 private:
00024 
00025   ABProd() : fA(M1()), fB(M2()) {}
00026 
00027   ABProd& operator=(const ABProd&) {return *this;}
00028 
00029   template<class MI1, class MI2>
00030   ABProd& operator=(const ABProd<MI1,MI2>&) {return *this;}
00031   
00032 public:
00033 
00034   ABProd(const M1& a, const M2& b): fA(a), fB(b) {}
00035 
00036   ~ABProd() {}
00037 
00038   ABProd(const ABProd& prod) : fA(prod.fA), fB(prod.fB) {}
00039 
00040   template<class MI1, class MI2>
00041   ABProd(const ABProd<MI1,MI2>& prod) : fA(M1(prod.A() )), fB(M2(prod.B() )) {}
00042 
00043   const M1& A() const {return fA;}
00044   const M2& B() const {return fB;}
00045  
00046 private:
00047 
00048   M1 fA;
00049   M2 fB;
00050 };
00051 
00052 // ABObj * ABObj
00053 template<class atype, class A, class btype, class B, class T>
00054 inline ABObj<typename AlgebraicProdType<atype, btype>::Type, ABProd<ABObj<atype,A,T>, ABObj<btype,B,T> >,T> operator*(const ABObj<atype,A,T>& a, const ABObj<btype,B,T>& b) {
00055 
00056   return ABObj<typename AlgebraicProdType<atype,btype>::Type, ABProd<ABObj<atype,A,T>, ABObj<btype,B,T> >,T>(ABProd<ABObj<atype,A,T>, ABObj<btype,B,T> >(a, b));
00057 }
00058 
00059   }  // namespace Minuit2
00060 
00061 }  // namespace ROOT
00062 
00063 #endif  // ROOT_Minuit2_ABProd

Generated on Tue Jul 5 14:25:40 2011 for ROOT_528-00b_version by  doxygen 1.5.1