Оптимизация под GNU C компилятор / Optimization for GNU C Compiller
This commit is contained in:
parent
e4d75824f3
commit
081f794eb1
10 changed files with 671 additions and 755 deletions
|
|
@ -1,105 +1 @@
|
||||||
#include "matrix2x2.h"
|
#include "matrix2x2.h"
|
||||||
|
|
||||||
// ================= Inversion ================== //
|
|
||||||
|
|
||||||
int bg_fp32_matrix2x2_invert(BgFP32Matrix2x2* matrix)
|
|
||||||
{
|
|
||||||
const float determinant = bg_fp32_matrix2x2_get_determinant(matrix);
|
|
||||||
|
|
||||||
if (-BG_FP32_EPSYLON <= determinant && determinant <= BG_FP32_EPSYLON) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const float r1c1 = matrix->r2c2;
|
|
||||||
const float r1c2 = -matrix->r1c2;
|
|
||||||
|
|
||||||
const float r2c1 = -matrix->r2c1;
|
|
||||||