Go to the source code of this file.
Functions | |
double | det (const dgemat2 &A) |
dgemat2 | inv (const dgemat2 &A) |
dgemat2 | rotate (const dgemat2 &m, const double &theta) |
dgemat2 | t2m (const double &theta) |
double | det (const dgemat3 &A) |
dgemat3 | inv (const dgemat3 &A) |
dgemat3 | rotate (const dgemat3 &m, const dquater &q) |
dquater | m2q (const dgemat3 &m) |
double det | ( | const dgemat2 & | A | ) | [inline] |
calculate determinant
Definition at line 3 of file dgematrix_small-specialized.hpp.
Referenced by inv().
{VERBOSE_REPORT;
return A(0,0)*A(1,1)-A(0,1)*A(1,0);
}
dgemat2 inv | ( | const dgemat2 & | A | ) | [inline] |
calculate inverse
Definition at line 10 of file dgematrix_small-specialized.hpp.
References det().
{VERBOSE_REPORT; const double Adet( det(A) ); dgemat2 Ainv; Ainv(0,0)= A(1,1)/Adet; Ainv(0,1)=-A(0,1)/Adet; Ainv(1,0)=-A(1,0)/Adet; Ainv(1,1)= A(0,0)/Adet; return Ainv; }
dgemat2 rotate | ( | const dgemat2 & | m, |
const double & | theta | ||
) | [inline] |
return rotated tensor
Definition at line 21 of file dgematrix_small-specialized.hpp.
{VERBOSE_REPORT; //dgemat2 R(t2m(theta)); return R*m*t(R);//too slow double c(cos(theta)), s(sin(theta)); double cc(c*c), cs(c*s), ss(s*s); dgemat2 mat; mat(0,0) =m(0,0)*cc -(m(0,1)+m(1,0))*cs +m(1,1)*ss; mat(0,1) =m(0,1)*cc +(m(0,0)-m(1,1))*cs -m(1,0)*ss; mat(1,0) =m(1,0)*cc +(m(0,0)-m(1,1))*cs -m(0,1)*ss; mat(1,1) =m(1,1)*cc +(m(0,1)+m(1,0))*cs +m(0,0)*ss; return mat; }
dgemat2 t2m | ( | const double & | theta | ) | [inline] |
convert theta to 2x2 rotational matrix
Definition at line 36 of file dgematrix_small-specialized.hpp.
{VERBOSE_REPORT;
dgemat2 R;
R(0,0)=cos(theta); R(0,1)=-sin(theta);
R(1,0)=sin(theta); R(1,1)=cos(theta);
return R;
}
double det | ( | const dgemat3 & | A | ) | [inline] |
calculate determinant
Definition at line 56 of file dgematrix_small-specialized.hpp.
{VERBOSE_REPORT;
return
+A(0,0)*A(1,1)*A(2,2) -A(0,0)*A(1,2)*A(2,1)
+A(0,1)*A(1,2)*A(2,0) -A(0,1)*A(1,0)*A(2,2)
+A(0,2)*A(1,0)*A(2,1) -A(0,2)*A(1,1)*A(2,0);
}
dgemat3 inv | ( | const dgemat3 & | A | ) | [inline] |
calculate inverse
Definition at line 66 of file dgematrix_small-specialized.hpp.
References det().
{VERBOSE_REPORT; const double Adet( det(A) ); dgemat3 Ainv; Ainv(0,0) =(A(1,1)*A(2,2)-A(1,2)*A(2,1))/Adet; Ainv(0,1) =(A(0,2)*A(2,1)-A(0,1)*A(2,2))/Adet; Ainv(0,2) =(A(0,1)*A(1,2)-A(0,2)*A(1,1))/Adet; Ainv(1,0) =(A(1,2)*A(2,0)-A(1,0)*A(2,2))/Adet; Ainv(1,1) =(A(0,0)*A(2,2)-A(0,2)*A(2,0))/Adet; Ainv(1,2) =(A(0,2)*A(1,0)-A(0,0)*A(1,2))/Adet; Ainv(2,0) =(A(1,0)*A(2,1)-A(1,1)*A(2,0))/Adet; Ainv(2,1) =(A(0,1)*A(2,0)-A(0,0)*A(2,1))/Adet; Ainv(2,2) =(A(0,0)*A(1,1)-A(0,1)*A(1,0))/Adet; return Ainv; }
dgemat3 rotate | ( | const dgemat3 & | m, |
const dquater & | q | ||
) | [inline] |