|
#define | max(a, b) (((a) > (b)) ? (a) : (b)) |
|
#define | min(a, b) (((a) < (b)) ? (a) : (b)) |
|
#define | sign(x) ((x) > 0 ? 1: ((x) == 0 ? 0: (-1))) |
|
|
I32 | lu_inverse (vcmat *A, vcmat *y, F64 *det) |
| Calculate the inverse of a n×n-matrix using the LU decomposition. More...
|
|
I32 | lu_det (vcmat *A, F64 *det) |
| Calculate the determinant of A n×n-matrix using the LU decomposition. More...
|
|
I32 | vc_QR_solve (vcmat *A, vcvec *y, vcvec *x) |
| Solve a system of linear equations using the Householder QR factorization. More...
|
|
Functions in this group provide concepts like matrix, vector, ...
◆ max
#define max |
( |
|
a, |
|
|
|
b |
|
) |
| (((a) > (b)) ? (a) : (b)) |
Outputs the maximum of a
and b
.
◆ min
#define min |
( |
|
a, |
|
|
|
b |
|
) |
| (((a) < (b)) ? (a) : (b)) |
Outputs the minimum of a
and b
.
◆ sign
#define sign |
( |
|
x | ) |
((x) > 0 ? 1: ((x) == 0 ? 0: (-1))) |
Outputs the sign of x
, either 1, 0 or -1.
◆ lu_inverse()
I32 lu_inverse |
( |
vcmat * |
A, |
|
|
vcmat * |
y, |
|
|
F64 * |
det |
|
) |
| |
The function calculates the inverse of the n×n-matrix a
and outputs the result in matrix y
. The function may be called in-place, i.e. a
and y
may be the same matrix. The function returns an error if the size of the matrices is not square and not identical. The determinant of the matrix det
is output as a F64 value although possibly only calculated as a float value depending ont the type of a
.
- Parameters
-
A | source matrix |
y | destination matrix |
det | determinant of A (output) |
◆ lu_det()
I32 lu_det |
( |
vcmat * |
A, |
|
|
F64 * |
det |
|
) |
| |
The function calculates the determinant of the n×n matrix A
. The function returns an error if the size of the matrix is not square. The determinant of the matrix det
is output as a F64 value although possibly only calculated as a float value depending ont the type of A
.
- Parameters
-
A | source matrix |
det | determinant of A (output) |
◆ vc_QR_solve()
I32 vc_QR_solve |
( |
vcmat * |
A, |
|
|
vcvec * |
y, |
|
|
vcvec * |
x |
|
) |
| |
The QR factorization using the Householder transform is a numerically stable tool for linear least square approximations.
See: Stoer, J "Einfuehrung in die Numerische Mathematik I" pp 164ff, Springer, 1976
The function solves the linear system ||Ax - y|| = min
- Parameters
-
A | source matrix (dimensions m * n) |
y | input vector (m) |
x | solution vector (n) |
det | determinant of a (output) |
- See also
- qr_househ_F64, qr_backs_F64().