Mir 1.0
Mir application programming interface
Setters and getters

Macros

#define mirml_mh_set_row(mat, row, vec)   mirml_mh_set_row_(mat,row,vec,0)
 Whole row i of matrix <- vec.
 
#define mirml_mh_set_col(mat, col, vec)   mirml_mh_set_col_(mat,col,vec,0)
 Whole column j of matrix <- vec.
 
#define mirml_mh_m_set_val(A, i, j, val)   ((A)->me[(i)][(j)] = (val))
 
#define mirml_mh_m_add_val(A, i, j, val)   ((A)->me[(i)][(j)] += (val))
 
#define mirml_mh_m_sub_val(A, i, j, val)   ((A)->me[(i)][(j)] -= (val))
 
#define mirml_mh_m_get_val(A, i, j)   ((A)->me[(i)][(j)])
 
#define mirml_mh_v_set_val(x, i, val)   ((x)->ve[(i)] = (val))
 
#define mirml_mh_v_add_val(x, i, val)   ((x)->ve[(i)] += (val))
 
#define mirml_mh_v_sub_val(x, i, val)   ((x)->ve[(i)] -= (val))
 
#define mirml_mh_v_get_val(x, i)   ((x)->ve[(i)])
 
#define mirml_mh_bd_set_val(A, i, j, val)   ((A)->mat->me[(A)->lb+(j)-(i)][(j)] = (val))
 
#define mirml_mh_bd_add_val(A, i, j, val)   ((A)->mat->me[(A)->lb+(j)-(i)][(j)] += (val))
 
#define mirml_mh_bd_get_val(A, i, j)   ((A)->mat->me[(A)->lb+(j)-(i)][(j)])
 
#define mirml_mh_m_entry(A, i, j)   mirml_mh_m_get_val(A,i,j)
 
#define mirml_mh_v_entry(x, i)   mirml_mh_v_get_val(x,i)
 
#define mirml_mh_bd_entry(A, i, j)   mirml_mh_bd_get_val(A,i,j)
 

Functions

mirkl_error_tmirml_mh_get_col (const mirml_mh_matrix_t *mat, mirkl_size_t col, mirml_mh_vector_t **vec)
 Gets a specified column of a matrix and retruns it as a vector.
 
mirkl_error_tmirml_mh_get_row (const mirml_mh_matrix_t *mat, mirkl_size_t row, mirml_mh_vector_t **vec)
 Gets a specified row of a matrix and retruns it as a vector.
 
mirkl_error_tmirml_mh_set_col_ (mirml_mh_matrix_t *mat, mirkl_size_t col, const mirml_mh_vector_t *vec, mirkl_size_t i0)
 Sets column of matrix to values given in vec (in situ). More...
 
mirkl_error_tmirml_mh_set_row_ (mirml_mh_matrix_t *mat, mirkl_size_t row, const mirml_mh_vector_t *vec, mirkl_size_t j0)
 Similar to mirml_mh_set_col_ sets row of matrix to values given in vec (in situ).
 
mirkl_error_tmirml_mh_sub_mat (const mirml_mh_matrix_t *old, mirkl_size_t row1, mirkl_size_t col1, mirkl_size_t row2, mirkl_size_t col2, mirml_mh_matrix_t **newm)
 Returns sub-matrix of old matrix. More...
 
mirkl_error_tmirml_mh_sub_vec (const mirml_mh_vector_t *old, mirkl_size_t i1, mirkl_size_t i2, mirml_mh_vector_t **newm)
 Returns sub-vector which is formed by the elements i1 to i2. More...
 

Detailed Description

Function Documentation

◆ mirml_mh_set_col_()

mirkl_error_t * mirml_mh_set_col_ ( mirml_mh_matrix_t mat,
mirkl_size_t  col,
const mirml_mh_vector_t vec,
mirkl_size_t  i0 
)

Sets column of matrix to values given in vec (in situ).

Note
Actualy this function work like that: mat(i0:lim,col) <- vec(i0:lim).

◆ mirml_mh_sub_mat()

mirkl_error_t * mirml_mh_sub_mat ( const mirml_mh_matrix_t old,
mirkl_size_t  row1,
mirkl_size_t  col1,
mirkl_size_t  row2,
mirkl_size_t  col2,
mirml_mh_matrix_t **  newm 
)

Returns sub-matrix of old matrix.

Submatrix which is formed by the rectangle from (row1,col1) to (row2,col2)

Warning
Storage is shared so that altering the "new" matrix will alter the "old" matrix.

◆ mirml_mh_sub_vec()

mirkl_error_t * mirml_mh_sub_vec ( const mirml_mh_vector_t old,
mirkl_size_t  i1,
mirkl_size_t  i2,
mirml_mh_vector_t **  newm 
)

Returns sub-vector which is formed by the elements i1 to i2.

Warning
As for mirml_mh_sub_mat, storage is shared.