7 #ifndef __geometry_MatrixPower_h__ 8 #define __geometry_MatrixPower_h__ 10 #define MRP_DEBUG FALSE 11 #define MRP_VALIDATE (FE_CODEGEN<=FE_DEBUG) 36 template <
typename MATRIX>
44 void solve(MATRIX& B,
const MATRIX& A, T a_power)
const;
46 void setIterations(U32 iterations) { m_iterations=iterations; }
53 template <
typename MATRIX>
61 feLog(
"\nA\n%s\npower=%.6G\n",print(A).c_str(),absolute);
64 const BWORD inverted=(absolute<0.0);
70 U32 whole=U32(absolute);
71 F32 fraction=absolute-whole;
74 feLog(
"\nwhole=%d\nfraction=%.6G\n",whole,fraction);
83 for(iteration=0;iteration<m_iterations;iteration++)
85 m_matrixSqrt.solve(partial,partial);
88 feLog(
"\ncontribution=%.6G\nfraction=%.6G\n",contribution,fraction);
90 if(fraction>=contribution)
93 fraction-=contribution;
101 feLog(
"\nwhole=%d\n",whole);
116 for(U32 m=0;m<width(R);m++)
118 for(U32 n=0;n<height(R);n++)
120 if(FE_INVALID_SCALAR(R(m,n)))
128 feLog(
"MatrixPower< %s >::solve invalid results power=%.6G\n",
129 FE_TYPESTRING(MATRIX).c_str(),a_power);
130 feLog(
"\nA\n%s\n",print(A).c_str());
131 feLog(
"\nB\n%s\n",print(R).c_str());
133 feX(
"MatrixPower<>::solve",
"invalid result");
kernel
Definition: namespace.dox:3
Matrix< 4, 4, T > & invert(Matrix< 4, 4, T > &a_inverted, const Matrix< 4, 4, T > &a_matrix)
4x4 full matrix inversion
Definition: Matrix.h:1033
solve A=B*B for B, given A
Definition: MatrixSqrt.h:40
solve B = A^^power, where A is a matrix
Definition: MatrixPower.h:37