40 #define IS_FLOAT_NEAR_ZERO(x) ( ((fabs(x))<(1e-12)) ? 1 : 0 ) 47 for (
unsigned int itr = 0; itr < count; itr++ )
49 det = DET2x2 (&src[ itr ]);
57 dst[ itr ].
c1.
r1 = det * src[ itr ].
c2.
r2;
58 dst[ itr ].
c1.
r2 = -1 * det * src[ itr ].
c1.
r2;
59 dst[ itr ].
c2.
r1 = -1 * det * src[ itr ].
c2.
r1;
60 dst[ itr ].
c2.
r2 = det * src[ itr ].
c1.
r1;
67 #define aa (src[ itr ].c1.r1) 68 #define bb (src[ itr ].c1.r2) 69 #define cc (src[ itr ].c1.r3) 70 #define dd (src[ itr ].c2.r1) 71 #define ee (src[ itr ].c2.r2) 72 #define ff (src[ itr ].c2.r3) 73 #define gg (src[ itr ].c3.r1) 74 #define hh (src[ itr ].c3.r2) 75 #define ii (src[ itr ].c3.r3) 81 for (
unsigned int itr = 0; itr < count; itr++ )
83 det = DET3x3 (&src[ itr ]);
92 createColumnMajorMatrix2x2 (&A,
ee,
ff,
hh,
ii);
93 createColumnMajorMatrix2x2 (&B,
dd,
ff,
gg,
ii);
94 createColumnMajorMatrix2x2 (&C,
dd,
ee,
gg,
hh);
95 createColumnMajorMatrix2x2 (&D,
bb,
cc,
hh,
ii);
96 createColumnMajorMatrix2x2 (&E,
aa,
cc,
gg,
ii);
97 createColumnMajorMatrix2x2 (&F,
aa,
bb,
gg,
hh);
98 createColumnMajorMatrix2x2 (&G,
bb,
cc,
ee,
ff);
99 createColumnMajorMatrix2x2 (&H,
aa,
cc,
dd,
ff);
100 createColumnMajorMatrix2x2 (&I,
aa,
bb,
dd,
ee);
102 dst[ itr ].
c1.
r1 = det * DET2x2 (&A);
103 dst[ itr ].
c1.
r2 = -1.0f * det * DET2x2 (&D);
104 dst[ itr ].
c1.
r3 = det * DET2x2 (&G);
106 dst[ itr ].
c2.
r1 = -1.0f * det * DET2x2 (&B);
107 dst[ itr ].
c2.
r2 = det * DET2x2 (&E);
108 dst[ itr ].
c2.
r3 = -1.0f * det * DET2x2 (&H);
110 dst[ itr ].
c3.
r1 = det * DET2x2 (&C);
111 dst[ itr ].
c3.
r2 = -1.0f * det * DET2x2 (&F);
112 dst[ itr ].
c3.
r3 = det * DET2x2 (&I);
129 #define aa (src[ itr ].c1.r1) 130 #define bb (src[ itr ].c1.r2) 131 #define cc (src[ itr ].c1.r3) 132 #define dd (src[ itr ].c1.r4) 134 #define ee (src[ itr ].c2.r1) 135 #define ff (src[ itr ].c2.r2) 136 #define gg (src[ itr ].c2.r3) 137 #define hh (src[ itr ].c2.r4) 139 #define ii (src[ itr ].c3.r1) 140 #define jj (src[ itr ].c3.r2) 141 #define kk (src[ itr ].c3.r3) 142 #define ll (src[ itr ].c3.r4) 144 #define mm (src[ itr ].c4.r1) 145 #define nn (src[ itr ].c4.r2) 146 #define oo (src[ itr ].c4.r3) 147 #define pp (src[ itr ].c4.r4) 150 ne10_mat3x3f_t A, B, C, D, E, F, G, H,
I, J, K, L, M, N, O, P;
153 for (
unsigned int itr = 0; itr < count; itr++ )
155 det = DET4x4 (&src[ itr ]);
182 dst[ itr ].
c1.
r1 = det * DET3x3 (&A);
183 dst[ itr ].
c1.
r2 = -1.0f * det * DET3x3 (&E);
184 dst[ itr ].
c1.
r3 = det * DET3x3 (&I);
185 dst[ itr ].
c1.
r4 = -1.0f * det * DET3x3 (&M);
187 dst[ itr ].
c2.
r1 = -1.0f * det * DET3x3 (&B);
188 dst[ itr ].
c2.
r2 = det * DET3x3 (&F);
189 dst[ itr ].
c2.
r3 = -1.0f * det * DET3x3 (&J);
190 dst[ itr ].
c2.
r4 = det * DET3x3 (&N);
192 dst[ itr ].
c3.
r1 = det * DET3x3 (&C);
193 dst[ itr ].
c3.
r2 = -1.0f * det * DET3x3 (&G);
194 dst[ itr ].
c3.
r3 = det * DET3x3 (&K);
195 dst[ itr ].
c3.
r4 = -1.0f * det * DET3x3 (&O);
197 dst[ itr ].
c4.
r1 = -1.0f * det * DET3x3 (&D);
198 dst[ itr ].
c4.
r2 = det * DET3x3 (&H);
199 dst[ itr ].
c4.
r3 = -1.0f * det * DET3x3 (&L);
200 dst[ itr ].
c4.
r4 = det * DET3x3 (&P);
ne10_result_t ne10_invmat_4x4f_c(ne10_mat4x4f_t *dst, ne10_mat4x4f_t *src, ne10_uint32_t count)
Specific implementation of ne10_invmat_4x4f using plain C code.
ne10_result_t ne10_invmat_3x3f_c(ne10_mat3x3f_t *dst, ne10_mat3x3f_t *src, ne10_uint32_t count)
Specific implementation of ne10_invmat_3x3f using plain C code.
#define IS_FLOAT_NEAR_ZERO(x)
#define NE10_CHECKPOINTER_DstSrc
ne10_result_t ne10_invmat_2x2f_c(ne10_mat2x2f_t *dst, ne10_mat2x2f_t *src, ne10_uint32_t count)
Specific implementation of ne10_invmat_2x2f using plain C code.