Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMatrix1x2.h
Go to the documentation of this file.
1 class DMatrix1x2{
2  public:
4  mA[0]=0.;
5  mA[1]=0.;
6  }
7  DMatrix1x2(double c1,double c2){
8  mA[0]=c1;
9  mA[1]=c2;
10  }
12 
13 
14  double &operator() (int col){
15  return mA[col];
16  }
17  double operator() (int col) const{
18  return mA[col];
19  }
20 
21  // Matrix multiplication: (1x2) x (2x1)
22  double operator*(const DMatrix2x1 &m2){
23  return (mA[0]*m2(0)+mA[1]*m2(1));
24  }
25 
26  // Matrix multiplication: (1x2) x (2x2)
28  return
29  DMatrix1x2(mA[0]*m2(0,0)+mA[1]*m2(1,0),
30  mA[0]*m2(0,1)+mA[1]*m2(1,1));
31  }
32 
33 
34 
35 
36  void Print(){
37  cout << "DMatrix1x2:" <<endl;
38  cout << " | 0 | 1 |" <<endl;
39  cout << "------------------------------" <<endl;
40  cout << " 0 |" ;
41  for (unsigned int j=0;j<2;j++){
42  cout <<setw(11)<<setprecision(4)<< mA[j]<<" ";
43  }
44  cout << endl;
45  }
46 
47 
48  private:
49  double mA[2];
50 
51 };
52 
53 
double operator*(const DMatrix2x1 &m2)
Definition: DMatrix1x2.h:22
Double_t c1[2][NMODULES]
Definition: tw_corr.C:68
Double_t c2[2][NMODULES]
Definition: tw_corr.C:69
double mA[2]
Definition: DMatrix1x2.h:49
DMatrix1x2(double c1, double c2)
Definition: DMatrix1x2.h:7
DMatrix1x2 operator*(const DMatrix2x2 &m2)
Definition: DMatrix1x2.h:27
void Print()
Definition: DMatrix1x2.h:36
DMatrix1x2()
Definition: DMatrix1x2.h:3
double & operator()(int col)
Definition: DMatrix1x2.h:14