#include #ifndef USE_SSE2 // Matrix class without SIMD instructions class DMatrix2x3{ public: DMatrix2x3(){ for (unsigned int i=0;i<2;i++){ for (unsigned int j=0;j<3;j++){ mA[i][j]=0.; } } } DMatrix2x3(double c11, double c12, double c13, double c21, double c22, double c23){ mA[0][0]=c11; mA[0][1]=c12; mA[0][2]=c13; mA[1][0]=c21; mA[1][1]=c22; mA[1][2]=c23; } ~DMatrix2x3(){}; double &operator() (int row, int col){ return mA[row][col]; } double operator() (int row, int col) const{ return mA[row][col]; } // Matrix multiplication: (2x3) x (3x2) DMatrix2x2 operator*(const DMatrix3x2 &m2){ return DMatrix2x2(mA[0][0]*m2(0,0)+mA[0][1]*m2(1,0)+mA[0][2]*m2(2,0), mA[0][0]*m2(0,1)+mA[0][1]*m2(1,1)+mA[0][2]*m2(2,1), mA[1][0]*m2(0,0)+mA[1][1]*m2(1,0)+mA[1][2]*m2(2,0), mA[1][0]*m2(0,1)+mA[1][1]*m2(1,1)+mA[1][2]*m2(2,1) ); } // Matrix multiplication: (2x3) x (3x3) DMatrix2x3 operator*(const DMatrix3x3 &m2){ return DMatrix2x3(mA[0][0]*m2(0,0)+mA[0][1]*m2(1,0)+mA[0][2]*m2(2,0), mA[0][0]*m2(0,1)+mA[0][1]*m2(1,1)+mA[0][2]*m2(2,1), mA[0][0]*m2(0,2)+mA[0][1]*m2(1,2)+mA[0][2]*m2(2,2), mA[1][0]*m2(0,0)+mA[1][1]*m2(1,0)+mA[1][2]*m2(2,0), mA[1][0]*m2(0,1)+mA[1][1]*m2(1,1)+mA[1][2]*m2(2,1), mA[1][0]*m2(0,2)+mA[1][1]*m2(1,2)+mA[1][2]*m2(2,2) ); } void Print(){ cout << "DMatrix2x3:" <