32 #ifndef __NE10_DETMAT_C_H__
33 #define __NE10_DETMAT_C_H__
35 #include "NE10_types.h"
40 static inline ne10_float32_t DET2x2( ne10_mat2x2f_t * mat )
46 return ( (mat->c1.r1 * mat->c2.r2)
47 -(mat->c2.r1 * mat->c1.r2) );
50 static inline ne10_float32_t DET3x3( ne10_mat3x3f_t * mat )
57 ne10_mat2x2f_t subm11 = { {mat->c2.r2, mat->c2.r3}, {mat->c3.r2, mat->c3.r3} };
58 ne10_mat2x2f_t subm21 = { {mat->c1.r2, mat->c1.r3}, {mat->c3.r2, mat->c3.r3} };
59 ne10_mat2x2f_t subm31 = { {mat->c1.r2, mat->c1.r3}, {mat->c2.r2, mat->c2.r3} };
60 return (mat->c1.r1*DET2x2( &subm11 ))
61 - (mat->c2.r1*DET2x2( &subm21 ))
62 + (mat->c3.r1*DET2x2( &subm31 ));
65 static inline ne10_float32_t DET4x4( ne10_mat4x4f_t * mat )
73 ne10_mat3x3f_t subm11 = { {mat->c2.r2, mat->c2.r3, mat->c2.r4},
74 {mat->c3.r2, mat->c3.r3, mat->c3.r4},
75 {mat->c4.r2, mat->c4.r3, mat->c4.r4} };
77 ne10_mat3x3f_t subm21 = { {mat->c1.r2, mat->c1.r3, mat->c1.r4},
78 {mat->c3.r2, mat->c3.r3, mat->c3.r4},
79 {mat->c4.r2, mat->c4.r3, mat->c4.r4} };
81 ne10_mat3x3f_t subm31 = { {mat->c1.r2, mat->c1.r3, mat->c1.r4},
82 {mat->c2.r2, mat->c2.r3, mat->c2.r4},
83 {mat->c4.r2, mat->c4.r3, mat->c4.r4} };
85 ne10_mat3x3f_t subm41 = { {mat->c1.r2, mat->c1.r3, mat->c1.r4},
86 {mat->c2.r2, mat->c2.r3, mat->c2.r4},
87 {mat->c3.r2, mat->c3.r3, mat->c3.r4} };
89 return (mat->c1.r1*DET3x3( &subm11 ))
90 - (mat->c2.r1*DET3x3( &subm21 ))
91 + (mat->c3.r1*DET3x3( &subm31 ))
92 - (mat->c4.r1*DET3x3( &subm41 ));