libambix
the AMBIsonics eXchange library
|
Various utilities to handle matrices. More...
Modules | |
ambix_matrix_multiply_data() | |
Multiply a matrix with dataMultiply a [rows*cols] matrix with an array of [cols*frames] source data to get [rows*frames] dest data. | |
Functions | |
AMBIX_API ambix_matrix_t * | ambix_matrix_create (void) |
Create a matrix. More... | |
AMBIX_API void | ambix_matrix_destroy (ambix_matrix_t *mtx) |
Destroy a matrix. More... | |
AMBIX_API ambix_matrix_t * | ambix_matrix_init (uint32_t rows, uint32_t cols, ambix_matrix_t *mtx) |
Initialize a matrix. More... | |
AMBIX_API void | ambix_matrix_deinit (ambix_matrix_t *mtx) |
De-initialize a matrix. More... | |
AMBIX_API ambix_matrix_t * | ambix_matrix_fill (ambix_matrix_t *matrix, ambix_matrixtype_t type) |
Fill a matrix according to specs. More... | |
AMBIX_API ambix_err_t | ambix_matrix_fill_data (ambix_matrix_t *mtx, const float32_t *data) |
Fill a matrix with values. More... | |
AMBIX_API ambix_matrix_t * | ambix_matrix_copy (const ambix_matrix_t *src, ambix_matrix_t *dest) |
Copy a matrix to another matrix. More... | |
Various utilities to handle matrices.
AMBIX_API ambix_matrix_t* ambix_matrix_copy | ( | const ambix_matrix_t * | src, |
ambix_matrix_t * | dest | ||
) |
Copy a matrix to another matrix.
Copy a matrix, possibly resizing or creating the destination
src | the source matrix to copy the data from |
dest | the destination matrix (if NULL a new matrix will be created) |
AMBIX_API ambix_matrix_t* ambix_matrix_create | ( | void | ) |
Create a matrix.
Allocates a new (empty) matrix object. It's equivalent to calling ambix_matrix_init(0, 0, NULL) ;
AMBIX_API void ambix_matrix_deinit | ( | ambix_matrix_t * | mtx | ) |
De-initialize a matrix.
Frees associated resources and sets rows/columns to 0
mtx | matrix object to deinitialize |
AMBIX_API void ambix_matrix_destroy | ( | ambix_matrix_t * | mtx | ) |
Destroy a matrix.
Frees all resources allocated for the matrix object. It's a shortcut for ambix_matrix_deinit(mtx), free(mtx)
mtx | matrix object to destroy |
AMBIX_API ambix_matrix_t* ambix_matrix_fill | ( | ambix_matrix_t * | matrix, |
ambix_matrixtype_t | type | ||
) |
Fill a matrix according to specs.
Fill a properly initialized matrix according to type. You can use this to generate standard matrices (e.g. using AMBIX_MATRIX_ONE will set all elements of the matrix to 1.0). Since this call will not change the matrix layout (e.g. the dimension), it is the responsibility of the caller to ensure that the matrix has a proper layout for the requested type (e.g. it is an error to fill a Furse-Malham matrix into a matrix that holds more than 3rd order ambisonics).
matrix | initialized matrix object to fill |
type | data specification |
AMBIX_API ambix_err_t ambix_matrix_fill_data | ( | ambix_matrix_t * | mtx, |
const float32_t * | data | ||
) |
Fill a matrix with values.
Fill data into a properly initialized matrix
mtx | initialized matrix object to copy data into |
data | pointer to at least (mtx->rows*mtx->cols) values; data is ordered row-by-row with no padding (A[0,0], A[0,1], .., A[0,cols-1], A[1, 0], .. A[rows-1, cols-1]) |
AMBIX_API ambix_matrix_t* ambix_matrix_init | ( | uint32_t | rows, |
uint32_t | cols, | ||
ambix_matrix_t * | mtx | ||
) |
Initialize a matrix.
Allocates memory for matrix-data of given dimensions
rows | number of rows in the newly initialized matrix |
cols | number of columns in the newly initialized matrix |
mtx | pointer to a matrix object; if NULL a new matrix object will be created, else the given matrix object will be re-initialized. |