|
matd_t * | matd_add (const matd_t *a, const matd_t *b) |
|
void | matd_add_inplace (matd_t *a, const matd_t *b) |
|
matd_chol_t * | matd_chol (matd_t *A) |
|
void | matd_chol_destroy (matd_chol_t *chol) |
|
matd_t * | matd_chol_inverse (matd_t *a) |
|
matd_t * | matd_chol_solve (const matd_chol_t *chol, const matd_t *b) |
|
matd_t * | matd_copy (const matd_t *m) |
|
matd_t * | matd_create (int rows, int cols) |
|
matd_t * | matd_create_data (int rows, int cols, const TYPE *data) |
|
matd_t * | matd_create_dataf (int rows, int cols, const float *data) |
|
matd_t * | matd_create_scalar (TYPE v) |
|
matd_t * | matd_crossproduct (const matd_t *a, const matd_t *b) |
|
void | matd_destroy (matd_t *m) |
|
double | matd_det (const matd_t *a) |
|
static double | matd_det_general (const matd_t *a) |
|
TYPE | matd_err_inf (const matd_t *a, const matd_t *b) |
|
TYPE | matd_get (const matd_t *m, int row, int col) |
|
TYPE | matd_get_scalar (const matd_t *m) |
|
matd_t * | matd_identity (int dim) |
|
matd_t * | matd_inverse (const matd_t *x) |
|
void | matd_ltransposetriangle_solve (matd_t *u, const TYPE *b, TYPE *x) |
|
void | matd_ltriangle_solve (matd_t *L, const TYPE *b, TYPE *x) |
|
double | matd_max (matd_t *m) |
|
matd_t * | matd_multiply (const matd_t *a, const matd_t *b) |
|
matd_t * | matd_op (const char *expr,...) |
|
static matd_t * | matd_op_gobble_right (const char *expr, int *pos, matd_t *acc, matd_t **garb, int *garbpos) |
|
static matd_t * | matd_op_recurse (const char *expr, int *pos, matd_t *acc, matd_t **args, int *argpos, matd_t **garb, int *garbpos, int oneterm) |
|
matd_plu_t * | matd_plu (const matd_t *a) |
|
void | matd_plu_destroy (matd_plu_t *mlu) |
|
double | matd_plu_det (const matd_plu_t *mlu) |
|
matd_t * | matd_plu_l (const matd_plu_t *mlu) |
|
matd_t * | matd_plu_p (const matd_plu_t *mlu) |
|
matd_t * | matd_plu_solve (const matd_plu_t *mlu, const matd_t *b) |
|
matd_t * | matd_plu_u (const matd_plu_t *mlu) |
|
void | matd_print (const matd_t *m, const char *fmt) |
|
void | matd_print_transpose (const matd_t *m, const char *fmt) |
|
void | matd_put (matd_t *m, int row, int col, TYPE value) |
|
void | matd_put_scalar (matd_t *m, TYPE value) |
|
matd_t * | matd_scale (const matd_t *a, double s) |
|
void | matd_scale_inplace (matd_t *a, double s) |
|
matd_t * | matd_select (const matd_t *a, int r0, int r1, int c0, int c1) |
|
matd_t * | matd_solve (matd_t *A, matd_t *b) |
|
matd_t * | matd_subtract (const matd_t *a, const matd_t *b) |
|
void | matd_subtract_inplace (matd_t *a, const matd_t *b) |
|
matd_svd_t | matd_svd (matd_t *A) |
|
matd_svd_t | matd_svd_flags (matd_t *A, int flags) |
|
static matd_svd_t | matd_svd_tall (matd_t *A, int flags) |
|
matd_t * | matd_transpose (const matd_t *a) |
|
void | matd_utriangle_solve (matd_t *u, const TYPE *b, TYPE *x) |
|
double | matd_vec_dist (const matd_t *a, const matd_t *b) |
|
double | matd_vec_dist_n (const matd_t *a, const matd_t *b, int n) |
|
double | matd_vec_dot_product (const matd_t *a, const matd_t *b) |
|
double | matd_vec_mag (const matd_t *a) |
|
matd_t * | matd_vec_normalize (const matd_t *a) |
|
static int | max_idx (const matd_t *A, int row, int maxcol) |
|
Attempts to compute an inverse of the supplied matrix 'a' and return it as a new matrix. This is strictly only possible if the determinant of 'a' is non-zero (matd_det(a) != 0).
If the determinant is zero, NULL is returned. It is otherwise the caller's responsibility to cope with the results caused by poorly conditioned matrices. (E.g.., if such a situation is likely to arise, compute the pseudo-inverse from the SVD.)
Definition at line 481 of file matd.c.
matd_t* matd_op |
( |
const char * |
expr, |
|
|
|
... |
|
) |
| |
Creates a new matrix by applying a series of matrix operations, as expressed in 'expr', to the supplied list of matrices. Each matrix to be operated upon must be represented in the expression by a separate matrix placeholder, 'M', and there must be one matrix supplied as an argument for each matrix placeholder in the expression. All rules and caveats of the corresponding matrix operations apply to the operated-on matrices. It is the caller's responsibility to call matd_destroy() on the returned matrix.
Available operators (in order of increasing precedence): M+M add two matrices together M-M subtract one matrix from another M*M multiply two matrices together (matrix product) MM multiply two matrices together (matrix product) -M negate a matrix M^-1 take the inverse of a matrix M' take the transpose of a matrix
Expressions can be combined together and grouped by enclosing them in parenthesis, i.e.: -M(M+M+M)-(M*M)^-1
Scalar values can be generated on-the-fly, i.e.: M*2.2 scales M by 2.2 -2+M adds -2 to all elements of M
All whitespace in the expression is ignored.
Definition at line 794 of file matd.c.
matd_t* matd_select |
( |
const matd_t * |
a, |
|
|
int |
r0, |
|
|
int |
r1, |
|
|
int |
c0, |
|
|
int |
c1 |
|
) |
| |
Creates a copy of a subset of the supplied matrix 'a'. The subset will include rows 'r0' through 'r1', inclusive ('r1' >= 'r0'), and columns 'c0' through 'c1', inclusive ('c1' >= 'c0'). All parameters are zero-based (i.e. matd_select(a, 0, 0, 0, 0) will return only the first cell). Cannot be used on scalars or to extend beyond the number of rows/columns of 'a'. It is the caller's responsibility to call matd_destroy() on the returned matrix.
Definition at line 167 of file matd.c.
Compute a complete SVD of a matrix. The SVD exists for all matrices. For a matrix MxN, we will have:
A = U*S*V'
where A is MxN, U is MxM (and is an orthonormal basis), S is MxN (and is diagonal up to machine precision), and V is NxN (and is an orthonormal basis).
The caller is responsible for destroying U, S, and V.
Definition at line 1459 of file matd.c.