Lines Matching refs:A
29 void initZeroMatrix(struct Mat33 *A) { in initZeroMatrix() argument
30 memset(A->elem, 0.0f, sizeof(A->elem)); in initZeroMatrix()
34 void initDiagonalMatrix(struct Mat33 *A, float x) in initDiagonalMatrix() argument
36 initZeroMatrix(A); in initDiagonalMatrix()
40 A->elem[i][i] = x; in initDiagonalMatrix()
44 void initMatrixColumns(struct Mat33 *A, const struct Vec3 *v1, const struct Vec3 *v2, const struct … in initMatrixColumns() argument
46 A->elem[0][0] = v1->x; in initMatrixColumns()
47 A->elem[0][1] = v2->x; in initMatrixColumns()
48 A->elem[0][2] = v3->x; in initMatrixColumns()
50 A->elem[1][0] = v1->y; in initMatrixColumns()
51 A->elem[1][1] = v2->y; in initMatrixColumns()
52 A->elem[1][2] = v3->y; in initMatrixColumns()
54 A->elem[2][0] = v1->z; in initMatrixColumns()
55 A->elem[2][1] = v2->z; in initMatrixColumns()
56 A->elem[2][2] = v3->z; in initMatrixColumns()
59 void mat33Apply(struct Vec3 *out, const struct Mat33 *A, const struct Vec3 *v) in mat33Apply() argument
62 out->x = A->elem[0][0] * v->x + A->elem[0][1] * v->y + A->elem[0][2] * v->z; in mat33Apply()
63 out->y = A->elem[1][0] * v->x + A->elem[1][1] * v->y + A->elem[1][2] * v->z; in mat33Apply()
64 out->z = A->elem[2][0] * v->x + A->elem[2][1] * v->y + A->elem[2][2] * v->z; in mat33Apply()
68 void mat33Multiply(struct Mat33 *out, const struct Mat33 *A, const struct Mat33 *B) in mat33Multiply() argument
80 sum += A->elem[i][k] * B->elem[k][j]; in mat33Multiply()
89 void mat33ScalarMul(struct Mat33 *A, float c) in mat33ScalarMul() argument
95 A->elem[i][j] *= c; in mat33ScalarMul()
101 void mat33Add(struct Mat33 *out, const struct Mat33 *A) in mat33Add() argument
107 out->elem[i][j] += A->elem[i][j]; in mat33Add()
113 void mat33Sub(struct Mat33 *out, const struct Mat33 *A) in mat33Sub() argument
119 out->elem[i][j] -= A->elem[i][j]; in mat33Sub()
125 int mat33IsPositiveSemidefinite(const struct Mat33 *A, float tolerance) in mat33IsPositiveSemidefinite() argument
129 if (A->elem[i][i] < 0.0f) { in mat33IsPositiveSemidefinite()
137 if (fabsf(A->elem[i][j] - A->elem[j][i]) > tolerance) { in mat33IsPositiveSemidefinite()
147 void mat33MultiplyTransposed(struct Mat33 *out, const struct Mat33 *A, const struct Mat33 *B) in mat33MultiplyTransposed() argument
159 sum += A->elem[k][i] * B->elem[k][j]; in mat33MultiplyTransposed()
168 void mat33MultiplyTransposed2(struct Mat33 *out, const struct Mat33 *A, const struct Mat33 *B) in mat33MultiplyTransposed2() argument
180 sum += A->elem[i][k] * B->elem[j][k]; in mat33MultiplyTransposed2()
189 void mat33Invert(struct Mat33 *out, const struct Mat33 *A) in mat33Invert() argument
194 struct Mat33 tmp = *A; in mat33Invert()
237 void mat33Transpose(struct Mat33 *out, const struct Mat33 *A) in mat33Transpose() argument
243 out->elem[i][j] = A->elem[j][i]; in mat33Transpose()
286 void mat33SwapRows(struct Mat33 *A, const uint32_t i, const uint32_t j) in mat33SwapRows() argument
297 float tmp = A->elem[i][k]; in mat33SwapRows()
298 A->elem[i][k] = A->elem[j][k]; in mat33SwapRows()
299 A->elem[j][k] = tmp; in mat33SwapRows()
304 void mat33Solve(const struct Mat33 *A, struct Vec3 *x, const struct Vec3 *b, const struct Size3 *pi… in mat33Solve() argument
325 _x[k] -= _x[i] * A->elem[k][i]; in mat33Solve()
327 _x[k] /= A->elem[k][k]; in mat33Solve()
332 _x[k] -= _x[i] * A->elem[k][i]; in mat33Solve()
449 uint32_t mat33Maxind(const struct Mat33 *A, uint32_t k) in mat33Maxind() argument
458 if (fabsf(A->elem[k][i]) > fabsf(A->elem[k][m])) { in mat33Maxind()
466 void mat33Rotate(struct Mat33 *A, float c, float s, uint32_t k, uint32_t l, uint32_t i, uint32_t j) in mat33Rotate() argument
468 float tmp = c * A->elem[k][l] - s * A->elem[i][j]; in mat33Rotate()
469 A->elem[i][j] = s * A->elem[k][l] + c * A->elem[i][j]; in mat33Rotate()
470 A->elem[k][l] = tmp; in mat33Rotate()
473 void mat44Apply(struct Vec4 *out, const struct Mat44 *A, const struct Vec4 *v) in mat44Apply() argument
478 A->elem[0][0] * v->x in mat44Apply()
479 + A->elem[0][1] * v->y in mat44Apply()
480 + A->elem[0][2] * v->z in mat44Apply()
481 + A->elem[0][3] * v->w; in mat44Apply()
484 A->elem[1][0] * v->x in mat44Apply()
485 + A->elem[1][1] * v->y in mat44Apply()
486 + A->elem[1][2] * v->z in mat44Apply()
487 + A->elem[1][3] * v->w; in mat44Apply()
490 A->elem[2][0] * v->x in mat44Apply()
491 + A->elem[2][1] * v->y in mat44Apply()
492 + A->elem[2][2] * v->z in mat44Apply()
493 + A->elem[2][3] * v->w; in mat44Apply()
496 A->elem[3][0] * v->x in mat44Apply()
497 + A->elem[3][1] * v->y in mat44Apply()
498 + A->elem[3][2] * v->z in mat44Apply()
499 + A->elem[3][3] * v->w; in mat44Apply()
539 void mat44SwapRows(struct Mat44 *A, const uint32_t i, const uint32_t j) in mat44SwapRows() argument
550 float tmp = A->elem[i][k]; in mat44SwapRows()
551 A->elem[i][k] = A->elem[j][k]; in mat44SwapRows()
552 A->elem[j][k] = tmp; in mat44SwapRows()
557 void mat44Solve(const struct Mat44 *A, struct Vec4 *x, const struct Vec4 *b, const struct Size4 *pi… in mat44Solve() argument
579 _x[k] -= _x[i] * A->elem[k][i]; in mat44Solve()
581 _x[k] /= A->elem[k][k]; in mat44Solve()
586 _x[k] -= _x[i] * A->elem[k][i]; in mat44Solve()