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