MINT2
ComplexProduct.h
Go to the documentation of this file.
1 #ifndef MINT_COMPLEX_PRODUCT_HH
2 #define MINT_COMPLEX_PRODUCT_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:17:55 GMT
5 
7 #include "Mint/BasicComplex.h"
8 #include <vector>
9 #include <complex>
10 #include "Mint/counted_ptr.h"
11 #include "Mint/FitParDependent.h"
12 
13 namespace MINT{
14  class ComplexProduct : virtual public IComplexFitParDependent, public FitParDependent{
15  protected:
16  std::vector< counted_ptr<IReturnComplex> > _facVec;
17  std::vector< double > _fixedDoubleVec;
18  std::vector< std::complex<double> > _fixedComplexVec;
19 
20  inline double fixedRealProduct(){
21  double prod(1);
22  for(unsigned i = 0; i < _fixedDoubleVec.size(); i++){
23  prod *= _fixedDoubleVec[i];
24  }
25  return prod;
26  }
27  inline std::complex<double> fixedComplexProduct(){
28  std::complex<double> prod(1, 0);
29  for(unsigned i = 0; i < _fixedComplexVec.size(); i++){
30  prod *= _fixedComplexVec[i];
31  }
32  return prod;
33  }
34 
35  inline std::complex<double> complexProduct(){
36  std::complex<double> prod(1,0);
37  for(unsigned i = 0; i < _facVec.size(); i++){
38  prod *= (_facVec[i])->ComplexVal();
39  }
40  return prod;
41  }
42 
43  void setToUnity();
44 
45  public:
47  ComplexProduct(double initVal, IFitParRegister* daddy=0);
48  ComplexProduct(const std::complex<double>& z, IFitParRegister* daddy=0);
49  ComplexProduct(const ComplexProduct& other, IFitParRegister* newDaddy=0);
50 
51  void multiply(const ComplexProduct& multiplyWith);
52 
53  void addTerm(double val); // by value
54  void addTerm(const std::complex<double>& z); // by value
55  void addTerm(const counted_ptr<IReturnComplex>& irc); // by reference
56  void addTerm(const counted_ptr<IComplexFitParDependent>& irc); // by reference
57 
58  ComplexProduct& operator*=(double val);
59  ComplexProduct& operator*=(const std::complex<double>& z);
63 
64  inline std::complex<double> ComplexVal(){
66  }
67 
68  };
69 }
70 #endif
71 //
ComplexProduct(IFitParRegister *daddy=0)
std::complex< double > ComplexVal()
std::vector< double > _fixedDoubleVec
ComplexProduct & operator *=(double val)
void multiply(const ComplexProduct &multiplyWith)
std::complex< double > fixedComplexProduct()
void addTerm(double val)
std::vector< counted_ptr< IReturnComplex > > _facVec
std::vector< std::complex< double > > _fixedComplexVec
std::complex< double > complexProduct()