Mir 1.0
Mir application programming interface
Allocation and freeing of objects

Functions

mirkl_error_tmirml_mh_m_get (mirkl_size_t m, mirkl_size_t n, mirml_mh_matrix_t **mat)
 Creates an m-x-n matrix by dynamic memory allocation. More...
 
mirkl_error_tmirml_mh_v_get (mirkl_size_t size, mirml_mh_vector_t **vec)
 Creates a vector. More...
 
mirkl_error_tmirml_mh_iv_get (mirkl_size_t size, mirml_mh_ivector_t **vec)
 Similar to mirml_mh_v_get creates a vector of integers. More...
 
mirkl_error_tmirml_mh_i64v_get (mirkl_size_t size, mirml_mh_i64vector_t **vec)
 Similar to mirml_mh_v_get creates a vector of 64-bit integers. More...
 
mirkl_error_tmirml_mh_px_get (int size, mirml_mh_permutation_t **perm)
 Creates a permutation of given size. More...
 
mirkl_error_tmirml_mh_iter_get (int lenb, int lenx, mirml_mh_iter_t **iter)
 Creates and initializes a new structure pointing to mirml_mh_iter_t.
 

Functions to free Meschach objects.

void mirml_mh_m_free (mirml_mh_matrix_t *mat)
 
void mirml_mh_v_free (mirml_mh_vector_t *vec)
 
void mirml_mh_iv_free (mirml_mh_ivector_t *vec)
 
void mirml_mh_i64v_free (mirml_mh_i64vector_t *vec)
 
void mirml_mh_px_free (mirml_mh_permutation_t *px)
 
void mirml_mh_iter_free (mirml_mh_iter_t *ip)
 

Macros that also check types and set pointers to NULL.

#define MIRML_MH_MATRIX_FREE(mat)   ( mirml_mh_m_free(mat), (mat)=(mirml_mh_matrix_t *)NULL )
 
#define MIRML_MH_VECTOR_FREE(vec)   ( mirml_mh_v_free(vec), (vec)=(mirml_mh_vector_t *)NULL )
 
#define MIRML_MH_IVECTOR_FREE(vec)   ( mirml_mh_iv_free(vec), (vec)=(mirml_mh_ivector_t *)NULL )
 
#define MIRML_MH_I64VECTOR_FREE(vec)   ( mirml_mh_i64v_free(vec),(vec)=(mirml_mh_i64vector_t *)NULL )
 
#define MIRML_MH_PERMUTATION_FREE(px)   ( mirml_mh_px_free(px), (px)=(mirml_mh_permutation_t *)NULL )
 
#define MIRML_MH_SPMATRIX_FREE(mat)   ( mirml_mh_sp_free(mat), (mat)=(mirml_mh_spmatrix_t *)NULL )
 
#define MIRML_MH_ITER_FREE(it)   ( mirml_mh_iter_free(it),(it)=(mirml_mh_iter_t *)NULL )
 

Detailed Description

Function Documentation

◆ mirml_mh_i64v_get()

mirkl_error_t * mirml_mh_i64v_get ( mirkl_size_t  size,
mirml_mh_i64vector_t **  vec 
)

Similar to mirml_mh_v_get creates a vector of 64-bit integers.

Note
Elements of the created vector are initialized to zero.

◆ mirml_mh_iv_get()

mirkl_error_t * mirml_mh_iv_get ( mirkl_size_t  size,
mirml_mh_ivector_t **  vec 
)

Similar to mirml_mh_v_get creates a vector of integers.

Note
Elements of the created vector are initialized to zero.

◆ mirml_mh_m_get()

mirkl_error_t * mirml_mh_m_get ( mirkl_size_t  m,
mirkl_size_t  n,
mirml_mh_matrix_t **  mat 
)

Creates an m-x-n matrix by dynamic memory allocation.

Parameters
[in]mnumber of rows.
[in]nnumber of columns.
[out]matPointer to matrix structure to be created.
Note
Normally ALL matrices should be obtained this way.
If either m or n is negative this will raise an error.
0 x n and m x 0 matrices can be created.
Elements of the created matrix are initialized to zero.

◆ mirml_mh_px_get()

mirkl_error_t * mirml_mh_px_get ( int  size,
mirml_mh_permutation_t **  perm 
)

Creates a permutation of given size.

Note
Initialized to the identity permutation {0,1,2,...,size-1}.

◆ mirml_mh_v_get()

mirkl_error_t * mirml_mh_v_get ( mirkl_size_t  size,
mirml_mh_vector_t **  vec 
)

Creates a vector.

Parameters
[in]sizeSize of the vector.
[out]vecPointer to vector structure to be created.
Note
Elements of the created vector are initialized to zero.