9 for (
unsigned int i=0;i<2;i++){
10 for (
unsigned int j=0;j<4;j++){
16 double C1,
double C2,
double D1,
double D2){
37 for (
unsigned int i=0;i<4;i++){
48 mA[1][0]*m2(0)+
mA[1][1]*m2(1),
49 mA[2][0]*m2(0)+
mA[2][1]*m2(1),
50 mA[3][0]*m2(0)+
mA[3][1]*m2(1)
57 mA[0][0]*m2(0,1)+
mA[0][1]*m2(1,1),
58 mA[1][0]*m2(0,0)+
mA[1][1]*m2(1,0),
59 mA[1][0]*m2(0,1)+
mA[1][1]*m2(1,1),
60 mA[2][0]*m2(0,0)+
mA[2][1]*m2(1,0),
61 mA[2][0]*m2(0,1)+
mA[2][1]*m2(1,1),
62 mA[3][0]*m2(0,0)+
mA[3][1]*m2(1,0),
63 mA[3][0]*m2(0,1)+
mA[3][1]*m2(1,1)
67 cout <<
"DMatrix4x2:" <<endl;
68 cout <<
" | 0 | 1 |" <<endl;
69 cout <<
"-----|-----------|-----------|" <<endl;
70 for (
unsigned int i=0;i<4;i++){
71 cout <<
" "<<i<<
" |"<<setw(11)<<setprecision(4) <<
mA[i][0] <<
" "
72 <<setw(11)<<setprecision(4)<<
mA[i][1]<< endl;
87 for (
unsigned int j=0;j<2;j++){
88 mA[0].v[j]=_mm_setzero_pd();
89 mA[1].v[j]=_mm_setzero_pd();
93 double a21,
double a22,
94 double a31,
double a32,
95 double a41,
double a42)
107 DMatrix4x2(
const __m128d aa,
const __m128d ab,
const __m128d ba,
const __m128d bb)
118 mA[0].v[0]=dm.
mA[0].v[0];
119 mA[0].v[1]=dm.
mA[0].v[1];
120 mA[1].v[0]=dm.
mA[1].v[0];
121 mA[1].v[1]=dm.
mA[1].v[1];
125 __m128d GetV(
const int pair,
const int col)
const{
126 return mA[col].v[pair];
128 void SetV(
int pair,
int col,__m128d v){
134 mA[0].v[0]=dm.
mA[0].v[0];
135 mA[0].v[1]=dm.
mA[0].v[1];
136 mA[1].v[0]=dm.
mA[1].v[0];
137 mA[1].v[1]=dm.
mA[1].v[1];
142 return mA[col].d[row];
145 return mA[col].d[row];
152 a=_mm_set1_pd(m2(0));
153 b=_mm_set1_pd(m2(1));
155 _mm_mul_pd(GetV(0,1),b)),
156 _mm_add_pd(_mm_mul_pd(GetV(1,0),a),
157 _mm_mul_pd(GetV(1,1),b)));
167 a11=_mm_set1_pd(m2(0,0));
168 a12=_mm_set1_pd(m2(0,1));
169 a21=_mm_set1_pd(m2(1,0));
170 a22=_mm_set1_pd(m2(1,1));
172 _mm_mul_pd(GetV(0,1),a21)),
173 _mm_add_pd(_mm_mul_pd(GetV(0,0),a12),
174 _mm_mul_pd(GetV(0,1),a22)),
175 _mm_add_pd(_mm_mul_pd(GetV(1,0),a11),
176 _mm_mul_pd(GetV(1,1),a21)),
177 _mm_add_pd(_mm_mul_pd(GetV(1,0),a12),
178 _mm_mul_pd(GetV(1,1),a22)));
182 cout <<
"DMatrix4x2:" <<endl;
183 cout <<
" | 0 | 1 |" <<endl;
184 cout <<
"-----|-----------|-----------|" <<endl;
185 for (
unsigned int i=0;i<4;i++){
186 cout <<
" "<<i<<
" | " <<
mA[0].d[i] <<
" "<<
mA[1].d[i]<< endl;
#define ALIGNED_16_BLOCK_PTR(TYPE, NUM, PTR)
DMatrix4x2(double A1, double A2, double B1, double B2, double C1, double C2, double D1, double D2)
double & operator()(int row, int col)
#define ALIGNED_16_BLOCK_WITH_PTR(TYPE, NUM, PTR)
DMatrix4x2 operator*(const DMatrix2x2 &m2)
DMatrix4x2 & operator=(const DMatrix4x2 &m2)
DMatrix4x1 operator*(const DMatrix2x1 &m2)
#define ALIGNED_16_BLOCK(TYPE, NUM, PTR)