25 #ifndef _BIAS_Matrix4x4_hh_
26 #define _BIAS_Matrix4x4_hh_
27 #include "bias_config.h"
29 #include <Base/Debug/Error.hh>
32 #include "Matrix3x3.hh"
53 template <
class T=
double>
74 const T a0,
const T a1,
const T a2,
const T a3,
75 const T a4,
const T a5,
const T a6,
const T a7,
76 const T a8,
const T a9,
const T a10,
const T a11,
77 const T a12,
const T a13,
const T a14,
const T a15 );
85 this->v_[0] = this->v_[5] = this->v_[10] = this->v_[15] = T(1);
89 BIASERR(
"undefined MatrixInitType");
129 const register T *matP = this->GetData();
136 +matP[3] * argvec[3];
142 +matP[7] * argvec[3];
147 +matP[10] * argvec[2]
148 +matP[11] * argvec[3];
152 +matP[13] * argvec[1]
153 +matP[14] * argvec[2]
154 +matP[15] * argvec[3];
167 for (
register unsigned int sub=0; sub<4; sub++) {
171 for (
register unsigned int i=0; i<3; i++) {
174 SubMatrix[0][i] = (*this)[(sub+1)%4][i+1];
175 SubMatrix[1][i] = (*this)[(sub+2)%4][i+1];
176 SubMatrix[2][i] = (*this)[(sub+3)%4][i+1];
201 register T *destP = destmat.
GetData();
203 const register T *argP = argmat.
GetData();
205 const register T *matP = this->GetData();
209 matP[0]*argP[0] + matP[1]*argP[4] + matP[2]*argP[8] + matP[3]*argP[12];
211 matP[0]*argP[1] + matP[1]*argP[5] + matP[2]*argP[9] + matP[3]*argP[13];
213 matP[0]*argP[2] + matP[1]*argP[6] + matP[2]*argP[10] + matP[3]*argP[14];
215 matP[0]*argP[3] + matP[1]*argP[7] + matP[2]*argP[11] + matP[3]*argP[15];
218 matP[4]*argP[0] + matP[5]*argP[4] + matP[6]*argP[8] + matP[7]*argP[12];
220 matP[4]*argP[1] + matP[5]*argP[5] + matP[6]*argP[9] + matP[7]*argP[13];
222 matP[4]*argP[2] + matP[5]*argP[6] + matP[6]*argP[10] + matP[7]*argP[14];
224 matP[4]*argP[3] + matP[5]*argP[7] + matP[6]*argP[11] + matP[7]*argP[15];
227 matP[8]*argP[0] + matP[9]*argP[4] + matP[10]*argP[8] + matP[11]*argP[12];
229 matP[8]*argP[1] + matP[9]*argP[5] + matP[10]*argP[9] + matP[11]*argP[13];
231 matP[8]*argP[2] + matP[9]*argP[6] + matP[10]*argP[10] + matP[11]*argP[14];
233 matP[8]*argP[3] + matP[9]*argP[7] + matP[10]*argP[11] + matP[11]*argP[15];
236 matP[12]*argP[0] + matP[13]*argP[4] + matP[14]*argP[8] + matP[15]*argP[12];
238 matP[12]*argP[1] + matP[13]*argP[5] + matP[14]*argP[9] + matP[15]*argP[13];
240 matP[12]*argP[2] + matP[13]*argP[6] + matP[14]*argP[10] + matP[15]*argP[14];
242 matP[12]*argP[3] + matP[13]*argP[7] + matP[14]*argP[11] + matP[15]*argP[15];
261 register T* d = this->GetData();
303 register T *dataP = this->GetData();
305 #define swap(a,b,tmp) tmp=a;a=b;b=tmp;
306 swap(dataP[1],dataP[4],tmp);
307 swap(dataP[2],dataP[8],tmp);
308 swap(dataP[12],dataP[3],tmp);
309 swap(dataP[13],dataP[7],tmp);
310 swap(dataP[14],dataP[11],tmp);
311 swap(dataP[9],dataP[6],tmp);
326 #include "Operators.hh"
void TransposeIP()
tranpose this matrix "in place" example: 0 1 2 3 –> 0 4 8 12 4 5 6 7 –> 1 5 9 13 8 9 10 11 –> 2 6 10...
MatrixInitType
can be passed to matrix constructors to init the matrix with the most often used values ...
void Mult(const Matrix4x4< T > &argmat, Matrix4x4< T > &destmat) const
matrix-matrix multiplication with other Matrix4x4, storing the result in destmat using 'manual inli...
T det() const
calculate the determinant recursively using sub matrices of size 3x3
class Vector4 contains a Vector of dim.
void Mult(const Vector4< T > &argvec, Vector4< T > &destvec) const
matrix - vector multiplicate this matrix with Vector4, storing the result in destvec, calculates: destvec = (this Matrix) * argvec
Matrix4x4 Transpose() const
T * GetData()
get the pointer to the data array of the matrix (for faster direct memeory access) ...
is a 'fixed size' quadratic matrix of dim.
class Vector3 contains a Vector of fixed dim.
matrix class with arbitrary size, indexing is row major.
void SetIdentity()
set the elements of this matrix to the identity matrix (posisbly overriding the inherited method) ...
T GetDeterminant() const
returns the Determinant |A| of this
is a 'fixed size' quadratic matrix of dim.
void clear()
stl conform interface