JWS C Library
C language utility library
|
Definitions for a matrix and associated functions. More...
#include <jwsc/config.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include <inttypes.h>
#include "jwsc/base/error.h"
#include "jwsc/math/complex.h"
#include "jwsc/math/blas.h"
#include "jwsc/vector/vector.h"
#include "jwsc/matrix/matrix.h"
Go to the source code of this file.
Functions | |
create_matrix | |
Creates a matrix of integer or floating point values. | |
void | create_matrix_u32 (Matrix_u32 **m_out, uint32_t num_rows, uint32_t num_cols) |
32-bit unsigned integer. | |
void | create_matrix_i32 (Matrix_i32 **m_out, uint32_t num_rows, uint32_t num_cols) |
32-bit signed integer. | |
void | create_matrix_i64 (Matrix_i64 **m_out, uint32_t num_rows, uint32_t num_cols) |
64-bit signed integer. | |
void | create_matrix_f (Matrix_f **m_out, uint32_t num_rows, uint32_t num_cols) |
Single precision floating point. | |
void | create_matrix_d (Matrix_d **m_out, uint32_t num_rows, uint32_t num_cols) |
Double precision floating point. | |
void | create_matrix_cf (Matrix_cf **m_out, uint32_t num_rows, uint32_t num_cols) |
Single precision complex floating point. | |
void | create_matrix_cd (Matrix_cd **m_out, uint32_t num_rows, uint32_t num_cols) |
Double precision complexfloating point. | |
create_init_matrix | |
Creates and initializes a matrix of integer or floating point values. | |
void | create_init_matrix_u32 (Matrix_u32 **m_out, uint32_t num_rows, uint32_t num_cols, uint32_t val) |
32-bit unsigned integer. | |
void | create_init_matrix_i32 (Matrix_i32 **m_out, uint32_t num_rows, uint32_t num_cols, int32_t val) |
32-bit signed integer. | |
void | create_init_matrix_i64 (Matrix_i64 **m_out, uint32_t num_rows, uint32_t num_cols, int64_t val) |
64-bit signed integer. | |
void | create_init_matrix_f (Matrix_f **m_out, uint32_t num_rows, uint32_t num_cols, float val) |
Single precision floating point. | |
void | create_init_matrix_d (Matrix_d **m_out, uint32_t num_rows, uint32_t num_cols, double val) |
Double precision floating point. | |
void | create_init_matrix_cf (Matrix_cf **m_out, uint32_t num_rows, uint32_t num_cols, Complex_f val) |
Single precision complex floating point. | |
void | create_init_matrix_cd (Matrix_cd **m_out, uint32_t num_rows, uint32_t num_cols, Complex_d val) |
Double precision complexfloating point. | |
create_identity_matrix | |
Creates a square matrix of integer or floating point values and initializes it with zeros and a diagonal of ones. | |
void | create_identity_matrix_u32 (Matrix_u32 **m_out, uint32_t size) |
32-bit unsigned integer. | |
void | create_identity_matrix_i32 (Matrix_i32 **m_out, uint32_t size) |
32-bit signed integer. | |
void | create_identity_matrix_i64 (Matrix_i64 **m_out, uint32_t size) |
64-bit signed integer. | |
void | create_identity_matrix_f (Matrix_f **m_out, uint32_t size) |
Single precision floating point. | |
void | create_identity_matrix_d (Matrix_d **m_out, uint32_t size) |
Double precision floating point. | |
create_zero_matrix | |
Creates a matrix of integer or floating point values and initializes it with zeros. | |
void | create_zero_matrix_u32 (Matrix_u32 **m_out, uint32_t num_rows, uint32_t num_cols) |
32-bit unsigned integer. | |
void | create_zero_matrix_i32 (Matrix_i32 **m_out, uint32_t num_rows, uint32_t num_cols) |
32-bit signed integer. | |
void | create_zero_matrix_i64 (Matrix_i64 **m_out, uint32_t num_rows, uint32_t num_cols) |
64-bit signed integer. | |
void | create_zero_matrix_f (Matrix_f **m_out, uint32_t num_rows, uint32_t num_cols) |
Single precision floating point. | |
void | create_zero_matrix_d (Matrix_d **m_out, uint32_t num_rows, uint32_t num_cols) |
Double precision floating point. | |
void | create_zero_matrix_cf (Matrix_cf **m_out, uint32_t num_rows, uint32_t num_cols) |
Single precision complex floating point. | |
void | create_zero_matrix_cd (Matrix_cd **m_out, uint32_t num_rows, uint32_t num_cols) |
Double precision complexfloating point. | |
create_diagonal_matrix | |
Creates a square matrix of integer or floating point values and initializes its diagonal using values from a vector. | |
void | create_diagnonal_matrix_u32 (Matrix_u32 **m_out, const Vector_u32 *v) |
32-bit unsigned integer. | |
void | create_diagonal_matrix_i32 (Matrix_i32 **m_out, const Vector_i32 *v) |
32-bit signed integer. | |
void | create_diagonal_matrix_i64 (Matrix_i64 **m_out, const Vector_i64 *v) |
64-bit signed integer. | |
void | create_diagonal_matrix_f (Matrix_f **m_out, const Vector_f *v) |
Single precision floating point. | |
void | create_diagonal_matrix_d (Matrix_d **m_out, const Vector_d *v) |
Double precision floating point. | |
void | create_diagonal_matrix_cf (Matrix_cf **m_out, const Vector_cf *v) |
Single precision complex floating point. | |
void | create_diagonal_matrix_cd (Matrix_cd **m_out, const Vector_cd *v) |
Double precision complexfloating point. | |
create_random_matrix | |
Creates a matrix of integer or floating point values and initializes it with random values. | |
void | create_random_matrix_u32 (Matrix_u32 **m_out, uint32_t num_rows, uint32_t num_cols, uint32_t min, uint32_t max) |
32-bit unsigned integer. | |
void | create_random_matrix_i32 (Matrix_i32 **m_out, uint32_t num_rows, uint32_t num_cols, int32_t min, int32_t max) |
32-bit signed integer. | |
void | create_random_matrix_i64 (Matrix_i64 **m_out, uint32_t num_rows, uint32_t num_cols, int64_t min, int64_t max) |
64-bit signed integer. | |
void | create_random_matrix_f (Matrix_f **m_out, uint32_t num_rows, uint32_t num_cols, float min, float max) |
Single precision floating point. | |
void | create_random_matrix_d (Matrix_d **m_out, uint32_t num_rows, uint32_t num_cols, double min, double max) |
Double precision floating point. | |
void | create_random_matrix_cf (Matrix_cf **m_out, uint32_t num_rows, uint32_t num_cols, Complex_f min, Complex_f max) |
Single precision complex floating point. | |
void | create_random_matrix_cd (Matrix_cd **m_out, uint32_t num_rows, uint32_t num_cols, Complex_d min, Complex_d max) |
Double precision complexfloating point. | |
copy_matrix | |
Copies a matrix into another. | |
Error * | copy_matrix_u32 (Matrix_u32 **m_out, const Matrix_u32 *m_in) |
32-bit unsigned integer. | |
Error * | copy_matrix_i32 (Matrix_i32 **m_out, const Matrix_i32 *m_in) |
32-bit signed integer. | |
Error * | copy_matrix_i64 (Matrix_i64 **m_out, const Matrix_i64 *m_in) |
64-bit signed integer. | |
Error * | copy_matrix_f (Matrix_f **m_out, const Matrix_f *m_in) |
Single precision floating point. | |
Error * | copy_matrix_d (Matrix_d **m_out, const Matrix_d *m_in) |
Double precision floating point. | |
Error * | copy_matrix_cf (Matrix_cf **m_out, const Matrix_cf *m_in) |
Single precision complex floating point. | |
Error * | copy_matrix_cd (Matrix_cd **m_out, const Matrix_cd *m_in) |
Double precision complex floating point. | |
copy_matrix_block | |
Copies a block of a matrix. | |
Error * | copy_matrix_block_u32 (Matrix_u32 **m_out, const Matrix_u32 *m_in, uint32_t row_offset, uint32_t col_offset, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a 32-bit unsigned integer matrix. | |
Error * | copy_matrix_block_i32 (Matrix_i32 **m_out, const Matrix_i32 *m_in, uint32_t row_offset, uint32_t col_offset, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a 32-bit signed integer matrix. | |
Error * | copy_matrix_block_i64 (Matrix_i64 **m_out, const Matrix_i64 *m_in, uint32_t row_offset, uint32_t col_offset, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a 64-bit signed integer matrix. | |
Error * | copy_matrix_block_f (Matrix_f **m_out, const Matrix_f *m_in, uint32_t row_offset, uint32_t col_offset, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a single precision floating point matrix. | |
Error * | copy_matrix_block_d (Matrix_d **m_out, const Matrix_d *m_in, uint32_t row_offset, uint32_t col_offset, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a double precision floating point matrix. | |
Error * | copy_matrix_block_cf (Matrix_cf **m_out, const Matrix_cf *m_in, uint32_t row_offset, uint32_t col_offset, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a single precision complex floating point matrix. | |
Error * | copy_matrix_block_cd (Matrix_cd **m_out, const Matrix_cd *m_in, uint32_t row_offset, uint32_t col_offset, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a double precision complex floating point matrix. | |
copy_matrix_block_into_matrix | |
Copies a block of a matrix. | |
Error * | copy_matrix_block_into_matrix_u32 (Matrix_u32 *m_1, uint32_t row_offset_1, uint32_t col_offset_1, const Matrix_u32 *m_2, uint32_t row_offset_2, uint32_t col_offset_2, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a 32-bit unsigned integer matrix into another. | |
Error * | copy_matrix_block_into_matrix_i32 (Matrix_i32 *m_1, uint32_t row_offset_1, uint32_t col_offset_1, const Matrix_i32 *m_2, uint32_t row_offset_2, uint32_t col_offset_2, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a 32-bit signed integer matrix into another. | |
Error * | copy_matrix_block_into_matrix_i64 (Matrix_i64 *m_1, uint32_t row_offset_1, uint32_t col_offset_1, const Matrix_i64 *m_2, uint32_t row_offset_2, uint32_t col_offset_2, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a 64-bit signed integer matrix into another. | |
Error * | copy_matrix_block_into_matrix_f (Matrix_f *m_1, uint32_t row_offset_1, uint32_t col_offset_1, const Matrix_f *m_2, uint32_t row_offset_2, uint32_t col_offset_2, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a single precision floating point matrix into another. | |
Error * | copy_matrix_block_into_matrix_d (Matrix_d *m_1, uint32_t row_offset_1, uint32_t col_offset_1, const Matrix_d *m_2, uint32_t row_offset_2, uint32_t col_offset_2, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a double precision floating point matrix into another. | |
Error * | copy_matrix_block_into_matrix_cf (Matrix_cf *m_1, uint32_t row_offset_1, uint32_t col_offset_1, const Matrix_cf *m_2, uint32_t row_offset_2, uint32_t col_offset_2, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a single precision complex floating point matrix into another. | |
Error * | copy_matrix_block_into_matrix_cd (Matrix_cd *m_1, uint32_t row_offset_1, uint32_t col_offset_1, const Matrix_cd *m_2, uint32_t row_offset_2, uint32_t col_offset_2, uint32_t num_rows, uint32_t num_cols) |
Copies a block of a double precision complex floating point matrix into another. | |
copy_vector_into_matrix | |
Copies a vector into a matrix. | |
Error * | copy_vector_into_matrix_u32 (Matrix_u32 **m_out, const Matrix_u32 *m_in, const Vector_u32 *v, Matrix_vector orient, uint32_t index) |
Copies a 32-bit unsigned integer vector into a matrix. | |
Error * | copy_vector_into_matrix_i32 (Matrix_i32 **m_out, const Matrix_i32 *m_in, const Vector_i32 *v, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector into a matrix. | |
Error * | copy_vector_into_matrix_i64 (Matrix_i64 **m_out, const Matrix_i64 *m_in, const Vector_i64 *v, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector into a matrix. | |
Error * | copy_vector_into_matrix_f (Matrix_f **m_out, const Matrix_f *m_in, const Vector_f *v, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector into a matrix. | |
Error * | copy_vector_into_matrix_d (Matrix_d **m_out, const Matrix_d *m_in, const Vector_d *v, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector into a matrix. | |
Error * | copy_vector_into_matrix_cf (Matrix_cf **m_out, const Matrix_cf *m_in, const Vector_cf *v, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector into a matrix. | |
Error * | copy_vector_into_matrix_cd (Matrix_cd **m_out, const Matrix_cd *m_in, const Vector_cd *v, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector into a matrix. | |
copy_vector_from_matrix | |
Copies a vector from a matrix. | |
Error * | copy_vector_from_matrix_u32 (Vector_u32 **v_out, const Matrix_u32 *m, Matrix_vector orient, uint32_t index) |
Copies a 32-bit unsigned integer vector from a matrix. | |
Error * | copy_vector_from_matrix_i32 (Vector_i32 **v_out, const Matrix_i32 *m, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector from a matrix. | |
Error * | copy_vector_from_matrix_i64 (Vector_i64 **v_out, const Matrix_i64 *m, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector from a matrix. | |
Error * | copy_vector_from_matrix_f (Vector_f **v_out, const Matrix_f *m, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector from a matrix. | |
Error * | copy_vector_from_matrix_d (Vector_d **v_out, const Matrix_d *m, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector from a matrix. | |
Error * | copy_vector_from_matrix_cf (Vector_cf **v_out, const Matrix_cf *m, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector from a matrix. | |
Error * | copy_vector_from_matrix_cd (Vector_cd **v_out, const Matrix_cd *m, Matrix_vector orient, uint32_t index) |
Copies a 32-bit signed integer vector from a matrix. | |
free_matrix | |
Frees a matrix. | |
void | free_matrix_u32 (Matrix_u32 *m) |
Frees a 32-bit unsigned integer matrix. | |
void | free_matrix_i32 (Matrix_i32 *m) |
Frees a 32-bit signed integer matrix. | |
void | free_matrix_i64 (Matrix_i64 *m) |
Frees a 64-bit signed integer matrix. | |
void | free_matrix_f (Matrix_f *m) |
Frees a single precision floating point matrix. | |
void | free_matrix_d (Matrix_d *m) |
Frees a double precision floating point matrix. | |
void | free_matrix_cf (Matrix_cf *m) |
Frees a single precision complex floating point matrix. | |
void | free_matrix_cd (Matrix_cd *m) |
Frees a double precision complex floating point matrix. |
Definitions for a matrix and associated functions.
The matrix holds integers and floating point real and complex numbers.
Although the matrix is indexed by row and column, the elements are allocated as a 1D array in row-major order. So iterating over the elements can be done inside a single loop.
Some of the functions are accelerated if linked against an optimized BLAS library.
Definition in file matrix.c.
void create_matrix_u32 | ( | Matrix_u32 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_matrix_i32 | ( | Matrix_i32 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_matrix_i64 | ( | Matrix_i64 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_matrix_f | ( | Matrix_f ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_matrix_d | ( | Matrix_d ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_matrix_cf | ( | Matrix_cf ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_matrix_cd | ( | Matrix_cd ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_init_matrix_u32 | ( | Matrix_u32 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
uint32_t | val | ||
) |
32-bit unsigned integer.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
val | Value to initialize all elements of the matrix with. |
void create_init_matrix_i32 | ( | Matrix_i32 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
int32_t | val | ||
) |
32-bit signed integer.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
val | Value to initialize all elements of the matrix with. |
void create_init_matrix_i64 | ( | Matrix_i64 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
int64_t | val | ||
) |
64-bit signed integer.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
val | Value to initialize all elements of the matrix with. |
void create_init_matrix_f | ( | Matrix_f ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
float | val | ||
) |
Single precision floating point.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
val | Value to initialize all elements of the matrix with. |
void create_init_matrix_d | ( | Matrix_d ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
double | val | ||
) |
Double precision floating point.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
val | Value to initialize all elements of the matrix with. |
void create_init_matrix_cf | ( | Matrix_cf ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
Complex_f | val | ||
) |
Single precision complex floating point.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
val | Value to initialize all elements of the matrix with. |
void create_init_matrix_cd | ( | Matrix_cd ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
Complex_d | val | ||
) |
Double precision complexfloating point.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
val | Value to initialize all elements of the matrix with. |
void create_identity_matrix_u32 | ( | Matrix_u32 ** | m_out, |
uint32_t | size | ||
) |
void create_identity_matrix_i32 | ( | Matrix_i32 ** | m_out, |
uint32_t | size | ||
) |
void create_identity_matrix_i64 | ( | Matrix_i64 ** | m_out, |
uint32_t | size | ||
) |
void create_identity_matrix_f | ( | Matrix_f ** | m_out, |
uint32_t | size | ||
) |
void create_identity_matrix_d | ( | Matrix_d ** | m_out, |
uint32_t | size | ||
) |
void create_zero_matrix_u32 | ( | Matrix_u32 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_zero_matrix_i32 | ( | Matrix_i32 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_zero_matrix_i64 | ( | Matrix_i64 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_zero_matrix_f | ( | Matrix_f ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_zero_matrix_d | ( | Matrix_d ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_zero_matrix_cf | ( | Matrix_cf ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_zero_matrix_cd | ( | Matrix_cd ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
void create_diagnonal_matrix_u32 | ( | Matrix_u32 ** | m_out, |
const Vector_u32 * | v | ||
) |
void create_diagonal_matrix_i32 | ( | Matrix_i32 ** | m_out, |
const Vector_i32 * | v | ||
) |
void create_diagonal_matrix_i64 | ( | Matrix_i64 ** | m_out, |
const Vector_i64 * | v | ||
) |
void create_random_matrix_u32 | ( | Matrix_u32 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
uint32_t | min, | ||
uint32_t | max | ||
) |
32-bit unsigned integer.
Calls rand() to generate the random numbers.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
min | Minimum random value. |
max | Maximum random value. |
void create_random_matrix_i32 | ( | Matrix_i32 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
int32_t | min, | ||
int32_t | max | ||
) |
32-bit signed integer.
Calls rand() to generate the random numbers.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
min | Minimum random value. |
max | Maximum random value. |
void create_random_matrix_i64 | ( | Matrix_i64 ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
int64_t | min, | ||
int64_t | max | ||
) |
64-bit signed integer.
Calls rand() to generate the random numbers.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
min | Minimum random value. |
max | Maximum random value. |
void create_random_matrix_f | ( | Matrix_f ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
float | min, | ||
float | max | ||
) |
Single precision floating point.
Calls rand() to generate the random numbers.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
min | Minimum random value. |
max | Maximum random value. |
void create_random_matrix_d | ( | Matrix_d ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
double | min, | ||
double | max | ||
) |
Double precision floating point.
Calls rand() to generate the random numbers.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
min | Minimum random value. |
max | Maximum random value. |
void create_random_matrix_cf | ( | Matrix_cf ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
Complex_f | min, | ||
Complex_f | max | ||
) |
Single precision complex floating point.
Calls rand() to generate the random numbers.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
min | Minimum random value. |
max | Maximum random value. |
void create_random_matrix_cd | ( | Matrix_cd ** | m_out, |
uint32_t | num_rows, | ||
uint32_t | num_cols, | ||
Complex_d | min, | ||
Complex_d | max | ||
) |
Double precision complexfloating point.
Calls rand() to generate the random numbers.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
num_rows | Number of rows in the matrix. |
num_cols | Number of columns in the matrix. |
min | Minimum random value. |
max | Maximum random value. |
Error* copy_matrix_u32 | ( | Matrix_u32 ** | m_out, |
const Matrix_u32 * | m_in | ||
) |
32-bit unsigned integer.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy. |
Error* copy_matrix_i32 | ( | Matrix_i32 ** | m_out, |
const Matrix_i32 * | m_in | ||
) |
32-bit signed integer.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy. |
Error* copy_matrix_i64 | ( | Matrix_i64 ** | m_out, |
const Matrix_i64 * | m_in | ||
) |
64-bit signed integer.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy. |
Single precision floating point.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy. |
Double precision floating point.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy. |
Single precision complex floating point.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy. |
Double precision complex floating point.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy. |
Error* copy_matrix_block_u32 | ( | Matrix_u32 ** | m_out, |
const Matrix_u32 * | m_in, | ||
uint32_t | row_offset, | ||
uint32_t | col_offset, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a 32-bit unsigned integer matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy a section from. |
row_offset | Position of first row to begin copying from. |
col_offset | Position of first column to begin copying from. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_i32 | ( | Matrix_i32 ** | m_out, |
const Matrix_i32 * | m_in, | ||
uint32_t | row_offset, | ||
uint32_t | col_offset, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a 32-bit signed integer matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy a section from. |
row_offset | Position of first row to begin copying from. |
col_offset | Position of first column to begin copying from. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_i64 | ( | Matrix_i64 ** | m_out, |
const Matrix_i64 * | m_in, | ||
uint32_t | row_offset, | ||
uint32_t | col_offset, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a 64-bit signed integer matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy a section from. |
row_offset | Position of first row to begin copying from. |
col_offset | Position of first column to begin copying from. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_f | ( | Matrix_f ** | m_out, |
const Matrix_f * | m_in, | ||
uint32_t | row_offset, | ||
uint32_t | col_offset, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a single precision floating point matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy a section from. |
row_offset | Position of first row to begin copying from. |
col_offset | Position of first column to begin copying from. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_d | ( | Matrix_d ** | m_out, |
const Matrix_d * | m_in, | ||
uint32_t | row_offset, | ||
uint32_t | col_offset, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a double precision floating point matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy a section from. |
row_offset | Position of first row to begin copying from. |
col_offset | Position of first column to begin copying from. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_cf | ( | Matrix_cf ** | m_out, |
const Matrix_cf * | m_in, | ||
uint32_t | row_offset, | ||
uint32_t | col_offset, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a single precision complex floating point matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy a section from. |
row_offset | Position of first row to begin copying from. |
col_offset | Position of first column to begin copying from. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_cd | ( | Matrix_cd ** | m_out, |
const Matrix_cd * | m_in, | ||
uint32_t | row_offset, | ||
uint32_t | col_offset, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a double precision complex floating point matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to copy a section from. |
row_offset | Position of first row to begin copying from. |
col_offset | Position of first column to begin copying from. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_into_matrix_u32 | ( | Matrix_u32 * | m_1, |
uint32_t | row_offset_1, | ||
uint32_t | col_offset_1, | ||
const Matrix_u32 * | m_2, | ||
uint32_t | row_offset_2, | ||
uint32_t | col_offset_2, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a 32-bit unsigned integer matrix into another.
m_1 | Matrix to copy the block into. |
row_offset_1 | Position of first row to copy into m_1. |
col_offset_1 | Position of first column to copy into m_1. |
m_2 | Matrix to copy the block from. |
row_offset_2 | Position of first row to copy from m_2. |
col_offset_2 | Position of first column to copy from m_2. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_into_matrix_i32 | ( | Matrix_i32 * | m_1, |
uint32_t | row_offset_1, | ||
uint32_t | col_offset_1, | ||
const Matrix_i32 * | m_2, | ||
uint32_t | row_offset_2, | ||
uint32_t | col_offset_2, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a 32-bit signed integer matrix into another.
m_1 | Matrix to copy the block into. |
row_offset_1 | Position of first row to copy into m_1. |
col_offset_1 | Position of first column to copy into m_1. |
m_2 | Matrix to copy the block from. |
row_offset_2 | Position of first row to copy from m_2. |
col_offset_2 | Position of first column to copy from m_2. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_into_matrix_i64 | ( | Matrix_i64 * | m_1, |
uint32_t | row_offset_1, | ||
uint32_t | col_offset_1, | ||
const Matrix_i64 * | m_2, | ||
uint32_t | row_offset_2, | ||
uint32_t | col_offset_2, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a 64-bit signed integer matrix into another.
m_1 | Matrix to copy the block into. |
row_offset_1 | Position of first row to copy into m_1. |
col_offset_1 | Position of first column to copy into m_1. |
m_2 | Matrix to copy the block from. |
row_offset_2 | Position of first row to copy from m_2. |
col_offset_2 | Position of first column to copy from m_2. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_into_matrix_f | ( | Matrix_f * | m_1, |
uint32_t | row_offset_1, | ||
uint32_t | col_offset_1, | ||
const Matrix_f * | m_2, | ||
uint32_t | row_offset_2, | ||
uint32_t | col_offset_2, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a single precision floating point matrix into another.
m_1 | Matrix to copy the block into. |
row_offset_1 | Position of first row to copy into m_1. |
col_offset_1 | Position of first column to copy into m_1. |
m_2 | Matrix to copy the block from. |
row_offset_2 | Position of first row to copy from m_2. |
col_offset_2 | Position of first column to copy from m_2. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_into_matrix_d | ( | Matrix_d * | m_1, |
uint32_t | row_offset_1, | ||
uint32_t | col_offset_1, | ||
const Matrix_d * | m_2, | ||
uint32_t | row_offset_2, | ||
uint32_t | col_offset_2, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a double precision floating point matrix into another.
m_1 | Matrix to copy the block into. |
row_offset_1 | Position of first row to copy into m_1. |
col_offset_1 | Position of first column to copy into m_1. |
m_2 | Matrix to copy the block from. |
row_offset_2 | Position of first row to copy from m_2. |
col_offset_2 | Position of first column to copy from m_2. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_into_matrix_cf | ( | Matrix_cf * | m_1, |
uint32_t | row_offset_1, | ||
uint32_t | col_offset_1, | ||
const Matrix_cf * | m_2, | ||
uint32_t | row_offset_2, | ||
uint32_t | col_offset_2, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a single precision complex floating point matrix into another.
m_1 | Matrix to copy the block into. |
row_offset_1 | Position of first row to copy into m_1. |
col_offset_1 | Position of first column to copy into m_1. |
m_2 | Matrix to copy the block from. |
row_offset_2 | Position of first row to copy from m_2. |
col_offset_2 | Position of first column to copy from m_2. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_matrix_block_into_matrix_cd | ( | Matrix_cd * | m_1, |
uint32_t | row_offset_1, | ||
uint32_t | col_offset_1, | ||
const Matrix_cd * | m_2, | ||
uint32_t | row_offset_2, | ||
uint32_t | col_offset_2, | ||
uint32_t | num_rows, | ||
uint32_t | num_cols | ||
) |
Copies a block of a double precision complex floating point matrix into another.
m_1 | Matrix to copy the block into. |
row_offset_1 | Position of first row to copy into m_1. |
col_offset_1 | Position of first column to copy into m_1. |
m_2 | Matrix to copy the block from. |
row_offset_2 | Position of first row to copy from m_2. |
col_offset_2 | Position of first column to copy from m_2. |
num_rows | Number of rows to copy. |
num_cols | Number of columns to copy. |
Error* copy_vector_into_matrix_u32 | ( | Matrix_u32 ** | m_out, |
const Matrix_u32 * | m_in, | ||
const Vector_u32 * | v, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit unsigned integer vector into a matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to copy a vector into. |
v | Vector to copy into the matrix. |
orient | Orientation of the vector to copy into the matrix. |
index | Index along the orientation dimension to copy the vector into the matrix. |
Error* copy_vector_into_matrix_i32 | ( | Matrix_i32 ** | m_out, |
const Matrix_i32 * | m_in, | ||
const Vector_i32 * | v, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector into a matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to copy a vector into. |
v | Vector to copy into the matrix. |
orient | Orientation of the vector to copy into the matrix. |
index | Index along the orientation dimension to copy the vector into the matrix. |
Error* copy_vector_into_matrix_i64 | ( | Matrix_i64 ** | m_out, |
const Matrix_i64 * | m_in, | ||
const Vector_i64 * | v, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector into a matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to copy a vector into. |
v | Vector to copy into the matrix. |
orient | Orientation of the vector to copy into the matrix. |
index | Index along the orientation dimension to copy the vector into the matrix. |
Error* copy_vector_into_matrix_f | ( | Matrix_f ** | m_out, |
const Matrix_f * | m_in, | ||
const Vector_f * | v, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector into a matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to copy a vector into. |
v | Vector to copy into the matrix. |
orient | Orientation of the vector to copy into the matrix. |
index | Index along the orientation dimension to copy the vector into the matrix. |
Error* copy_vector_into_matrix_d | ( | Matrix_d ** | m_out, |
const Matrix_d * | m_in, | ||
const Vector_d * | v, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector into a matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to copy a vector into. |
v | Vector to copy into the matrix. |
orient | Orientation of the vector to copy into the matrix. |
index | Index along the orientation dimension to copy the vector into the matrix. |
Error* copy_vector_into_matrix_cf | ( | Matrix_cf ** | m_out, |
const Matrix_cf * | m_in, | ||
const Vector_cf * | v, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector into a matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to copy a vector into. |
v | Vector to copy into the matrix. |
orient | Orientation of the vector to copy into the matrix. |
index | Index along the orientation dimension to copy the vector into the matrix. |
Error* copy_vector_into_matrix_cd | ( | Matrix_cd ** | m_out, |
const Matrix_cd * | m_in, | ||
const Vector_cd * | v, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector into a matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to copy a vector into. |
v | Vector to copy into the matrix. |
orient | Orientation of the vector to copy into the matrix. |
index | Index along the orientation dimension to copy the vector into the matrix. |
Error* copy_vector_from_matrix_u32 | ( | Vector_u32 ** | v_out, |
const Matrix_u32 * | m, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit unsigned integer vector from a matrix.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m | Matrix to copy a vector from. |
orient | Orientation of the vector to copy from the matrix. |
index | Index along the orientation dimension to copy the vector from the matrix. |
Error* copy_vector_from_matrix_i32 | ( | Vector_i32 ** | v_out, |
const Matrix_i32 * | m, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector from a matrix.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m | Matrix to copy a vector from. |
orient | Orientation of the vector to copy from the matrix. |
index | Index along the orientation dimension to copy the vector from the matrix. |
Error* copy_vector_from_matrix_i64 | ( | Vector_i64 ** | v_out, |
const Matrix_i64 * | m, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector from a matrix.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m | Matrix to copy a vector from. |
orient | Orientation of the vector to copy from the matrix. |
index | Index along the orientation dimension to copy the vector from the matrix. |
Error* copy_vector_from_matrix_f | ( | Vector_f ** | v_out, |
const Matrix_f * | m, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector from a matrix.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m | Matrix to copy a vector from. |
orient | Orientation of the vector to copy from the matrix. |
index | Index along the orientation dimension to copy the vector from the matrix. |
Error* copy_vector_from_matrix_d | ( | Vector_d ** | v_out, |
const Matrix_d * | m, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector from a matrix.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m | Matrix to copy a vector from. |
orient | Orientation of the vector to copy from the matrix. |
index | Index along the orientation dimension to copy the vector from the matrix. |
Error* copy_vector_from_matrix_cf | ( | Vector_cf ** | v_out, |
const Matrix_cf * | m, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector from a matrix.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m | Matrix to copy a vector from. |
orient | Orientation of the vector to copy from the matrix. |
index | Index along the orientation dimension to copy the vector from the matrix. |
Error* copy_vector_from_matrix_cd | ( | Vector_cd ** | v_out, |
const Matrix_cd * | m, | ||
Matrix_vector | orient, | ||
uint32_t | index | ||
) |
Copies a 32-bit signed integer vector from a matrix.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m | Matrix to copy a vector from. |
orient | Orientation of the vector to copy from the matrix. |
index | Index along the orientation dimension to copy the vector from the matrix. |
void free_matrix_u32 | ( | Matrix_u32 * | m | ) |
void free_matrix_i32 | ( | Matrix_i32 * | m | ) |
void free_matrix_i64 | ( | Matrix_i64 * | m | ) |
void free_matrix_f | ( | Matrix_f * | m | ) |
void free_matrix_d | ( | Matrix_d * | m | ) |
void free_matrix_cf | ( | Matrix_cf * | m | ) |