10 mA[0][0]=
mA[0][1]=
mA[1][0]=
mA[1][1]=0.;
43 mA[0][0]*m2(0,1)+
mA[0][1]*m2(1,1),
44 mA[1][0]*m2(0,0)+
mA[1][1]*m2(1,0),
45 mA[1][0]*m2(0,1)+
mA[1][1]*m2(1,1));
50 mA[1][0]*m2(0)+
mA[1][1]*m2(1));
65 double one_over_det=1./(
mA[0][0]*
mA[1][1]-
mA[0][1]*
mA[1][0]);
66 return DMatrix2x2(one_over_det*
mA[1][1],-one_over_det*mA[0][1],
67 -one_over_det*mA[1][0],one_over_det*mA[0][0]);
73 return mA[0][0]*
mA[1][1]-
mA[0][1]*
mA[1][0];
79 return ( (R(0)*R(0)*
mA[1][1]-R(0)*R(1)*(
mA[0][1]+
mA[1][0])
81 (
mA[0][0]*
mA[1][1]-
mA[0][1]*
mA[1][0]));
85 cout <<
"DMatrix2x2:" <<endl;
86 cout <<
" | 0 | 1 |" <<endl;
87 cout <<
"----------------------------------" <<endl;
88 for (
unsigned int i=0;i<2;i++){
89 cout <<
" "<<i<<
" |"<< setw(11)<<setprecision(4) <<
mA[i][0] <<
" "
90 << setw(11)<<setprecision(4)<<
mA[i][1]<< endl;
109 mA[0].v=_mm_setzero_pd();
110 mA[1].v=_mm_setzero_pd();
112 DMatrix2x2(
double d11,
double d12,
double d21,
116 mA[0].v=_mm_setr_pd(d11,d21);
117 mA[1].v=_mm_setr_pd(d12,d22);
133 __m128d GetV(
int col)
const{
139 return mA[col].d[row];
142 return mA[col].d[row];
158 zero=_mm_setzero_pd();
160 _mm_sub_pd(zero,
mA[1].v));
166 _mm_set1_pd(m2(0,0))),
168 _mm_set1_pd(m2(1,0)))),
169 _mm_add_pd(_mm_mul_pd(
mA[0].v,
170 _mm_set1_pd(m2(0,1))),
172 _mm_set1_pd(m2(1,1)))));
176 return DMatrix2x1(_mm_add_pd(_mm_mul_pd(GetV(0),_mm_set1_pd(m2(0))),
177 _mm_mul_pd(GetV(1),_mm_set1_pd(m2(1)))));
183 _mm_add_pd(
mA[1].v,m2.
mA[1].v));
188 _mm_sub_pd(
mA[1].v,m2.
mA[1].v));
195 scale=_mm_set1_pd(1./(
mA[0].d[0]*
mA[1].d[1]-
mA[1].d[0]*
mA[0].d[1]));
196 return DMatrix2x2( _mm_mul_pd(scale,_mm_setr_pd(
mA[1].d[1],-
mA[0].d[1])),
197 _mm_mul_pd(scale,_mm_setr_pd(-
mA[1].d[0],
mA[0].d[0])));
202 return mA[0].d[0]*
mA[1].d[1]-
mA[0].d[1]*
mA[1].d[0];
208 return ( (R(0)*R(0)*
mA[1].d[1]-R(0)*R(1)*(
mA[0].d[1]+
mA[1].d[0])
209 +R(1)*R(1)*
mA[0].d[0])/
210 (
mA[0].d[0]*
mA[1].d[1]-
mA[0].d[1]*
mA[1].d[0]));
214 cout <<
"DMatrix2x2:" <<endl;
215 cout <<
" | 0 | 1 |" <<endl;
216 cout <<
"----------------------------------" <<endl;
217 for (
unsigned int i=0;i<2;i++){
218 cout <<
" "<<i<<
" |"<< setw(11)<<setprecision(4) <<
mA[0].d[i] <<
" "
219 << setw(11)<<setprecision(4)<<
mA[1].d[i]<< endl;
#define ALIGNED_16_BLOCK_PTR(TYPE, NUM, PTR)
DMatrix2x2(double d11, double d12, double d21, double d22)
#define ALIGNED_16_BLOCK_WITH_PTR(TYPE, NUM, PTR)
DMatrix2x2 operator-() const
double Chi2(const DMatrix2x1 &R) const
double & operator()(int row, int col)
DMatrix2x2 operator*(const DMatrix2x2 &m2)
DMatrix2x2 operator+(const DMatrix2x2 &m2)
DMatrix2x2 operator-(const DMatrix2x2 &m2)
DMatrix2x1 operator*(const DMatrix2x1 &m2)
DMatrix2x2 & operator=(const DMatrix2x2 &m1)
#define ALIGNED_16_BLOCK(TYPE, NUM, PTR)