Matrices


Basic vector allocation, initialization and deletion



Mat __Mat_new_alloc (size_t elem_size, idx_t h, idx_t w, idx_t hmax, idx_t wmax)
mat mat_new_alloc (idx_t h, idx_t w, idx_t hmax, idx_t wmax)
imat imat_new_alloc (idx_t h, idx_t w, idx_t hmax, idx_t wmax)
bmat bmat_new_alloc (idx_t h, idx_t w, idx_t hmax, idx_t wmax)
cmat cmat_new_alloc (idx_t h, idx_t w, idx_t hmax, idx_t wmax)
Mat __Mat_new (size_t elem_size, idx_t h, idx_t w)
mat mat_new (idx_t h, idx_t w)
imat imat_new (idx_t h, idx_t w)
bmat bmat_new (idx_t h, idx_t w)
cmat cmat_new (idx_t h, idx_t w)
void __Mat_delete (Mat m)
void mat_delete (mat m)
void imat_delete (imat m)
void bmat_delete (bmat m)
void cmat_delete (cmat m)
#define Mat_new_alloc(type_t, h, w, hmax, wmax)   ((type_t **) __Mat_new_alloc( sizeof(type_t), h, w, hmax, wmax ))
#define Mat_new(type_t, h, w)   ((type_t **) __Mat_new( sizeof(type_t), h, w ))
#define Mat_delete(m)   __Mat_delete((Mat) m)

Width and Height functions



idx_t mat_height (mat m)
idx_t imat_height (imat m)
idx_t bmat_height (bmat m)
idx_t cmat_height (cmat m)
idx_t mat_height_max (mat m)
idx_t imat_height_max (imat m)
idx_t bmat_height_max (bmat m)
idx_t cmat_height_max (cmat m)
idx_t mat_width (mat m)
idx_t imat_width (imat m)
idx_t bmat_width (bmat m)
idx_t cmat_width (cmat m)
idx_t mat_width_max (mat m)
idx_t imat_width_max (imat m)
idx_t bmat_width_max (bmat m)
idx_t cmat_width_max (cmat m)
mat _mat_set_height_max (mat m, idx_t hmax)
imat _imat_set_height_max (imat m, idx_t hmax)
bmat _bmat_set_height_max (bmat m, idx_t hmax)
cmat _cmat_set_height_max (cmat m, idx_t hmax)
mat _mat_set_height (mat m, idx_t h)
imat _imat_set_height (imat m, idx_t h)
bmat _bmat_set_height (bmat m, idx_t h)
cmat _cmat_set_height (cmat m, idx_t h)
#define Mat_height(m)   Vec_length(m)
#define Mat_height_max(m)   Vec_length_max(m)
#define Mat_width(m)   Vec_length(m[0])
#define Mat_width_max(m)   Vec_length_max(m[0])
#define Mat_set_height_max(m, hmax)
#define mat_set_height_max(m, h)   do { m = _mat_set_height_max(m, h); } while(0)
#define imat_set_height_max(m, h)   do { m = _imat_set_height_max(m, h); } while(0)
#define bmat_set_height_max(m, h)   do { m = _bmat_set_height_max(m, h); } while(0)
#define cmat_set_height_max(m, h)   do { m = _cmat_set_height_max(m, h); } while(0)
#define Mat_set_height(m, h)
#define mat_set_height(m, h)   do { m = _mat_set_height(m, h); } while(0)
#define imat_set_height(m, h)   do { m = _imat_set_height(m, h); } while(0)
#define bmat_set_height(m, h)   do { m = _bmat_set_height(m, h); } while(0)
#define cmat_set_height(m, h)   do { m = _cmat_set_height(m, h); } while(0)
#define MAT_END_COL_PARAM(v, param)   do { if( param == end ) param = Mat_width( v ) - 1; } while(0)
#define MAT_END_ROW_PARAM(v, param)   do { if( param == end ) param = Mat_height( v ) - 1; } while(0)

Basic matrix initialization/modification



mat _mat_init (mat m, double *buf, idx_t w, idx_t h)
imat _imat_init (imat m, int *buf, idx_t w, idx_t h)
bmat _bmat_init (bmat m, byte *buf, idx_t w, idx_t h)
cmat _cmat_init (cmat m, cplx *buf, idx_t w, idx_t h)
mat mat_set (mat m, double val)
imat imat_set (imat m, int val)
bmat bmat_set (bmat m, byte val)
cmat cmat_set (cmat m, cplx val)
mat mat_new_set (double val, idx_t h, idx_t w)
imat imat_new_set (int val, idx_t h, idx_t w)
bmat bmat_new_set (byte val, idx_t h, idx_t w)
cmat cmat_new_set (cplx val, idx_t h, idx_t w)
mat mat_set_between (mat m, idx_t r1, idx_t c1, idx_t r2, idx_t c2, double val)
imat imat_set_between (imat m, idx_t r1, idx_t c1, idx_t r2, idx_t c2, int val)
bmat bmat_set_between (bmat m, idx_t r1, idx_t c1, idx_t r2, idx_t c2, byte val)
cmat cmat_set_between (cmat m, idx_t r1, idx_t c1, idx_t r2, idx_t c2, cplx val)
void mat_void (mat m)
void imat_void (imat m)
void bmat_void (bmat m)
void cmat_void (cmat m)
mat mat_new_void ()
imat imat_new_void ()
bmat bmat_new_void ()
cmat cmat_new_void ()
void mat_zeros (mat m)
void imat_zeros (imat m)
void bmat_zeros (bmat m)
void cmat_zeros (cmat m)
mat mat_new_zeros (idx_t h, idx_t w)
imat imat_new_zeros (idx_t h, idx_t w)
bmat bmat_new_zeros (idx_t h, idx_t w)
cmat cmat_new_zeros (idx_t h, idx_t w)
void mat_eye (mat m)
void imat_eye (imat m)
void bmat_eye (bmat m)
void cmat_eye (cmat m)
mat mat_new_eye (idx_t n)
imat imat_new_eye (idx_t n)
bmat bmat_new_eye (idx_t n)
cmat cmat_new_eye (idx_t n)
void mat_ones (mat m)
void imat_ones (imat m)
void bmat_ones (bmat m)
void cmat_ones (cmat m)
mat mat_new_ones (idx_t h, idx_t w)
imat imat_new_ones (idx_t h, idx_t w)
bmat bmat_new_ones (idx_t h, idx_t w)
cmat cmat_new_ones (idx_t h, idx_t w)
mat mat_new_diag (vec v)
imat imat_new_diag (ivec v)
bmat bmat_new_diag (bvec v)
#define Mat_init(m, buf, w, h)
#define mat_init(m, buf, w, h)   _mat_init(m, buf, w, h)
#define imat_init(m, buf, w, h)   _imat_init(m, buf, w, h)
#define bmat_init(m, buf, w, h)   _bmat_init(m, buf, w, h)
#define cmat_init(m, buf, w, h)   _cmat_init(m, buf, w, h)
#define Mat_set(m, val)
#define Mat_set_between(m, r1, c1, r2, c2, val)

Copy and Conversions Functions



Mat __Mat_copy (Mat m1, Mat m2)
void mat_copy (mat dest, mat orig)
void imat_copy (imat dest, imat orig)
void bmat_copy (bmat dest, bmat orig)
void cmat_copy (cmat dest, cmat orig)
Mat Mat_clone (Mat m)
mat mat_clone (mat m)
imat imat_clone (imat m)
bmat bmat_clone (bmat m)
cmat cmat_clone (cmat m)
vec mat_to_vec (mat m)
ivec imat_to_ivec (imat m)
bvec bmat_to_bvec (bmat m)
cvec cmat_to_cvec (cmat m)
mat vec_to_mat (vec v, idx_t width)
imat ivec_to_imat (ivec v, idx_t width)
bmat bvec_to_bmat (bvec v, idx_t width)
cmat cvec_to_cmat (cvec v, idx_t width)
mat imat_to_mat (imat m)
mat bmat_to_mat (bmat m)
imat mat_to_imat (mat m)
imat bmat_to_imat (bmat m)
#define Mat_copy(m1, m2)   __Mat_copy( (Mat) m1, (Mat) m2 )

Comparison functions



int Mat_eq (Mat m1, Mat m2)
int mat_eq (mat m1, mat m2)
int imat_eq (imat m, imat m2)
int bmat_eq (bmat m, bmat m2)
int cmat_eq (cmat m, cmat m2)
int mat_is_void (mat m)
int imat_is_void (imat m)
int bmat_is_void (bmat m)
int cmat_is_void (cmat m)

Row/column manipulation



mat __mat_del_row (mat m, idx_t pos)
imat __imat_del_row (imat m, idx_t pos)
bmat __bmat_del_row (bmat m, idx_t pos)
cmat __cmat_del_row (cmat m, idx_t pos)
mat __mat_ins_row (mat m, idx_t pos, vec v)
imat __imat_ins_row (imat m, idx_t pos, ivec v)
bmat __bmat_ins_row (bmat m, idx_t pos, bvec v)
cmat __cmat_ins_row (cmat m, idx_t pos, cvec v)
mat __mat_push_row (mat m, vec v)
imat __imat_push_row (imat m, ivec v)
bmat __bmat_push_row (bmat m, bvec v)
cmat __cmat_push_row (cmat m, cvec v)
mat __mat_pop_row (mat m)
imat __imat_pop_row (imat m)
bmat __bmat_pop_row (bmat m)
cmat __cmat_pop_row (cmat m)
void mat_swap_rows (mat m, idx_t i, idx_t j)
void mat_swap_cols (mat m, idx_t i, idx_t j)
void imat_swap_rows (imat m, idx_t i, idx_t j)
void imat_swap_cols (imat m, idx_t i, idx_t j)
void bmat_swap_rows (bmat m, idx_t i, idx_t j)
void bmat_swap_cols (bmat m, idx_t i, idx_t j)
void cmat_swap_rows (cmat m, idx_t i, idx_t j)
void cmat_swap_cols (cmat m, idx_t i, idx_t j)
mat _mat_transpose (mat m)
imat _imat_transpose (imat m)
bmat _bmat_transpose (bmat m)
mat mat_new_transpose (mat m)
imat imat_new_transpose (imat m)
bmat bmat_new_transpose (bmat m)
#define Mat_del_row(m, pos)
#define Mat_ins_row(m, pos, v)
#define Mat_push_row(m, v)   Mat_ins_row( m, Mat_height(m), v )
#define Mat_pop_row(m)   Mat_del_row( m, Mat_height(m)-1 )
#define Mat_last_row(m)   ((m)[Mat_height(m)-1])
#define mat_del_row(m, pos)   do { m = __mat_del_row( m, pos ); } while (0)
#define imat_del_row(m, pos)   do { m = __imat_del_row( m, pos ); } while (0)
#define bmat_del_row(m, pos)   do { m = __bmat_del_row( m, pos ); } while (0)
#define cmat_del_row(m, pos)   do { m = __cmat_del_row( m, pos ); } while (0)
#define mat_ins_row(m, pos, v)   do { m = __mat_ins_row( m, pos, v ); } while (0)
#define imat_ins_row(m, pos, v)   do { m = __imat_ins_row( m, pos, v ); } while (0)
#define bmat_ins_row(m, pos, v)   do { m = __bmat_ins_row( m, pos, v ); } while (0)
#define cmat_ins_row(m, pos, v)   do { m = __cmat_ins_row( m, pos, v ); } while (0)
#define mat_push_row(m, v)   do { m = __mat_push_row( m, v ); } while (0)
#define imat_push_row(m, v)   do { m = __imat_push_row( m, v ); } while (0)
#define bmat_push_row(m, v)   do { m = __bmat_push_row( m, v ); } while (0)
#define cmat_push_row(m, v)   do { m = __cmat_push_row( m, v ); } while (0)
#define mat_pop_row(m)   do { m = __mat_pop_row( m ); } while (0)
#define imat_pop_row(m)   do { m = __imat_pop_row( m ); } while (0)
#define bmat_pop_row(m)   do { m = __bmat_pop_row( m ); } while (0)
#define cmat_pop_row(m)   do { m = __cmat_pop_row( m ); } while (0)
#define mat_transpose(m)
#define imat_transpose(m)
#define bmat_transpose(m)

Mean, median, min, max, sum and elementary statistic indicators



double mat_sum (mat m)
int imat_sum (imat m)
cplx cmat_sum (cmat m)
double mat_row_sum (mat m, idx_t c)
int imat_row_sum (imat m, idx_t c)
cplx cmat_row_sum (cmat m, idx_t c)
double mat_col_sum (mat m, idx_t c)
int imat_col_sum (imat m, idx_t c)
cplx cmat_col_sum (cmat m, idx_t c)
vec mat_rows_sum (mat m)
ivec imat_rows_sum (imat m)
cvec cmat_rows_sum (cmat m)
vec mat_cols_sum (mat m)
ivec imat_cols_sum (imat m)
cvec cmat_cols_sum (cmat m)
double mat_diag_sum (mat m)
int imat_diag_sum (imat m)
int bmat_diag_sum (bmat m)
cplx cmat_diag_sum (cmat m)
double mat_mean (mat m)
double imat_mean (imat m)
cplx cmat_mean (cmat m)
double mat_max_index_submatrix (mat m, idx_t rmin, idx_t rmax, idx_t cmin, idx_t cmax, idx_t *r, idx_t *c)
double mat_min_index_submatrix (mat m, idx_t rmin, idx_t rmax, idx_t cmin, idx_t cmax, idx_t *r, idx_t *c)
int imat_max_index_submatrix (imat m, idx_t rmin, idx_t rmax, idx_t cmin, idx_t cmax, idx_t *r, idx_t *c)
int imat_min_index_submatrix (imat m, idx_t rmin, idx_t rmax, idx_t cmin, idx_t cmax, idx_t *r, idx_t *c)
double mat_max (mat m)
int imat_max (imat m)
double mat_min (mat m)
int imat_min (imat m)
double mat_max_index (mat m, idx_t *r, idx_t *c)
double mat_max_col_index (mat m, idx_t c, idx_t *r)
double mat_max_row_index (mat m, idx_t r, idx_t *c)
double mat_min_index (mat m, idx_t *r, idx_t *c)
double mat_min_col_index (mat m, idx_t c, idx_t *r)
double mat_min_row_index (mat m, idx_t r, idx_t *c)
int imat_max_index (imat m, idx_t *r, idx_t *c)
int imat_max_col_index (imat m, idx_t c, idx_t *r)
int imat_max_row_index (imat m, idx_t r, idx_t *c)
int imat_min_index (imat m, idx_t *r, idx_t *c)
int imat_min_col_index (imat m, idx_t c, idx_t *r)
int imat_min_row_index (imat m, idx_t r, idx_t *c)
double mat_variance (mat m)
void mat_normalize (mat m)
mat mat_cov (mat m)
void mat_rows_normalize (mat m, double nr)
void mat_cols_normalize (mat m, double nr)
double mat_norm_1 (mat m)
double mat_norm_inf (mat m)

Basic arithmetic operations



void mat_incr (mat m, double a)
void mat_decr (mat m, double a)
void mat_mul_by (mat m, double a)
void mat_div_by (mat m, double a)
void imat_incr (imat m, int a)
void imat_decr (imat m, int a)
void imat_mul_by (imat m, int a)
void imat_div_by (imat m, int a)
void cmat_incr (cmat m, cplx a)
void cmat_decr (cmat m, cplx a)
void cmat_mul_by (cmat m, cplx a)
void cmat_div_by (cmat m, cplx a)

Basic arithmetic operations on rows/columns



void mat_col_set (mat m, idx_t col, double a)
void mat_col_incr (mat m, idx_t col, double a)
void mat_col_decr (mat m, idx_t col, double a)
void mat_col_mul_by (mat m, idx_t col, double a)
void mat_col_div_by (mat m, idx_t col, double a)
void imat_col_set (imat m, idx_t col, int a)
void imat_col_incr (imat m, idx_t col, int a)
void imat_col_decr (imat m, idx_t col, int a)
void imat_col_mul_by (imat m, idx_t col, int a)
void imat_col_div_by (imat m, idx_t col, int a)
void mat_row_incr (mat m, idx_t row, double a)
void mat_row_decr (mat m, idx_t row, double a)
void mat_row_mul_by (mat m, idx_t row, double a)
void mat_row_div_by (mat m, idx_t row, double a)
void imat_row_incr (imat m, idx_t row, int a)
void imat_row_decr (imat m, idx_t row, int a)
void imat_row_mul_by (imat m, idx_t row, int a)
void imat_row_div_by (imat m, idx_t row, int a)

Component per component operations



void mat_elem_add (mat m1, mat m2)
void mat_elem_sub (mat m1, mat m2)
void mat_elem_mul (mat m1, mat m2)
void mat_elem_div (mat m1, mat m2)
void mat_elem_sqr (mat m)
void mat_elem_abs (mat m)
void mat_elem_exp (mat m)
void mat_elem_sqrt (mat m)
void mat_elem_pow (mat m, double p)
void imat_elem_add (imat m1, imat m2)
void imat_elem_sub (imat m1, imat m2)
void imat_elem_mul (imat m1, imat m2)
void imat_elem_div (imat m1, imat m2)
void imat_elem_sqr (imat m)
void cmat_elem_add (cmat m1, cmat m2)
void cmat_elem_sub (cmat m1, cmat m2)
void cmat_elem_mul (cmat m1, cmat m2)
void cmat_elem_div (cmat m1, cmat m2)

Matrix arithmetic



void mat_add (mat m1, mat m2)
void imat_add (imat m1, imat m2)
void cmat_add (cmat m1, cmat m2)
void mat_sub (mat m1, mat m2)
void imat_sub (imat m1, imat m2)
void cmat_sub (cmat m1, cmat m2)
mat mat_new_add (mat m1, mat m2)
imat imat_new_add (imat m1, imat m2)
cmat cmat_new_add (cmat m1, cmat m2)
mat mat_new_sub (mat m1, mat m2)
imat imat_new_sub (imat m1, imat m2)
cmat cmat_new_sub (cmat m1, cmat m2)
mat mat_new_mul (mat m1, mat m2)
imat imat_new_mul (imat m1, imat m2)
cmat cmat_new_mul (cmat m1, cmat m2)
void mat_mul (mat out, mat m1, mat m2)
void imat_mul (imat out, imat m1, imat m2)
void mat_mul_transpose_left (mat out, mat m1, mat m2)
void mat_mul_transpose_right (mat out, mat m1, mat m2)
void mat_mul_transpose_leftright (mat out, mat m1, mat m2)
vec mat_vec_mul (mat m, vec v)
vec mat_ivec_mul (mat m, ivec v)
vec imat_vec_mul (imat m, vec v)
ivec imat_bvec_mul (imat m, bvec v)
ivec imat_ivec_mul (imat m, ivec v)
cvec cmat_vec_mul (cmat m, vec v)
cvec cmat_cvec_mul (cmat m, cvec v)
vec vec_mat_mul (vec v, mat m)
ivec ivec_imat_mul (ivec v, imat m)

Submatrices operations



mat mat_get_submatrix (mat m, idx_t r1, idx_t c1, idx_t r2, idx_t c2)
imat imat_get_submatrix (imat m, idx_t r1, idx_t c1, idx_t r2, idx_t c2)
bmat bmat_get_submatrix (bmat m, idx_t r1, idx_t c1, idx_t r2, idx_t c2)
mat mat_set_submatrix (mat m, mat s, idx_t r, idx_t c)
imat imat_set_submatrix (imat m, imat s, idx_t r, idx_t c)
bmat bmat_set_submatrix (bmat m, bmat s, idx_t r, idx_t c)
void mat_copy_row (vec v, mat m, idx_t r)
void imat_copy_row (ivec v, imat m, idx_t r)
void bmat_copy_row (bvec v, bmat m, idx_t r)
void cmat_copy_row (cvec v, cmat m, idx_t r)
void mat_copy_col (vec v, mat m, idx_t c)
void imat_copy_col (ivec v, imat m, idx_t c)
void bmat_copy_col (bvec v, bmat m, idx_t c)
void cmat_copy_col (cvec v, cmat m, idx_t c)
vec mat_get_row (mat m, idx_t r)
ivec imat_get_row (imat m, idx_t r)
bvec bmat_get_row (bmat m, idx_t r)
cvec cmat_get_row (cmat m, idx_t r)
vec mat_get_col (mat m, idx_t c)
ivec imat_get_col (imat m, idx_t c)
bvec bmat_get_col (bmat m, idx_t c)
cvec cmat_get_col (cmat m, idx_t c)
void Mat_set_col (Mat m, idx_t c, Vec v)
void mat_set_col (mat m, idx_t c, vec v)
void imat_set_col (imat m, idx_t c, ivec v)
void bmat_set_col (bmat m, idx_t c, bvec v)
void cmat_set_col (cmat m, idx_t c, cvec v)
vec mat_get_diag (mat m)
ivec imat_get_diag (imat m)
bvec bmat_get_diag (bmat m)
cvec cmat_get_diag (cmat m)
void mat_diag (mat m, vec v)
void imat_diag (imat m, ivec v)
void bmat_diag (bmat m, bvec v)
void cmat_diag (cmat m, cvec v)
void mat_set_diag (mat m, vec v)
void imat_set_diag (imat m, ivec v)
void bmat_set_diag (bmat m, bvec v)
void cmat_set_diag (cmat m, cvec v)
#define Mat_set_row(m, r, v)   Vec_copy((m)[r], (v))
#define mat_set_row(m, r, v)   vec_copy((m)[r], (v))
#define imat_set_row(m, r, v)   ivec_copy((m)[r], (v))
#define bmat_set_row(m, r, v)   bvec_copy((m)[r], (v))
#define cmat_set_row(m, r, v)   cvec_copy((m)[r], (v))

Component per component arbitrar function



void mat_apply_function (mat v, it_function_t function, it_args_t args)
mat mat_new_apply_function (mat v, it_function_t function, it_args_t args)
void imat_apply_function (imat v, it_ifunction_t function, it_args_t args)
imat imat_new_apply_function (imat v, it_ifunction_t function, it_args_t args)
#define mat_eval(v, f, a)   mat_apply_function(v, f, a)
#define mat_new_eval(v, f, a)   mat_new_apply_function(v, f, a)
#define imat_eval(v, f, a)   imat_apply_function(v, f, a)
#define imat_new_eval(v, f, a)   imat_new_apply_function(v, f, a)

Random matrices



void mat_rand (mat m)
void mat_randn (mat m)
mat mat_new_rand (idx_t h, idx_t w)
mat mat_new_randn (idx_t h, idx_t w)

Row/column manipulation



cmat __cmat_del_row (cmat m, idx_t pos)
cmat __cmat_ins_row (cmat m, idx_t pos, cvec v)
cmat __cmat_push_row (cmat m, cvec v)
cmat __cmat_pop_row (cmat m)
void cmat_swap_rows (cmat m, idx_t i, idx_t j)
void cmat_swap_cols (cmat m, idx_t i, idx_t j)
cplx cmat_sum (cmat m)
cplx cmat_row_sum (cmat m, idx_t c)
cplx cmat_col_sum (cmat m, idx_t c)
cvec cmat_rows_sum (cmat m)
cvec cmat_cols_sum (cmat m)
cplx cmat_diag_sum (cmat m)
cplx cmat_mean (cmat m)

Basic arithmetic operations



void cmat_incr (cmat m, cplx a)
void cmat_decr (cmat m, cplx a)
void cmat_mul_by (cmat m, cplx a)
void cmat_div_by (cmat m, cplx a)

Component per component operations



void cmat_elem_add (cmat m1, cmat m2)
void cmat_elem_sub (cmat m1, cmat m2)
void cmat_elem_mul (cmat m1, cmat m2)
void cmat_elem_div (cmat m1, cmat m2)

Matrix arithmetic



void cmat_add (cmat m1, cmat m2)
void cmat_sub (cmat m1, cmat m2)
cmat cmat_new_add (cmat m1, cmat m2)
cmat cmat_new_sub (cmat m1, cmat m2)
cmat cmat_new_mul (cmat m1, cmat m2)
cvec cmat_vec_mul (cmat m, vec v)
cvec cmat_cvec_mul (cmat m, cvec v)
void cmat_copy_row (cvec v, cmat m, idx_t r)
void cmat_copy_col (cvec v, cmat m, idx_t c)
cvec cmat_get_row (cmat m, idx_t r)
cvec cmat_get_col (cmat m, idx_t c)
void cmat_set_col (cmat m, idx_t c, cvec v)
cvec cmat_get_diag (cmat m)
void cmat_diag (cmat m, cvec v)
void cmat_set_diag (cmat m, cvec v)

Defines

#define Mat_element_size(m)   Vec_element_size(m[0])

Typedefs

typedef VecMat
typedef vecmat
typedef ivecimat
typedef bvecbmat
typedef cveccmat

Detailed Description


Define Documentation

#define bmat_del_row ( m,
pos   )     do { m = __bmat_del_row( m, pos ); } while (0)

Definition at line 386 of file mat.h.

#define bmat_init ( m,
buf,
w,
 )     _bmat_init(m, buf, w, h)

Definition at line 195 of file mat.h.

#define bmat_ins_row ( m,
pos,
 )     do { m = __bmat_ins_row( m, pos, v ); } while (0)

Definition at line 398 of file mat.h.

Referenced by __bmat_push_row().

#define bmat_pop_row (  )     do { m = __bmat_pop_row( m ); } while (0)

Definition at line 421 of file mat.h.

#define bmat_push_row ( m,
 )     do { m = __bmat_push_row( m, v ); } while (0)

Definition at line 409 of file mat.h.

Referenced by it_read_bmat().

#define bmat_set_height ( m,
 )     do { m = _bmat_set_height(m, h); } while(0)

Definition at line 167 of file mat.h.

Referenced by bmat_void(), and it_read_bmat().

#define bmat_set_height_max ( m,
 )     do { m = _bmat_set_height_max(m, h); } while(0)

Definition at line 146 of file mat.h.

#define bmat_set_row ( m,
r,
 )     bvec_copy((m)[r], (v))

Definition at line 718 of file mat.h.

#define bmat_transpose (  ) 

Value:

do {    \
  if( bmat_height( m ) == bmat_width( m ) ) \
    m = _bmat_transpose( m );     \
  else {          \
    bmat t = bmat_new_transpose( m );   \
    bmat_delete( m );       \
    m = t;          \
  } } while(0)

Definition at line 461 of file mat.h.

#define cmat_del_row ( m,
pos   )     do { m = __cmat_del_row( m, pos ); } while (0)

Definition at line 387 of file mat.h.

#define cmat_init ( m,
buf,
w,
 )     _cmat_init(m, buf, w, h)

Definition at line 196 of file mat.h.

#define cmat_ins_row ( m,
pos,
 )     do { m = __cmat_ins_row( m, pos, v ); } while (0)

Definition at line 399 of file mat.h.

Referenced by __cmat_push_row().

#define cmat_pop_row (  )     do { m = __cmat_pop_row( m ); } while (0)

Definition at line 422 of file mat.h.

#define cmat_push_row ( m,
 )     do { m = __cmat_push_row( m, v ); } while (0)

Definition at line 410 of file mat.h.

Referenced by it_read_cmat().

#define cmat_set_height ( m,
 )     do { m = _cmat_set_height(m, h); } while(0)

Definition at line 168 of file mat.h.

Referenced by cmat_void(), and it_read_cmat().

#define cmat_set_height_max ( m,
 )     do { m = _cmat_set_height_max(m, h); } while(0)

Definition at line 147 of file mat.h.

#define cmat_set_row ( m,
r,
 )     cvec_copy((m)[r], (v))

Definition at line 719 of file mat.h.

#define imat_del_row ( m,
pos   )     do { m = __imat_del_row( m, pos ); } while (0)

Definition at line 385 of file mat.h.

#define imat_eval ( v,
f,
 )     imat_apply_function(v, f, a)

Definition at line 751 of file mat.h.

#define imat_init ( m,
buf,
w,
 )     _imat_init(m, buf, w, h)

Definition at line 194 of file mat.h.

#define imat_ins_row ( m,
pos,
 )     do { m = __imat_ins_row( m, pos, v ); } while (0)

Definition at line 397 of file mat.h.

Referenced by __imat_push_row().

#define imat_new_eval ( v,
f,
 )     imat_new_apply_function(v, f, a)

Definition at line 752 of file mat.h.

#define imat_pop_row (  )     do { m = __imat_pop_row( m ); } while (0)

Definition at line 420 of file mat.h.

#define imat_push_row ( m,
 )     do { m = __imat_push_row( m, v ); } while (0)

Definition at line 408 of file mat.h.

Referenced by it_read_imat().

#define imat_set_height ( m,
 )     do { m = _imat_set_height(m, h); } while(0)

Definition at line 166 of file mat.h.

Referenced by imat_void(), and it_read_imat().

#define imat_set_height_max ( m,
 )     do { m = _imat_set_height_max(m, h); } while(0)

Definition at line 145 of file mat.h.

#define imat_set_row ( m,
r,
 )     ivec_copy((m)[r], (v))

Definition at line 717 of file mat.h.

#define imat_transpose (  ) 

Value:

do {    \
  if( imat_height( m ) == imat_width( m ) ) \
    m = _imat_transpose( m );     \
  else {          \
    imat t = imat_new_transpose( m );   \
    imat_delete( m );       \
    m = t;          \
  } } while(0)

Definition at line 452 of file mat.h.

#define Mat_copy ( m1,
m2   )     __Mat_copy( (Mat) m1, (Mat) m2 )

Definition at line 287 of file mat.h.

Referenced by __Mat_deinterleave_block(), __Mat_interleave_block(), and Mat_clone().

#define mat_del_row ( m,
pos   )     do { m = __mat_del_row( m, pos ); } while (0)

Definition at line 384 of file mat.h.

#define Mat_del_row ( m,
pos   ) 

Value:

do {                                          \
                               idx_t h = Mat_height(m)-1;                   \
                               idx_t i;                                     \
                               assert(m);                                   \
                               assert((pos) <= h);                          \
                               for( i = (pos) + 1 ; i <= h ; i++ )          \
                                 (m)[ i - 1 ] = (m)[ i ];                   \
                               Mat_height(m)--;                             \
                             } while( 0 )

Definition at line 342 of file mat.h.

Referenced by __bmat_del_row(), __cmat_del_row(), __imat_del_row(), and __mat_del_row().

#define Mat_delete (  )     __Mat_delete((Mat) m)

#define Mat_element_size (  )     Vec_element_size(m[0])

#define mat_eval ( v,
f,
 )     mat_apply_function(v, f, a)

Definition at line 745 of file mat.h.

#define Mat_height_max (  )     Vec_length_max(m)

#define mat_init ( m,
buf,
w,
 )     _mat_init(m, buf, w, h)

Definition at line 193 of file mat.h.

#define Mat_init ( m,
buf,
w,
 ) 

Value:

do {                                         \
                                    idx_t i;                                  \
                                    Mat_set_height(m, h);                     \
                                    for( i=0 ; i < h ; i++ )                  \
                                      Vec_init( m[i], buf+(w)*(i), w );       \
                                 } while(0)

Definition at line 186 of file mat.h.

Referenced by _bmat_init(), _cmat_init(), _imat_init(), and _mat_init().

#define mat_ins_row ( m,
pos,
 )     do { m = __mat_ins_row( m, pos, v ); } while (0)

Definition at line 396 of file mat.h.

Referenced by __mat_push_row().

#define Mat_ins_row ( m,
pos,
 ) 

Value:

do {                                         \
                               idx_t h = Mat_height(m);                       \
                               idx_t i;                                       \
                               assert(m);                                     \
                               assert((pos) <= h);                            \
                               if(h) assert(Vec_length(v) == Mat_width(m));   \
                               if( h+1 > Mat_height_max(m) )                  \
                                 Mat_set_height_max( m, DYN_ALLOC_RULE( h )); \
                               for( i = h ; i > (pos) ; i-- )                 \
                                 (m)[i] = (m)[ i-1 ];                         \
                               (m)[(pos)] = (v);                              \
                               Mat_height(m)++;                               \
                             } while( 0 )

Definition at line 354 of file mat.h.

Referenced by __bmat_ins_row(), __cmat_ins_row(), __imat_ins_row(), and __mat_ins_row().

#define Mat_last_row (  )     ((m)[Mat_height(m)-1])

Definition at line 375 of file mat.h.

#define Mat_new ( type_t,
h,
 )     ((type_t **) __Mat_new( sizeof(type_t), h, w ))

Definition at line 74 of file mat.h.

Referenced by bmat_new(), cmat_new(), imat_new(), mat_new(), and pmat_new().

#define Mat_new_alloc ( type_t,
h,
w,
hmax,
wmax   )     ((type_t **) __Mat_new_alloc( sizeof(type_t), h, w, hmax, wmax ))

Definition at line 62 of file mat.h.

Referenced by bmat_new_alloc(), cmat_new_alloc(), imat_new_alloc(), and mat_new_alloc().

#define mat_new_eval ( v,
f,
 )     mat_new_apply_function(v, f, a)

Definition at line 746 of file mat.h.

Referenced by main().

#define mat_pop_row (  )     do { m = __mat_pop_row( m ); } while (0)

Definition at line 419 of file mat.h.

#define Mat_pop_row (  )     Mat_del_row( m, Mat_height(m)-1 )

Definition at line 372 of file mat.h.

Referenced by __bmat_pop_row(), __cmat_pop_row(), __imat_pop_row(), and __mat_pop_row().

#define mat_push_row ( m,
 )     do { m = __mat_push_row( m, v ); } while (0)

Definition at line 407 of file mat.h.

Referenced by it_read_fmat(), and it_read_mat().

#define Mat_push_row ( m,
 )     Mat_ins_row( m, Mat_height(m), v )

Definition at line 369 of file mat.h.

#define Mat_set ( m,
val   ) 

Value:

do {                                                \
                              idx_t i,j;                                      \
                              assert( m );                                    \
                              for( i = 0 ; i < Mat_height(m) ; i++ )          \
                                for( j = 0 ; j < Mat_width(m) ; j++ )         \
                                  m[i][j] = val;                              \
                             } while(0)

Definition at line 200 of file mat.h.

Referenced by bmat_set(), cmat_set(), imat_set(), and mat_set().

#define Mat_set_between ( m,
r1,
c1,
r2,
c2,
val   ) 

Value:

do {                        \
                            idx_t ce = c2;                                    \
                            idx_t re = r2;                                    \
                            idx_t x, y;                                       \
                            assert( m );                                      \
                            MAT_END_COL_PARAM( m, ce );                       \
                            MAT_END_ROW_PARAM( m, re );                       \
                            for( y = r1 ; y <= re ; y++ )                     \
                              for( x = c1 ; x <= ce ; x++ )                   \
                                m[ y ][ x ] = val;                            \
} while( 0 )

Definition at line 220 of file mat.h.

Referenced by bmat_set_between(), cmat_set_between(), imat_set_between(), and mat_set_between().

#define mat_set_height ( m,
 )     do { m = _mat_set_height(m, h); } while(0)

Definition at line 165 of file mat.h.

Referenced by it_read_fmat(), it_read_mat(), and mat_void().

#define Mat_set_height ( m,
 ) 

Value:

do {                                       \
                                      if( h > Mat_height( m ) ) {             \
                                        Mat_set_height_max( m, h );           \
                                        Vec_length(m) = (h);                  \
                                      }                                       \
                                      else                                    \
                                        Vec_length(m) = (h);                  \
                                   } while(0)

Definition at line 151 of file mat.h.

Referenced by _bmat_set_height(), _cmat_set_height(), _imat_set_height(), and _mat_set_height().

#define mat_set_height_max ( m,
 )     do { m = _mat_set_height_max(m, h); } while(0)

Definition at line 144 of file mat.h.

#define Mat_set_height_max ( m,
hmax   ) 

Value:

do {                                    \
    idx_t i, oldhmax = Mat_height_max(m), nhmax;            \
    assert( hmax >= Vec_length(m) );                                          \
    nhmax = ( hmax > 0 ? hmax : 1 );                          \
    if( nhmax > Mat_height(m) ) {                                             \
      Vec_set_length_max((m),nhmax);                      \
      for( i = oldhmax ; i < nhmax ; i++ ) {                                  \
        void ** pm = (void **) &(m)[i]; /* keep both C/C++ compilers happy */ \
        *pm = __Vec_new(Mat_element_size(m), Mat_width(m) );                  \
      }                                                                       \
    }                                                                         \
  } while(0)

Definition at line 126 of file mat.h.

Referenced by _bmat_set_height_max(), _cmat_set_height_max(), _imat_set_height_max(), and _mat_set_height_max().

#define mat_set_row ( m,
r,
 )     vec_copy((m)[r], (v))

Definition at line 716 of file mat.h.

Referenced by fpICA().

#define Mat_set_row ( m,
r,
 )     Vec_copy((m)[r], (v))

Definition at line 715 of file mat.h.

#define mat_transpose (  ) 

Value:

do {    \
  if( mat_height( m ) == mat_width( m ) ) \
    m = _mat_transpose( m );      \
  else {          \
    mat t = mat_new_transpose( m );   \
    mat_delete( m );        \
    m = t;          \
  } } while(0)

Definition at line 443 of file mat.h.

Referenced by it_ica().

#define Mat_width_max (  )     Vec_length_max(m[0])

Definition at line 118 of file mat.h.

Referenced by bmat_width_max(), cmat_width_max(), imat_width_max(), and mat_width_max().


Typedef Documentation

typedef bvec* bmat

Definition at line 48 of file mat.h.

typedef cvec* cmat

Definition at line 49 of file mat.h.

typedef ivec* imat

Definition at line 47 of file mat.h.

typedef vec* mat

Definition at line 46 of file mat.h.

typedef Vec* Mat

Definition at line 45 of file mat.h.


Function Documentation

bmat __bmat_del_row ( bmat  m,
idx_t  pos 
)

Definition at line 1033 of file mat.c.

References Mat_del_row.

bmat __bmat_ins_row ( bmat  m,
idx_t  pos,
bvec  v 
)

Definition at line 1050 of file mat.c.

References Mat_ins_row.

bmat __bmat_pop_row ( bmat  m  ) 

Definition at line 1086 of file mat.c.

References Mat_pop_row.

bmat __bmat_push_row ( bmat  m,
bvec  v 
)

Definition at line 1068 of file mat.c.

References bmat_height(), and bmat_ins_row.

cmat __cmat_del_row ( cmat  m,
idx_t  pos 
)

Definition at line 1037 of file mat.c.

References Mat_del_row.

cmat __cmat_del_row ( cmat  m,
idx_t  pos 
)

cmat __cmat_ins_row ( cmat  m,
idx_t  pos,
cvec  v 
)

Definition at line 1054 of file mat.c.

References Mat_ins_row.

cmat __cmat_ins_row ( cmat  m,
idx_t  pos,
cvec  v 
)

cmat __cmat_pop_row ( cmat  m  ) 

Definition at line 1090 of file mat.c.

References Mat_pop_row.

cmat __cmat_pop_row ( cmat  m  ) 

cmat __cmat_push_row ( cmat  m,
cvec  v 
)

Definition at line 1072 of file mat.c.

References cmat_height(), and cmat_ins_row.

cmat __cmat_push_row ( cmat  m,
cvec  v 
)

imat __imat_del_row ( imat  m,
idx_t  pos 
)

Definition at line 1029 of file mat.c.

References Mat_del_row.

imat __imat_ins_row ( imat  m,
idx_t  pos,
ivec  v 
)

Definition at line 1046 of file mat.c.

References Mat_ins_row.

imat __imat_pop_row ( imat  m  ) 

Definition at line 1082 of file mat.c.

References Mat_pop_row.

imat __imat_push_row ( imat  m,
ivec  v 
)

Definition at line 1064 of file mat.c.

References imat_height(), and imat_ins_row.

Mat __Mat_copy ( Mat  m1,
Mat  m2 
)

Definition at line 627 of file mat.c.

References Mat_element_size, Mat_height, and Vec_copy.

mat __mat_del_row ( mat  m,
idx_t  pos 
)

Definition at line 1025 of file mat.c.

References Mat_del_row.

void __Mat_delete ( Mat  m  ) 

Definition at line 56 of file mat.c.

References Mat_height_max, and Vec_delete.

mat __mat_ins_row ( mat  m,
idx_t  pos,
vec  v 
)

Definition at line 1042 of file mat.c.

References Mat_ins_row.

Mat __Mat_new ( size_t  elem_size,
idx_t  h,
idx_t  w 
)

Mat __Mat_new_alloc ( size_t  elem_size,
idx_t  h,
idx_t  w,
idx_t  hmax,
idx_t  wmax 
)

Definition at line 37 of file mat.c.

References __Vec_new_alloc(), and Vec_new_alloc.

Referenced by __Mat_new().

mat __mat_pop_row ( mat  m  ) 

Definition at line 1078 of file mat.c.

References Mat_pop_row.

mat __mat_push_row ( mat  m,
vec  v 
)

Definition at line 1060 of file mat.c.

References mat_height(), and mat_ins_row.

bmat _bmat_init ( bmat  m,
byte buf,
idx_t  w,
idx_t  h 
)

Definition at line 272 of file mat.c.

References Mat_init.

bmat _bmat_set_height ( bmat  m,
idx_t  h 
)

Definition at line 232 of file mat.c.

References Mat_set_height.

bmat _bmat_set_height_max ( bmat  m,
idx_t  hmax 
)

Definition at line 238 of file mat.c.

References Mat_set_height_max.

bmat _bmat_transpose ( bmat  m  ) 

Definition at line 1272 of file mat.c.

References bmat_height(), bmat_width(), and it_assert.

cmat _cmat_init ( cmat  m,
cplx buf,
idx_t  w,
idx_t  h 
)

cmat _cmat_set_height ( cmat  m,
idx_t  h 
)

cmat _cmat_set_height_max ( cmat  m,
idx_t  hmax 
)

imat _imat_init ( imat  m,
int *  buf,
idx_t  w,
idx_t  h 
)

Definition at line 266 of file mat.c.

References Mat_init.

imat _imat_set_height ( imat  m,
idx_t  h 
)

Definition at line 220 of file mat.c.

References Mat_set_height.

imat _imat_set_height_max ( imat  m,
idx_t  hmax 
)

Definition at line 226 of file mat.c.

References Mat_set_height_max.

imat _imat_transpose ( imat  m  ) 

Definition at line 1253 of file mat.c.

References imat_height(), imat_width(), and it_assert.

mat _mat_init ( mat  m,
double *  buf,
idx_t  w,
idx_t  h 
)

Definition at line 260 of file mat.c.

References Mat_init.

mat _mat_set_height ( mat  m,
idx_t  h 
)

Definition at line 208 of file mat.c.

References Mat_set_height.

mat _mat_set_height_max ( mat  m,
idx_t  hmax 
)

Definition at line 214 of file mat.c.

References Mat_set_height_max.

mat _mat_transpose ( mat  m  ) 

Definition at line 1234 of file mat.c.

References it_assert, mat_height(), and mat_width().

bmat bmat_clone ( bmat  m  ) 

Definition at line 728 of file mat.c.

References bmat_copy(), bmat_height(), bmat_new(), and bmat_width().

void bmat_copy ( bmat  dest,
bmat  orig 
)

void bmat_copy_col ( bvec  v,
bmat  m,
idx_t  c 
)

Definition at line 3035 of file mat.c.

References bmat_height(), bmat_width(), bvec_length(), and MAT_END_COL_PARAM.

Referenced by bmat_get_col().

void bmat_copy_row ( bvec  v,
bmat  m,
idx_t  r 
)

Definition at line 2986 of file mat.c.

References bmat_height(), bmat_width(), bvec_length(), MAT_END_ROW_PARAM, and Vec_copy.

Referenced by bmat_get_row().

void bmat_delete ( bmat  m  ) 

Definition at line 114 of file mat.c.

References Mat_delete.

Referenced by bmat_deinterleave_block(), and bmat_interleave_block().

void bmat_diag ( bmat  m,
bvec  v 
)

Definition at line 3293 of file mat.c.

References __mat_c_my_min, bmat_height(), bmat_width(), bmat_zeros(), bvec_length(), and it_assert.

Referenced by bmat_new_diag().

int bmat_diag_sum ( bmat  m  ) 

Definition at line 1511 of file mat.c.

References __mat_c_my_min, bmat_height(), and bmat_width().

int bmat_eq ( bmat  m,
bmat  m2 
)

Definition at line 966 of file mat.c.

References bmat_height(), and bvec_eq().

void bmat_eye ( bmat  m  ) 

Definition at line 427 of file mat.c.

References bmat_height(), bmat_set(), and bmat_width().

Referenced by bmat_new_eye().

bvec bmat_get_col ( bmat  m,
idx_t  c 
)

Definition at line 3119 of file mat.c.

References bmat_copy_col(), bmat_height(), and bvec_new().

bvec bmat_get_diag ( bmat  m  ) 

Definition at line 3241 of file mat.c.

References __mat_c_my_min, bmat_height(), bmat_width(), and bvec_new().

bvec bmat_get_row ( bmat  m,
idx_t  r 
)

Definition at line 3084 of file mat.c.

References bmat_copy_row(), bmat_width(), and bvec_new().

bmat bmat_get_submatrix ( bmat  m,
idx_t  r1,
idx_t  c1,
idx_t  r2,
idx_t  c2 
)

idx_t bmat_height_max ( bmat  m  ) 

Definition at line 173 of file mat.c.

References Mat_height_max.

Referenced by bmat_copy().

int bmat_is_void ( bmat  m  ) 

Definition at line 1009 of file mat.c.

References bmat_height(), and bmat_width().

bmat bmat_new_alloc ( idx_t  h,
idx_t  w,
idx_t  hmax,
idx_t  wmax 
)

Definition at line 94 of file mat.c.

References Mat_new_alloc.

Referenced by bmat_new_string(), parser_get_bmat(), and parser_get_bmat_verbose().

bmat bmat_new_diag ( bvec  v  ) 

Definition at line 607 of file mat.c.

References bmat_diag(), bmat_new(), and bvec_length().

bmat bmat_new_eye ( idx_t  n  ) 

Definition at line 575 of file mat.c.

References bmat_eye(), and bmat_new().

bmat bmat_new_ones ( idx_t  h,
idx_t  w 
)

Definition at line 484 of file mat.c.

References bmat_new_set().

bmat bmat_new_set ( byte  val,
idx_t  h,
idx_t  w 
)

Definition at line 542 of file mat.c.

References bmat_new(), and bmat_set().

Referenced by bmat_new_ones(), and bmat_new_zeros().

bmat bmat_new_transpose ( bmat  m  ) 

Definition at line 1316 of file mat.c.

References bmat_height(), bmat_new(), and bmat_width().

bmat bmat_new_void (  ) 

Definition at line 511 of file mat.c.

References bmat_new().

bmat bmat_new_zeros ( idx_t  h,
idx_t  w 
)

Definition at line 395 of file mat.c.

References bmat_new_set().

Referenced by bmat_get_submatrix().

void bmat_ones ( bmat  m  ) 

Definition at line 460 of file mat.c.

References bmat_set().

bmat bmat_set ( bmat  m,
byte  val 
)

Definition at line 295 of file mat.c.

References Mat_set.

Referenced by bmat_eye(), bmat_new_set(), bmat_ones(), and bmat_zeros().

bmat bmat_set_between ( bmat  m,
idx_t  r1,
idx_t  c1,
idx_t  r2,
idx_t  c2,
byte  val 
)

Definition at line 321 of file mat.c.

References Mat_set_between.

void bmat_set_col ( bmat  m,
idx_t  c,
bvec  v 
)

Definition at line 3185 of file mat.c.

References bmat_height(), bmat_width(), bvec_length(), and MAT_END_COL_PARAM.

void bmat_set_diag ( bmat  m,
bvec  v 
)

Definition at line 3339 of file mat.c.

References __mat_c_my_min, bmat_height(), bmat_width(), bvec_length(), and it_assert.

bmat bmat_set_submatrix ( bmat  m,
bmat  s,
idx_t  r,
idx_t  c 
)

Definition at line 2945 of file mat.c.

References bmat_height(), bmat_width(), it_assert, MAT_END_COL_PARAM, and MAT_END_ROW_PARAM.

void bmat_swap_cols ( bmat  m,
idx_t  i,
idx_t  j 
)

Definition at line 1185 of file mat.c.

References bmat_height(), bmat_width(), and it_assert.

void bmat_swap_rows ( bmat  m,
idx_t  i,
idx_t  j 
)

Definition at line 1170 of file mat.c.

References bmat_height(), and it_assert.

bvec bmat_to_bvec ( bmat  m  ) 

Definition at line 772 of file mat.c.

References bmat_height(), bmat_width(), and bvec_new().

imat bmat_to_imat ( bmat  m  ) 

Definition at line 883 of file mat.c.

References bmat_height(), bmat_width(), and imat_new().

mat bmat_to_mat ( bmat  m  ) 

Definition at line 867 of file mat.c.

References bmat_height(), bmat_width(), and mat_new().

void bmat_void ( bmat  m  ) 

Definition at line 347 of file mat.c.

References bmat_set_height.

idx_t bmat_width_max ( bmat  m  ) 

Definition at line 183 of file mat.c.

References Mat_width_max.

Referenced by bmat_copy().

void bmat_zeros ( bmat  m  ) 

Definition at line 372 of file mat.c.

References bmat_set().

Referenced by bmat_diag().

bmat bvec_to_bmat ( bvec  v,
idx_t  width 
)

Definition at line 821 of file mat.c.

References bmat_height(), bmat_new(), bmat_width(), bvec_length(), and it_assert.

void cmat_add ( cmat  m1,
cmat  m2 
)

Definition at line 2440 of file mat.c.

References cmat_elem_add().

void cmat_add ( cmat  m1,
cmat  m2 
)

Referenced by cmat_new_add(), and cmat_new_sub().

cmat cmat_clone ( cmat  m  ) 

cplx cmat_col_sum ( cmat  m,
idx_t  c 
)

Definition at line 1455 of file mat.c.

References cadd(), cmat_height(), cplx_0, and MAT_END_COL_PARAM.

cplx cmat_col_sum ( cmat  m,
idx_t  c 
)

Referenced by cmat_cols_sum().

cvec cmat_cols_sum ( cmat  m  ) 

Definition at line 1477 of file mat.c.

References cmat_col_sum(), cmat_width(), cvec_length(), and cvec_new().

cvec cmat_cols_sum ( cmat  m  ) 

void cmat_copy ( cmat  dest,
cmat  orig 
)

Referenced by cmat_clone().

void cmat_copy_col ( cvec  v,
cmat  m,
idx_t  c 
)

Definition at line 3050 of file mat.c.

References cmat_height(), cmat_width(), cvec_length(), and MAT_END_COL_PARAM.

void cmat_copy_col ( cvec  v,
cmat  m,
idx_t  c 
)

Referenced by cmat_get_col().

void cmat_copy_row ( cvec  v,
cmat  m,
idx_t  r 
)

Definition at line 2995 of file mat.c.

References cmat_height(), cmat_width(), cvec_length(), MAT_END_ROW_PARAM, and Vec_copy.

void cmat_copy_row ( cvec  v,
cmat  m,
idx_t  r 
)

Referenced by cmat_get_row().

cvec cmat_cvec_mul ( cmat  m,
cvec  v 
)

Definition at line 2720 of file mat.c.

References cadd(), cmat_height(), cmat_width(), cmul(), cvec_length(), and cvec_new_zeros().

cvec cmat_cvec_mul ( cmat  m,
cvec  v 
)

void cmat_decr ( cmat  m,
cplx  a 
)

Definition at line 2014 of file mat.c.

References cmat_height(), cmat_width(), and csub().

void cmat_decr ( cmat  m,
cplx  a 
)

void cmat_delete ( cmat  m  ) 

Referenced by cmat_inv(), and main().

void cmat_diag ( cmat  m,
cvec  v 
)

Definition at line 3305 of file mat.c.

References __mat_c_my_min, cmat_height(), cmat_width(), cmat_zeros(), cvec_length(), and it_assert.

void cmat_diag ( cmat  m,
cvec  v 
)

Referenced by cmat_new_diag().

cplx cmat_diag_sum ( cmat  m  ) 

Definition at line 1523 of file mat.c.

References __mat_c_my_min, cadd(), cmat_height(), cmat_width(), and cplx_0.

cplx cmat_diag_sum ( cmat  m  ) 

void cmat_div_by ( cmat  m,
cplx  a 
)

Definition at line 2034 of file mat.c.

References cdiv(), cmat_height(), and cmat_width().

void cmat_div_by ( cmat  m,
cplx  a 
)

void cmat_elem_add ( cmat  m1,
cmat  m2 
)

Definition at line 2368 of file mat.c.

References cadd(), cmat_height(), and cmat_width().

void cmat_elem_add ( cmat  m1,
cmat  m2 
)

Referenced by cmat_add().

void cmat_elem_div ( cmat  m1,
cmat  m2 
)

Definition at line 2401 of file mat.c.

References cdiv(), cmat_height(), and cmat_width().

void cmat_elem_div ( cmat  m1,
cmat  m2 
)

void cmat_elem_mul ( cmat  m1,
cmat  m2 
)

Definition at line 2390 of file mat.c.

References cmat_height(), cmat_width(), and cmul().

void cmat_elem_mul ( cmat  m1,
cmat  m2 
)

void cmat_elem_sub ( cmat  m1,
cmat  m2 
)

Definition at line 2379 of file mat.c.

References cmat_height(), cmat_width(), and csub().

void cmat_elem_sub ( cmat  m1,
cmat  m2 
)

Referenced by cmat_sub().

int cmat_eq ( cmat  m,
cmat  m2 
)

void cmat_eye ( cmat  m  ) 

Referenced by cmat_new_eye().

cvec cmat_get_col ( cmat  m,
idx_t  c 
)

Definition at line 3128 of file mat.c.

References cmat_copy_col(), cmat_height(), and cvec_new().

cvec cmat_get_col ( cmat  m,
idx_t  c 
)

cvec cmat_get_diag ( cmat  m  ) 

Definition at line 3254 of file mat.c.

References __mat_c_my_min, cmat_height(), cmat_width(), and cvec_new().

cvec cmat_get_diag ( cmat  m  ) 

cvec cmat_get_row ( cmat  m,
idx_t  r 
)

Definition at line 3093 of file mat.c.

References cmat_copy_row(), cmat_width(), and cvec_new().

cvec cmat_get_row ( cmat  m,
idx_t  r 
)

idx_t cmat_height_max ( cmat  m  ) 

Referenced by cmat_copy().

void cmat_incr ( cmat  m,
cplx  a 
)

Definition at line 2004 of file mat.c.

References cadd(), cmat_height(), and cmat_width().

void cmat_incr ( cmat  m,
cplx  a 
)

int cmat_is_void ( cmat  m  ) 

cplx cmat_mean ( cmat  m  ) 

Definition at line 1552 of file mat.c.

References cimag, cmat_height(), cmat_sum(), cmat_width(), and creal.

cplx cmat_mean ( cmat  m  ) 

void cmat_mul_by ( cmat  m,
cplx  a 
)

Definition at line 2024 of file mat.c.

References cmat_height(), cmat_width(), and cmul().

void cmat_mul_by ( cmat  m,
cplx  a 
)

cmat cmat_new ( idx_t  h,
idx_t  w 
)

cmat cmat_new_add ( cmat  m1,
cmat  m2 
)

Definition at line 2607 of file mat.c.

References cmat_add(), and cmat_clone().

cmat cmat_new_add ( cmat  m1,
cmat  m2 
)

cmat cmat_new_alloc ( idx_t  h,
idx_t  w,
idx_t  hmax,
idx_t  wmax 
)

Definition at line 99 of file mat.c.

References Mat_new_alloc.

Referenced by cmat_new_string(), parser_get_cmat(), and parser_get_cmat_verbose().

cmat cmat_new_eye ( idx_t  n  ) 

Definition at line 583 of file mat.c.

References cmat_eye(), and cmat_new().

cmat cmat_new_mul ( cmat  m1,
cmat  m2 
)

Definition at line 2623 of file mat.c.

References cadd(), cmat_height(), cmat_new_zeros(), cmat_width(), and cmul().

cmat cmat_new_mul ( cmat  m1,
cmat  m2 
)

cmat cmat_new_ones ( idx_t  h,
idx_t  w 
)

Definition at line 490 of file mat.c.

References cmat_new_set(), and cplx_1.

cmat cmat_new_set ( cplx  val,
idx_t  h,
idx_t  w 
)

Definition at line 550 of file mat.c.

References cmat_new(), and cmat_set().

Referenced by cmat_new_ones(), and cmat_new_zeros().

cmat cmat_new_sub ( cmat  m1,
cmat  m2 
)

Definition at line 2615 of file mat.c.

References cmat_add(), and cmat_clone().

cmat cmat_new_sub ( cmat  m1,
cmat  m2 
)

cmat cmat_new_void (  ) 

Definition at line 518 of file mat.c.

References cmat_new().

Referenced by cmat_inv().

cmat cmat_new_zeros ( idx_t  h,
idx_t  w 
)

Definition at line 400 of file mat.c.

References cmat_new_set(), and cplx_0.

Referenced by cmat_new_mul().

void cmat_ones ( cmat  m  ) 

cplx cmat_row_sum ( cmat  m,
idx_t  c 
)

Definition at line 1448 of file mat.c.

References cvec_sum(), and MAT_END_ROW_PARAM.

cplx cmat_row_sum ( cmat  m,
idx_t  c 
)

Referenced by cmat_rows_sum().

cvec cmat_rows_sum ( cmat  m  ) 

Definition at line 1467 of file mat.c.

References cmat_height(), cmat_row_sum(), cvec_length(), and cvec_new().

cvec cmat_rows_sum ( cmat  m  ) 

cmat cmat_set ( cmat  m,
cplx  val 
)

cmat cmat_set_between ( cmat  m,
idx_t  r1,
idx_t  c1,
idx_t  r2,
idx_t  c2,
cplx  val 
)

void cmat_set_col ( cmat  m,
idx_t  c,
cvec  v 
)

Definition at line 3200 of file mat.c.

References cmat_height(), cmat_width(), cvec_length(), and MAT_END_COL_PARAM.

void cmat_set_col ( cmat  m,
idx_t  c,
cvec  v 
)

void cmat_set_diag ( cmat  m,
cvec  v 
)

Definition at line 3350 of file mat.c.

References __mat_c_my_min, cmat_height(), cmat_width(), cvec_length(), and it_assert.

void cmat_set_diag ( cmat  m,
cvec  v 
)

void cmat_sub ( cmat  m1,
cmat  m2 
)

Definition at line 2446 of file mat.c.

References cmat_elem_sub().

void cmat_sub ( cmat  m1,
cmat  m2 
)

cplx cmat_sum ( cmat  m  ) 

Definition at line 1357 of file mat.c.

References cadd(), cmat_height(), cmat_width(), and cplx_0.

cplx cmat_sum ( cmat  m  ) 

Referenced by cmat_mean().

void cmat_swap_cols ( cmat  m,
idx_t  i,
idx_t  j 
)

Definition at line 1217 of file mat.c.

References cmat_height(), cmat_width(), and it_assert.

void cmat_swap_cols ( cmat  m,
idx_t  i,
idx_t  j 
)

void cmat_swap_rows ( cmat  m,
idx_t  i,
idx_t  j 
)

Definition at line 1202 of file mat.c.

References cmat_height(), and it_assert.

void cmat_swap_rows ( cmat  m,
idx_t  i,
idx_t  j 
)

cvec cmat_to_cvec ( cmat  m  ) 

cvec cmat_vec_mul ( cmat  m,
vec  v 
)

Definition at line 2704 of file mat.c.

References cadd(), cmat_height(), cmat_width(), cscale(), cvec_new_zeros(), and vec_length().

cvec cmat_vec_mul ( cmat  m,
vec  v 
)

void cmat_void ( cmat  m  ) 

idx_t cmat_width_max ( cmat  m  ) 

Referenced by cmat_copy().

void cmat_zeros ( cmat  m  ) 

Referenced by cmat_diag().

cmat cvec_to_cmat ( cvec  v,
idx_t  width 
)

Definition at line 835 of file mat.c.

References cmat_height(), cmat_new(), cmat_width(), cvec_length(), and it_assert.

void imat_add ( imat  m1,
imat  m2 
)

Definition at line 2428 of file mat.c.

References imat_elem_add().

Referenced by imat_new_add(), and imat_new_sub().

void imat_apply_function ( imat  v,
it_ifunction_t  function,
it_args_t  args 
)

Definition at line 3391 of file mat.c.

References imat_height(), and ivec_apply_function().

ivec imat_bvec_mul ( imat  m,
bvec  v 
)

Definition at line 2672 of file mat.c.

References bvec_length(), imat_height(), imat_width(), and ivec_new_zeros().

imat imat_clone ( imat  m  ) 

void imat_col_decr ( imat  m,
idx_t  col,
int  a 
)

Definition at line 2125 of file mat.c.

References imat_height(), imat_width(), and MAT_END_COL_PARAM.

void imat_col_div_by ( imat  m,
idx_t  col,
int  a 
)

Definition at line 2147 of file mat.c.

References imat_height(), imat_width(), and MAT_END_COL_PARAM.

void imat_col_incr ( imat  m,
idx_t  col,
int  a 
)

Definition at line 2114 of file mat.c.

References imat_height(), imat_width(), and MAT_END_COL_PARAM.

void imat_col_mul_by ( imat  m,
idx_t  col,
int  a 
)

Definition at line 2136 of file mat.c.

References imat_height(), imat_width(), and MAT_END_COL_PARAM.

void imat_col_set ( imat  m,
idx_t  col,
int  a 
)

Definition at line 2103 of file mat.c.

References imat_height(), imat_width(), and MAT_END_COL_PARAM.

int imat_col_sum ( imat  m,
idx_t  c 
)

Definition at line 1416 of file mat.c.

References imat_height(), and MAT_END_COL_PARAM.

Referenced by imat_cols_sum().

ivec imat_cols_sum ( imat  m  ) 

Definition at line 1438 of file mat.c.

References imat_col_sum(), imat_width(), ivec_length(), and ivec_new().

void imat_copy ( imat  dest,
imat  orig 
)

void imat_copy_col ( ivec  v,
imat  m,
idx_t  c 
)

Definition at line 3020 of file mat.c.

References imat_height(), imat_width(), ivec_length(), and MAT_END_COL_PARAM.

Referenced by imat_get_col().

void imat_copy_row ( ivec  v,
imat  m,
idx_t  r 
)

Definition at line 2977 of file mat.c.

References imat_height(), imat_width(), ivec_length(), MAT_END_ROW_PARAM, and Vec_copy.

Referenced by imat_get_row().

void imat_decr ( imat  m,
int  a 
)

Definition at line 1974 of file mat.c.

References imat_height(), and imat_width().

void imat_diag ( imat  m,
ivec  v 
)

Definition at line 3281 of file mat.c.

References __mat_c_my_min, imat_height(), imat_width(), imat_zeros(), it_assert, and ivec_length().

Referenced by imat_new_diag().

int imat_diag_sum ( imat  m  ) 

Definition at line 1499 of file mat.c.

References __mat_c_my_min, imat_height(), and imat_width().

void imat_div_by ( imat  m,
int  a 
)

Definition at line 1994 of file mat.c.

References imat_height(), and imat_width().

void imat_elem_add ( imat  m1,
imat  m2 
)

Definition at line 2315 of file mat.c.

References imat_height(), and imat_width().

Referenced by imat_add().

void imat_elem_div ( imat  m1,
imat  m2 
)

Definition at line 2348 of file mat.c.

References imat_height(), and imat_width().

void imat_elem_mul ( imat  m1,
imat  m2 
)

Definition at line 2337 of file mat.c.

References imat_height(), and imat_width().

void imat_elem_sqr ( imat  m  ) 

Definition at line 2359 of file mat.c.

References imat_height(), and imat_width().

void imat_elem_sub ( imat  m1,
imat  m2 
)

Definition at line 2326 of file mat.c.

References imat_height(), and imat_width().

Referenced by imat_sub().

int imat_eq ( imat  m,
imat  m2 
)

Definition at line 951 of file mat.c.

References imat_height(), and ivec_eq().

void imat_eye ( imat  m  ) 

Definition at line 417 of file mat.c.

References imat_height(), imat_set(), and imat_width().

Referenced by imat_new_eye().

ivec imat_get_col ( imat  m,
idx_t  c 
)

Definition at line 3110 of file mat.c.

References imat_copy_col(), imat_height(), and ivec_new().

ivec imat_get_diag ( imat  m  ) 

Definition at line 3229 of file mat.c.

References __mat_c_my_min, imat_height(), imat_width(), and ivec_new().

ivec imat_get_row ( imat  m,
idx_t  r 
)

Definition at line 3075 of file mat.c.

References imat_copy_row(), imat_width(), and ivec_new().

imat imat_get_submatrix ( imat  m,
idx_t  r1,
idx_t  c1,
idx_t  r2,
idx_t  c2 
)

idx_t imat_height_max ( imat  m  ) 

Definition at line 153 of file mat.c.

References Mat_height_max.

Referenced by imat_copy(), and main().

void imat_incr ( imat  m,
int  a 
)

Definition at line 1964 of file mat.c.

References imat_height(), and imat_width().

int imat_is_void ( imat  m  ) 

Definition at line 1003 of file mat.c.

References imat_height(), and imat_width().

ivec imat_ivec_mul ( imat  m,
ivec  v 
)

Definition at line 2752 of file mat.c.

References imat_height(), imat_width(), ivec_length(), and ivec_new_zeros().

int imat_max ( imat  m  ) 

Definition at line 1678 of file mat.c.

References imat_height(), imat_max_index_submatrix(), and imat_width().

int imat_max_col_index ( imat  m,
idx_t  c,
idx_t r 
)

Definition at line 1767 of file mat.c.

References imat_height(), and imat_max_index_submatrix().

int imat_max_index ( imat  m,
idx_t r,
idx_t c 
)

Definition at line 1759 of file mat.c.

References imat_height(), imat_max_index_submatrix(), and imat_width().

int imat_max_index_submatrix ( imat  m,
idx_t  rmin,
idx_t  rmax,
idx_t  cmin,
idx_t  cmax,
idx_t r,
idx_t c 
)

Definition at line 1616 of file mat.c.

References imat_height(), imat_width(), INT_MIN, and it_assert.

Referenced by imat_max(), imat_max_col_index(), imat_max_index(), and imat_max_row_index().

int imat_max_row_index ( imat  m,
idx_t  r,
idx_t c 
)

Definition at line 1776 of file mat.c.

References imat_max_index_submatrix(), and imat_width().

double imat_mean ( imat  m  ) 

Definition at line 1545 of file mat.c.

References imat_height(), imat_sum(), and imat_width().

int imat_min ( imat  m  ) 

Definition at line 1698 of file mat.c.

References imat_height(), imat_min_index_submatrix(), and imat_width().

int imat_min_col_index ( imat  m,
idx_t  c,
idx_t r 
)

Definition at line 1793 of file mat.c.

References imat_height(), and imat_min_index_submatrix().

int imat_min_index ( imat  m,
idx_t r,
idx_t c 
)

Definition at line 1785 of file mat.c.

References imat_height(), imat_min_index_submatrix(), and imat_width().

int imat_min_index_submatrix ( imat  m,
idx_t  rmin,
idx_t  rmax,
idx_t  cmin,
idx_t  cmax,
idx_t r,
idx_t c 
)

Definition at line 1642 of file mat.c.

References imat_height(), imat_width(), INT_MAX, it_assert, and min().

Referenced by imat_min(), imat_min_col_index(), imat_min_index(), and imat_min_row_index().

int imat_min_row_index ( imat  m,
idx_t  r,
idx_t c 
)

Definition at line 1802 of file mat.c.

References imat_min_index_submatrix(), and imat_width().

void imat_mul ( imat  out,
imat  m1,
imat  m2 
)

Definition at line 2469 of file mat.c.

References imat_height(), imat_width(), imat_zeros(), and it_assert.

void imat_mul_by ( imat  m,
int  a 
)

Definition at line 1984 of file mat.c.

References imat_height(), and imat_width().

imat imat_new_add ( imat  m1,
imat  m2 
)

Definition at line 2574 of file mat.c.

References imat_add(), and imat_clone().

imat imat_new_alloc ( idx_t  h,
idx_t  w,
idx_t  hmax,
idx_t  wmax 
)

Definition at line 89 of file mat.c.

References Mat_new_alloc.

Referenced by imat_new_string(), parser_get_imat(), and parser_get_imat_verbose().

imat imat_new_apply_function ( imat  v,
it_ifunction_t  function,
it_args_t  args 
)

Definition at line 3402 of file mat.c.

References imat_clone(), imat_height(), and ivec_apply_function().

imat imat_new_diag ( ivec  v  ) 

Definition at line 599 of file mat.c.

References imat_diag(), imat_new(), and ivec_length().

imat imat_new_eye ( idx_t  n  ) 

Definition at line 567 of file mat.c.

References imat_eye(), and imat_new().

imat imat_new_mul ( imat  m1,
imat  m2 
)

Definition at line 2590 of file mat.c.

References imat_height(), imat_new_zeros(), and imat_width().

imat imat_new_ones ( idx_t  h,
idx_t  w 
)

Definition at line 478 of file mat.c.

References imat_new_set().

imat imat_new_set ( int  val,
idx_t  h,
idx_t  w 
)

Definition at line 534 of file mat.c.

References imat_new(), and imat_set().

Referenced by imat_new_ones(), imat_new_zeros(), it_instanciate(), logviterbi(), viterbi(), and viterbi_side().

imat imat_new_sub ( imat  m1,
imat  m2 
)

Definition at line 2582 of file mat.c.

References imat_add(), and imat_clone().

imat imat_new_transpose ( imat  m  ) 

Definition at line 1304 of file mat.c.

References imat_height(), imat_new(), and imat_width().

imat imat_new_void (  ) 

Definition at line 504 of file mat.c.

References imat_new().

imat imat_new_zeros ( idx_t  h,
idx_t  w 
)

Definition at line 390 of file mat.c.

References imat_new_set().

Referenced by histogram_cond(), imat_get_submatrix(), and imat_new_mul().

void imat_ones ( imat  m  ) 

Definition at line 454 of file mat.c.

References imat_set().

void imat_row_decr ( imat  m,
idx_t  row,
int  a 
)

Definition at line 2198 of file mat.c.

References ivec_decr(), and MAT_END_ROW_PARAM.

void imat_row_div_by ( imat  m,
idx_t  row,
int  a 
)

Definition at line 2214 of file mat.c.

References ivec_div_by(), and MAT_END_ROW_PARAM.

void imat_row_incr ( imat  m,
idx_t  row,
int  a 
)

Definition at line 2190 of file mat.c.

References ivec_incr(), and MAT_END_ROW_PARAM.

void imat_row_mul_by ( imat  m,
idx_t  row,
int  a 
)

Definition at line 2206 of file mat.c.

References ivec_mul_by(), and MAT_END_ROW_PARAM.

int imat_row_sum ( imat  m,
idx_t  c 
)

Definition at line 1409 of file mat.c.

References ivec_sum(), and MAT_END_ROW_PARAM.

Referenced by imat_rows_sum().

ivec imat_rows_sum ( imat  m  ) 

Definition at line 1428 of file mat.c.

References imat_height(), imat_row_sum(), ivec_length(), and ivec_new().

imat imat_set ( imat  m,
int  val 
)

Definition at line 289 of file mat.c.

References Mat_set.

Referenced by imat_eye(), imat_new_set(), imat_ones(), imat_zeros(), and ivec_distance_levenshtein().

imat imat_set_between ( imat  m,
idx_t  r1,
idx_t  c1,
idx_t  r2,
idx_t  c2,
int  val 
)

Definition at line 314 of file mat.c.

References Mat_set_between.

void imat_set_col ( imat  m,
idx_t  c,
ivec  v 
)

Definition at line 3170 of file mat.c.

References imat_height(), imat_width(), ivec_length(), and MAT_END_COL_PARAM.

void imat_set_diag ( imat  m,
ivec  v 
)

Definition at line 3328 of file mat.c.

References __mat_c_my_min, imat_height(), imat_width(), it_assert, and ivec_length().

imat imat_set_submatrix ( imat  m,
imat  s,
idx_t  r,
idx_t  c 
)

Definition at line 2923 of file mat.c.

References imat_height(), imat_width(), it_assert, MAT_END_COL_PARAM, and MAT_END_ROW_PARAM.

void imat_sub ( imat  m1,
imat  m2 
)

Definition at line 2434 of file mat.c.

References imat_elem_sub().

int imat_sum ( imat  m  ) 

Definition at line 1345 of file mat.c.

References imat_height(), and imat_width().

Referenced by imat_mean().

void imat_swap_cols ( imat  m,
idx_t  i,
idx_t  j 
)

Definition at line 1153 of file mat.c.

References imat_height(), imat_width(), and it_assert.

void imat_swap_rows ( imat  m,
idx_t  i,
idx_t  j 
)

Definition at line 1138 of file mat.c.

References imat_height(), and it_assert.

ivec imat_to_ivec ( imat  m  ) 

Definition at line 762 of file mat.c.

References imat_height(), imat_width(), and ivec_new().

mat imat_to_mat ( imat  m  ) 

Definition at line 850 of file mat.c.

References imat_height(), imat_width(), and mat_new().

vec imat_vec_mul ( imat  m,
vec  v 
)

Definition at line 2656 of file mat.c.

References imat_height(), imat_width(), vec_length(), and vec_new_zeros().

void imat_void ( imat  m  ) 

Definition at line 341 of file mat.c.

References imat_set_height.

idx_t imat_width_max ( imat  m  ) 

Definition at line 163 of file mat.c.

References Mat_width_max.

Referenced by imat_copy(), and main().

void imat_zeros ( imat  m  ) 

Definition at line 366 of file mat.c.

References imat_set().

Referenced by imat_diag(), and imat_mul().

ivec ivec_imat_mul ( ivec  v,
imat  m 
)

Definition at line 2768 of file mat.c.

References imat_height(), imat_width(), ivec_length(), and ivec_new_zeros().

imat ivec_to_imat ( ivec  v,
idx_t  width 
)

Definition at line 807 of file mat.c.

References imat_height(), imat_new(), imat_width(), it_assert, and ivec_length().

void mat_add ( mat  m1,
mat  m2 
)

Definition at line 2416 of file mat.c.

References mat_elem_add().

Referenced by fpICA(), it_ica(), mat_new_add(), and mat_new_sub().

void mat_apply_function ( mat  v,
it_function_t  function,
it_args_t  args 
)

Definition at line 3365 of file mat.c.

References mat_height(), and vec_apply_function().

Mat Mat_clone ( Mat  m  ) 

Definition at line 692 of file mat.c.

References __Mat_new(), Mat_copy, Mat_element_size, Mat_height, and Mat_width.

void mat_col_decr ( mat  m,
idx_t  col,
double  a 
)

Definition at line 2070 of file mat.c.

References MAT_END_COL_PARAM, mat_height(), and mat_width().

void mat_col_div_by ( mat  m,
idx_t  col,
double  a 
)

Definition at line 2092 of file mat.c.

References MAT_END_COL_PARAM, mat_height(), and mat_width().

Referenced by bcjr(), and bcjr_side().

void mat_col_incr ( mat  m,
idx_t  col,
double  a 
)

Definition at line 2059 of file mat.c.

References MAT_END_COL_PARAM, mat_height(), and mat_width().

void mat_col_mul_by ( mat  m,
idx_t  col,
double  a 
)

Definition at line 2081 of file mat.c.

References MAT_END_COL_PARAM, mat_height(), and mat_width().

void mat_col_set ( mat  m,
idx_t  col,
double  a 
)

Definition at line 2048 of file mat.c.

References MAT_END_COL_PARAM, mat_height(), and mat_width().

double mat_col_sum ( mat  m,
idx_t  c 
)

Definition at line 1377 of file mat.c.

References MAT_END_COL_PARAM, and mat_height().

Referenced by is_valid_markov_matrix(), and mat_cols_sum().

void mat_cols_normalize ( mat  m,
double  nr 
)

Definition at line 1881 of file mat.c.

References mat_cols_sum(), mat_height(), Mat_width, and vec_delete().

Referenced by main(), and mat_gs().

vec mat_cols_sum ( mat  m  ) 

Definition at line 1399 of file mat.c.

References mat_col_sum(), mat_width(), vec_length(), and vec_new().

Referenced by bcjr(), bcjr_side(), fpICA(), and mat_cols_normalize().

void mat_copy ( mat  dest,
mat  orig 
)

void mat_copy_col ( vec  v,
mat  m,
idx_t  c 
)

Definition at line 3005 of file mat.c.

References MAT_END_COL_PARAM, mat_height(), mat_width(), and vec_length().

Referenced by mat_get_col().

void mat_copy_row ( vec  v,
mat  m,
idx_t  r 
)

Definition at line 2967 of file mat.c.

References MAT_END_ROW_PARAM, mat_height(), mat_width(), Vec_copy, and vec_length().

Referenced by mat_get_row().

mat mat_cov ( mat  m  ) 

Definition at line 3467 of file mat.c.

References mat_get_row(), mat_height(), mat_new(), mat_width(), vec_cov(), and vec_delete().

Referenced by PCAmat(), and whitenv().

void mat_decr ( mat  m,
double  a 
)

Definition at line 1934 of file mat.c.

References mat_height(), and mat_width().

Referenced by main().

void mat_diag ( mat  m,
vec  v 
)

Definition at line 3269 of file mat.c.

References __mat_c_my_min, it_assert, mat_height(), mat_width(), mat_zeros(), and vec_length().

Referenced by mat_new_diag(), and PCAmat().

double mat_diag_sum ( mat  m  ) 

Definition at line 1487 of file mat.c.

References __mat_c_my_min, mat_height(), and mat_width().

Referenced by PCAmat().

void mat_div_by ( mat  m,
double  a 
)

Definition at line 1954 of file mat.c.

References mat_height(), and mat_width().

Referenced by fpICA().

void mat_elem_abs ( mat  m  ) 

Definition at line 2270 of file mat.c.

References mat_height(), and mat_width().

Referenced by whitenv().

void mat_elem_add ( mat  m1,
mat  m2 
)

Definition at line 2227 of file mat.c.

References mat_height(), and mat_width().

Referenced by mat_add().

void mat_elem_div ( mat  m1,
mat  m2 
)

Definition at line 2260 of file mat.c.

References mat_height(), and mat_width().

void mat_elem_exp ( mat  m  ) 

Definition at line 2279 of file mat.c.

References mat_height(), and mat_width().

Referenced by fpICA().

void mat_elem_mul ( mat  m1,
mat  m2 
)

Definition at line 2249 of file mat.c.

References mat_height(), and mat_width().

Referenced by fpICA().

void mat_elem_pow ( mat  m,
double  p 
)

Definition at line 2306 of file mat.c.

References mat_height(), and mat_width().

Referenced by fpICA().

void mat_elem_sqr ( mat  m  ) 

Definition at line 2297 of file mat.c.

References mat_height(), and mat_width().

void mat_elem_sqrt ( mat  m  ) 

Definition at line 2288 of file mat.c.

References mat_height(), and mat_width().

Referenced by whitenv().

void mat_elem_sub ( mat  m1,
mat  m2 
)

Definition at line 2238 of file mat.c.

References mat_height(), and mat_width().

Referenced by mat_sub().

int mat_eq ( mat  m1,
mat  m2 
)

Definition at line 936 of file mat.c.

References mat_height(), and vec_eq().

int Mat_eq ( Mat  m1,
Mat  m2 
)

Definition at line 919 of file mat.c.

References Mat_height, and Vec_eq.

void mat_eye ( mat  m  ) 

Definition at line 407 of file mat.c.

References mat_height(), mat_set(), and mat_width().

Referenced by mat_inv_direct(), and mat_new_eye().

vec mat_get_col ( mat  m,
idx_t  c 
)

Definition at line 3101 of file mat.c.

References mat_copy_col(), mat_height(), and vec_new().

Referenced by fpICA(), main(), mat_gs(), and selcol().

vec mat_get_diag ( mat  m  ) 

Definition at line 3217 of file mat.c.

References __mat_c_my_min, mat_height(), mat_width(), and vec_new().

Referenced by fpICA(), and whitenv().

vec mat_get_row ( mat  m,
idx_t  r 
)

Definition at line 3066 of file mat.c.

References mat_copy_row(), mat_width(), and vec_new().

Referenced by mat_cov(), and remmean().

mat mat_get_submatrix ( mat  m,
idx_t  r1,
idx_t  c1,
idx_t  r2,
idx_t  c2 
)

idx_t mat_height ( mat  m  ) 

Definition at line 128 of file mat.c.

References Mat_height.

Referenced by __it_quantize_mat(), __it_wavelet2D_itransform(), __it_wavelet2D_transform(), __mat_push_row(), __wavelet_flatten(), __wavelet_unflatten(), _mat_transpose(), compute_distance_matrix(), fmat_fwrite(), fpICA(), it_ica(), it_vfprintf(), it_wavelet2D_merge(), it_wavelet2D_split(), main(), markov_marg_pdf(), mat_apply_function(), mat_cholesky(), mat_clone(), mat_col_decr(), mat_col_div_by(), mat_col_incr(), mat_col_mul_by(), mat_col_set(), mat_col_sum(), mat_cols_normalize(), mat_cond(), mat_copy(), mat_copy_col(), mat_copy_row(), mat_cov(), mat_decr(), mat_det(), mat_diag(), mat_diag_sum(), mat_distance_mse(), mat_distance_norm(), mat_div_by(), mat_eig(), mat_eig_sym(), mat_elem_abs(), mat_elem_add(), mat_elem_div(), mat_elem_exp(), mat_elem_mul(), mat_elem_pow(), mat_elem_sqr(), mat_elem_sqrt(), mat_elem_sub(), mat_eq(), mat_eye(), mat_filter_fir(), mat_fwrite(), mat_get_col(), mat_get_diag(), mat_get_submatrix(), mat_gs(), mat_h2rs(), mat_hessenberg(), mat_incr(), mat_inv(), mat_inv_direct(), mat_is_symmetric(), mat_is_void(), mat_ivec_mul(), mat_ls(), mat_lu(), mat_max(), mat_max_col_index(), mat_max_index(), mat_max_index_submatrix(), mat_mean(), mat_min(), mat_min_col_index(), mat_min_index(), mat_min_index_submatrix(), mat_mul(), mat_mul_by(), mat_mul_transpose_left(), mat_mul_transpose_leftright(), mat_mul_transpose_right(), mat_new_apply_function(), mat_new_mul(), mat_new_transpose(), mat_norm_1(), mat_norm_inf(), mat_pgm_write(), mat_pow_one_by_two(), mat_qr(), mat_rand(), mat_randn(), mat_rank(), mat_real_schur(), mat_rows_sum(), mat_set_col(), mat_set_diag(), mat_set_submatrix(), mat_solve_mat(), mat_solve_vec(), mat_sum(), mat_svd(), mat_swap_cols(), mat_swap_rows(), mat_tanh(), mat_to_imat(), mat_to_vec(), mat_tridiag(), mat_tridiag_ql(), mat_vec_mul(), mat_wav_write(), PCAmat(), remmean(), selcol(), vec_mat_mul(), vec_to_mat(), and whitenv().

idx_t mat_height_max ( mat  m  ) 

Definition at line 133 of file mat.c.

References Mat_height_max.

Referenced by main(), and mat_copy().

void mat_incr ( mat  m,
double  a 
)

Definition at line 1924 of file mat.c.

References mat_height(), and mat_width().

int mat_is_void ( mat  m  ) 

Definition at line 997 of file mat.c.

References mat_height(), and mat_width().

vec mat_ivec_mul ( mat  m,
ivec  v 
)

Definition at line 2688 of file mat.c.

References ivec_length(), mat_height(), mat_width(), and vec_new_zeros().

double mat_max ( mat  m  ) 

Definition at line 1668 of file mat.c.

References mat_height(), mat_max_index_submatrix(), and mat_width().

Referenced by main(), and whitenv().

double mat_max_col_index ( mat  m,
idx_t  c,
idx_t r 
)

Definition at line 1715 of file mat.c.

References mat_height(), and mat_max_index_submatrix().

double mat_max_index ( mat  m,
idx_t r,
idx_t c 
)

Definition at line 1707 of file mat.c.

References mat_height(), mat_max_index_submatrix(), and mat_width().

double mat_max_index_submatrix ( mat  m,
idx_t  rmin,
idx_t  rmax,
idx_t  cmin,
idx_t  cmax,
idx_t r,
idx_t c 
)

Definition at line 1564 of file mat.c.

References it_assert, mat_height(), and mat_width().

Referenced by mat_max(), mat_max_col_index(), mat_max_index(), and mat_max_row_index().

double mat_max_row_index ( mat  m,
idx_t  r,
idx_t c 
)

Definition at line 1724 of file mat.c.

References mat_max_index_submatrix(), and mat_width().

double mat_mean ( mat  m  ) 

Definition at line 1538 of file mat.c.

References mat_height(), mat_sum(), and mat_width().

double mat_min ( mat  m  ) 

Definition at line 1688 of file mat.c.

References mat_height(), mat_min_index_submatrix(), and mat_width().

double mat_min_col_index ( mat  m,
idx_t  c,
idx_t r 
)

Definition at line 1741 of file mat.c.

References mat_height(), and mat_min_index_submatrix().

double mat_min_index ( mat  m,
idx_t r,
idx_t c 
)

Definition at line 1733 of file mat.c.

References mat_height(), mat_min_index_submatrix(), and mat_width().

double mat_min_index_submatrix ( mat  m,
idx_t  rmin,
idx_t  rmax,
idx_t  cmin,
idx_t  cmax,
idx_t r,
idx_t c 
)

Definition at line 1590 of file mat.c.

References it_assert, mat_height(), mat_width(), and min().

Referenced by mat_min(), mat_min_col_index(), mat_min_index(), and mat_min_row_index().

double mat_min_row_index ( mat  m,
idx_t  r,
idx_t c 
)

Definition at line 1750 of file mat.c.

References mat_min_index_submatrix(), and mat_width().

void mat_mul ( mat  out,
mat  m1,
mat  m2 
)

Definition at line 2452 of file mat.c.

References it_assert, mat_height(), mat_width(), and mat_zeros().

Referenced by fpICA(), it_ica(), and whitenv().

void mat_mul_by ( mat  m,
double  a 
)

Definition at line 1944 of file mat.c.

References mat_height(), and mat_width().

Referenced by fpICA(), and main().

void mat_mul_transpose_left ( mat  out,
mat  m1,
mat  m2 
)

Definition at line 2486 of file mat.c.

References it_assert, mat_height(), mat_width(), and mat_zeros().

Referenced by fpICA().

void mat_mul_transpose_leftright ( mat  out,
mat  m1,
mat  m2 
)

Definition at line 2520 of file mat.c.

References it_assert, mat_height(), mat_width(), and mat_zeros().

void mat_mul_transpose_right ( mat  out,
mat  m1,
mat  m2 
)

Definition at line 2503 of file mat.c.

References it_assert, mat_height(), mat_width(), and mat_zeros().

Referenced by whitenv().

mat mat_new_add ( mat  m1,
mat  m2 
)

Definition at line 2558 of file mat.c.

References mat_add(), and mat_clone().

mat mat_new_alloc ( idx_t  h,
idx_t  w,
idx_t  hmax,
idx_t  wmax 
)

Definition at line 84 of file mat.c.

References Mat_new_alloc.

Referenced by fmat_new_string(), main(), mat_new_string(), parser_get_mat(), and parser_get_mat_verbose().

mat mat_new_apply_function ( mat  v,
it_function_t  function,
it_args_t  args 
)

Definition at line 3376 of file mat.c.

References mat_clone(), mat_height(), and vec_apply_function().

mat mat_new_diag ( vec  v  ) 

Definition at line 591 of file mat.c.

References mat_diag(), mat_new(), and vec_length().

Referenced by fpICA(), and mat_pow_one_by_two().

mat mat_new_eye ( idx_t  n  ) 

Definition at line 559 of file mat.c.

References mat_eye(), and mat_new().

Referenced by whitenv().

mat mat_new_mul ( mat  m1,
mat  m2 
)

Definition at line 2539 of file mat.c.

References mat_height(), mat_new_zeros(), and mat_width().

Referenced by fpICA(), main(), markov_marg_pdf(), and mat_pow_one_by_two().

mat mat_new_ones ( idx_t  h,
idx_t  w 
)

Definition at line 472 of file mat.c.

References mat_new_set().

Referenced by bcjr_side(), and fpICA().

mat mat_new_rand ( idx_t  h,
idx_t  w 
)

Definition at line 3441 of file mat.c.

References it_rand(), and mat_new().

mat mat_new_randn ( idx_t  h,
idx_t  w 
)

Definition at line 3454 of file mat.c.

References it_randn(), and mat_new().

mat mat_new_set ( double  val,
idx_t  h,
idx_t  w 
)

Definition at line 526 of file mat.c.

References mat_new(), and mat_set().

Referenced by mat_new_ones(), and mat_new_zeros().

mat mat_new_sub ( mat  m1,
mat  m2 
)

Definition at line 2566 of file mat.c.

References mat_add(), and mat_clone().

mat mat_new_transpose ( mat  m  ) 

Definition at line 1292 of file mat.c.

References mat_height(), mat_new(), and mat_width().

Referenced by fpICA(), and main().

mat mat_new_void (  ) 

Definition at line 497 of file mat.c.

References mat_new().

mat mat_new_zeros ( idx_t  h,
idx_t  w 
)

double mat_norm_1 ( mat  m  ) 

Definition at line 1812 of file mat.c.

References mat_height(), and mat_width().

double mat_norm_inf ( mat  m  ) 

Definition at line 1829 of file mat.c.

References mat_height(), and mat_width().

void mat_normalize ( mat  m  ) 

Definition at line 1868 of file mat.c.

References Mat_height, mat_sum(), and Mat_width.

void mat_ones ( mat  m  ) 

Definition at line 448 of file mat.c.

References mat_set().

void mat_rand ( mat  m  ) 

Definition at line 3423 of file mat.c.

References it_rand(), mat_height(), and mat_width().

void mat_randn ( mat  m  ) 

Definition at line 3432 of file mat.c.

References it_randn(), mat_height(), and mat_width().

void mat_row_decr ( mat  m,
idx_t  row,
double  a 
)

Definition at line 2166 of file mat.c.

References MAT_END_ROW_PARAM, and vec_decr().

void mat_row_div_by ( mat  m,
idx_t  row,
double  a 
)

Definition at line 2182 of file mat.c.

References MAT_END_ROW_PARAM, and vec_div_by().

void mat_row_incr ( mat  m,
idx_t  row,
double  a 
)

Definition at line 2158 of file mat.c.

References MAT_END_ROW_PARAM, and vec_incr().

void mat_row_mul_by ( mat  m,
idx_t  row,
double  a 
)

Definition at line 2174 of file mat.c.

References MAT_END_ROW_PARAM, and vec_mul_by().

double mat_row_sum ( mat  m,
idx_t  c 
)

Definition at line 1370 of file mat.c.

References MAT_END_ROW_PARAM, and vec_sum().

Referenced by mat_rows_sum().

void mat_rows_normalize ( mat  m,
double  nr 
)

Definition at line 1907 of file mat.c.

References Mat_height, and vec_normalize().

vec mat_rows_sum ( mat  m  ) 

Definition at line 1389 of file mat.c.

References mat_height(), mat_row_sum(), vec_length(), and vec_new().

Referenced by markov_marg_pdf().

mat mat_set ( mat  m,
double  val 
)

Definition at line 283 of file mat.c.

References Mat_set.

Referenced by main(), mat_eye(), mat_new_set(), mat_ones(), and mat_zeros().

mat mat_set_between ( mat  m,
idx_t  r1,
idx_t  c1,
idx_t  r2,
idx_t  c2,
double  val 
)

Definition at line 307 of file mat.c.

References Mat_set_between.

void mat_set_col ( mat  m,
idx_t  c,
vec  v 
)

Definition at line 3155 of file mat.c.

References MAT_END_COL_PARAM, mat_height(), mat_width(), and vec_length().

Referenced by fpICA(), it_ica(), remmean(), and selcol().

void Mat_set_col ( Mat  m,
idx_t  c,
Vec  v 
)

void mat_set_diag ( mat  m,
vec  v 
)

Definition at line 3317 of file mat.c.

References __mat_c_my_min, it_assert, mat_height(), mat_width(), and vec_length().

mat mat_set_submatrix ( mat  m,
mat  s,
idx_t  r,
idx_t  c 
)

Definition at line 2901 of file mat.c.

References it_assert, MAT_END_COL_PARAM, MAT_END_ROW_PARAM, mat_height(), and mat_width().

Referenced by it_wavelet2D_merge().

void mat_sub ( mat  m1,
mat  m2 
)

Definition at line 2422 of file mat.c.

References mat_elem_sub().

Referenced by fpICA(), remmean(), and whitenv().

double mat_sum ( mat  m  ) 

Definition at line 1333 of file mat.c.

References mat_height(), and mat_width().

Referenced by mat_mean(), and mat_normalize().

void mat_swap_cols ( mat  m,
idx_t  i,
idx_t  j 
)

Definition at line 1117 of file mat.c.

References it_assert, mat_height(), and mat_width().

void mat_swap_rows ( mat  m,
idx_t  i,
idx_t  j 
)

Definition at line 1098 of file mat.c.

References it_assert, and mat_height().

Referenced by mat_lu().

imat mat_to_imat ( mat  m  ) 

Definition at line 899 of file mat.c.

References imat_new(), mat_height(), and mat_width().

vec mat_to_vec ( mat  m  ) 

Definition at line 752 of file mat.c.

References mat_height(), mat_width(), and vec_new().

double mat_variance ( mat  m  ) 

Definition at line 1847 of file mat.c.

References Mat_height, and Mat_width.

vec mat_vec_mul ( mat  m,
vec  v 
)

Definition at line 2640 of file mat.c.

References mat_height(), mat_width(), vec_length(), and vec_new_zeros().

Referenced by fpICA(), and it_ica().

void mat_void ( mat  m  ) 

Definition at line 335 of file mat.c.

References mat_set_height.

Referenced by fpICA(), and it_ica().

idx_t mat_width ( mat  m  ) 

Definition at line 138 of file mat.c.

References Mat_width.

Referenced by __it_wavelet2D_itransform(), __it_wavelet2D_transform(), __wavelet_flatten(), __wavelet_unflatten(), _mat_transpose(), bcjr(), bcjr_side(), entropy_markov(), fmat_fwrite(), fpICA(), is_valid_markov_matrix(), it_ica(), it_viterbi_decode(), it_wavelet2D_merge(), it_wavelet2D_split(), logviterbi(), main(), markov_marg_pdf(), mat_cholesky(), mat_clone(), mat_col_decr(), mat_col_div_by(), mat_col_incr(), mat_col_mul_by(), mat_col_set(), mat_cols_sum(), mat_cond(), mat_copy(), mat_copy_col(), mat_copy_row(), mat_cov(), mat_decr(), mat_diag(), mat_diag_sum(), mat_distance_norm(), mat_div_by(), mat_eig(), mat_eig_sym(), mat_elem_abs(), mat_elem_add(), mat_elem_div(), mat_elem_exp(), mat_elem_mul(), mat_elem_pow(), mat_elem_sqr(), mat_elem_sqrt(), mat_elem_sub(), mat_eye(), mat_filter_fir(), mat_fwrite(), mat_get_diag(), mat_get_row(), mat_get_submatrix(), mat_gs(), mat_h2rs(), mat_hessenberg(), mat_incr(), mat_inv(), mat_inv_direct(), mat_is_symmetric(), mat_is_void(), mat_ivec_mul(), mat_ls(), mat_lu(), mat_max(), mat_max_index(), mat_max_index_submatrix(), mat_max_row_index(), mat_mean(), mat_min(), mat_min_index(), mat_min_index_submatrix(), mat_min_row_index(), mat_mul(), mat_mul_by(), mat_mul_transpose_left(), mat_mul_transpose_leftright(), mat_mul_transpose_right(), mat_new_mul(), mat_new_transpose(), mat_norm_1(), mat_norm_inf(), mat_pgm_write(), mat_pow_one_by_two(), mat_qr(), mat_rand(), mat_randn(), mat_rank(), mat_real_schur(), mat_set_col(), mat_set_diag(), mat_set_submatrix(), mat_solve_mat(), mat_solve_vec(), mat_sum(), mat_svd(), mat_swap_cols(), mat_tanh(), mat_to_imat(), mat_to_vec(), mat_tridiag(), mat_vec_mul(), mat_wav_write(), remmean(), selcol(), vec_mat_mul(), vec_to_mat(), viterbi(), and viterbi_side().

idx_t mat_width_max ( mat  m  ) 

Definition at line 143 of file mat.c.

References Mat_width_max.

Referenced by main(), and mat_copy().

void mat_zeros ( mat  m  ) 

vec vec_mat_mul ( vec  v,
mat  m 
)

Definition at line 2736 of file mat.c.

References mat_height(), mat_width(), vec_length(), and vec_new_zeros().

mat vec_to_mat ( vec  v,
idx_t  width 
)

Definition at line 793 of file mat.c.

References it_assert, mat_height(), mat_new(), mat_width(), and vec_length().


Hosted by
Copyright (C) 2005-2006 Hervé Jégou
Vivien Chappelier
Francois Cayre
libit logo courtesy of Jonathan Delhumeau