1 #ifndef GUARD_GGEMS_MATHS_GGEMSMATRIXOPERATIONS_HH
2 #define GUARD_GGEMS_MATHS_GGEMSMATRIXOPERATIONS_HH
38 #ifdef __OPENCL_C_VERSION__
54 point4D.x = point->x; point4D.y = point->y; point4D.z = point->z; point4D.w = 1.0f;
57 row0.x = matrix->m0_[0]; row0.y = matrix->m0_[1]; row0.z = matrix->m0_[2]; row0.w = matrix->m0_[3];
60 row1.x = matrix->m1_[0]; row1.y = matrix->m1_[1]; row1.z = matrix->m1_[2]; row1.w = matrix->m1_[3];
63 row2.x = matrix->m2_[0]; row2.y = matrix->m2_[1]; row2.z = matrix->m2_[2]; row2.w = matrix->m2_[3];
88 point3D.x = point->x; point3D.y = point->y; point3D.z = point->z;
91 row0.x = matrix->m0_[0]; row0.y = matrix->m0_[1]; row0.z = matrix->m0_[2];
94 row1.x = matrix->m1_[0]; row1.y = matrix->m1_[1]; row1.z = matrix->m1_[2];
97 row2.x = matrix->m2_[0]; row2.y = matrix->m2_[1]; row2.z = matrix->m2_[2];
122 point3D.x = point->x; point3D.y = point->y; point3D.z = point->z;
125 row0.x = matrix->m0_[0]; row0.y = matrix->m1_[0]; row0.z = matrix->m2_[0];
128 row1.x = matrix->m0_[1]; row1.y = matrix->m1_[1]; row1.z = matrix->m2_[1];
131 row2.x = matrix->m0_[2]; row2.y = matrix->m1_[2]; row2.z = matrix->m2_[2];
160 tmp.
m0_[0] =
A->m0_[0]*B->
m0_[0] +
A->m0_[1]*B->
m1_[0] +
A->m0_[2]*B->
m2_[0] +
A->m0_[3]*B->
m3_[0];
161 tmp.
m0_[1] =
A->m0_[0]*B->
m0_[1] +
A->m0_[1]*B->
m1_[1] +
A->m0_[2]*B->
m2_[1] +
A->m0_[3]*B->
m3_[1];
162 tmp.
m0_[2] =
A->m0_[0]*B->
m0_[2] +
A->m0_[1]*B->
m1_[2] +
A->m0_[2]*B->
m2_[2] +
A->m0_[3]*B->
m3_[2];
163 tmp.
m0_[3] =
A->m0_[0]*B->
m0_[3] +
A->m0_[1]*B->
m1_[3] +
A->m0_[2]*B->
m2_[3] +
A->m0_[3]*B->
m3_[3];
166 tmp.
m1_[0] =
A->m1_[0]*B->
m0_[0] +
A->m1_[1]*B->
m1_[0] +
A->m1_[2]*B->
m2_[0] +
A->m1_[3]*B->
m3_[0];
167 tmp.
m1_[1] =
A->m1_[0]*B->
m0_[1] +
A->m1_[1]*B->
m1_[1] +
A->m1_[2]*B->
m2_[1] +
A->m1_[3]*B->
m3_[1];
168 tmp.
m1_[2] =
A->m1_[0]*B->
m0_[2] +
A->m1_[1]*B->
m1_[2] +
A->m1_[2]*B->
m2_[2] +
A->m1_[3]*B->
m3_[2];
169 tmp.
m1_[3] =
A->m1_[0]*B->
m0_[3] +
A->m1_[1]*B->
m1_[3] +
A->m1_[2]*B->
m2_[3] +
A->m1_[3]*B->
m3_[3];
172 tmp.
m2_[0] =
A->m2_[0]*B->
m0_[0] +
A->m2_[1]*B->
m1_[0] +
A->m2_[2]*B->
m2_[0] +
A->m2_[3]*B->
m3_[0];
173 tmp.
m2_[1] =
A->m2_[0]*B->
m0_[1] +
A->m2_[1]*B->
m1_[1] +
A->m2_[2]*B->
m2_[1] +
A->m2_[3]*B->
m3_[1];
174 tmp.
m2_[2] =
A->m2_[0]*B->
m0_[2] +
A->m2_[1]*B->
m1_[2] +
A->m2_[2]*B->
m2_[2] +
A->m2_[3]*B->
m3_[2];
175 tmp.
m2_[3] =
A->m2_[0]*B->
m0_[3] +
A->m2_[1]*B->
m1_[3] +
A->m2_[2]*B->
m2_[3] +
A->m2_[3]*B->
m3_[3];
178 tmp.
m3_[0] =
A->m3_[0]*B->
m0_[0] +
A->m3_[1]*B->
m1_[0] +
A->m3_[2]*B->
m2_[0] +
A->m3_[3]*B->
m3_[0];
179 tmp.
m3_[1] =
A->m3_[0]*B->
m0_[1] +
A->m3_[1]*B->
m1_[1] +
A->m3_[2]*B->
m2_[1] +
A->m3_[3]*B->
m3_[1];
180 tmp.
m3_[2] =
A->m3_[0]*B->
m0_[2] +
A->m3_[1]*B->
m1_[2] +
A->m3_[2]*B->
m2_[2] +
A->m3_[3]*B->
m3_[2];
181 tmp.
m3_[3] =
A->m3_[0]*B->
m0_[3] +
A->m3_[1]*B->
m1_[3] +
A->m3_[2]*B->
m2_[3] +
A->m3_[3]*B->
m3_[3];
186 #endif // End of GUARD_GGEMS_MATHS_MATRIX_FUNCTIONS_HH