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