deps/kb_meme/meme-5.0.1/src/substmatrix-table.c
/******************************************************************************
  * This function allocates an empty substmatrix_array with space allocated
  * for 'length' pointers to transition matricese and corresponding times.
******************************************************************************/
This function allocates an empty substmatrix_array with space allocated
for 'length' pointers to transition matricese and corresponding times.
This function allocates an empty substmatrix_array with space allocated for ' length ' pointers to transition matricese and corresponding times .
SUBSTMATRIX_ARRAY_T* allocate_substmatrix_array(int length) {
  SUBSTMATRIX_ARRAY_T* a = 
    (SUBSTMATRIX_ARRAY_T*) mm_malloc(sizeof(SUBSTMATRIX_ARRAY_T));
  a->length = length;
  a->t = (double *) mm_malloc(length * sizeof(double));
  a->substmatrix = (MATRIX_T**) mm_malloc(length * sizeof(MATRIX_T*));
  int i;
  for (i = 0; i < length; i++) {
    a->t[i] = 0.0;
    a->substmatrix[i] = NULL;
  }
  return a;
}
SUBSTMATRIX_ARRAY_T * allocate_substmatrix_array ( int length ) { SUBSTMATRIX_ARRAY_T * a = ( SUBSTMATRIX_ARRAY_T * ) mm_malloc ( sizeof ( SUBSTMATRIX_ARRAY_T ) ) ; a -> length = length ; a -> t = ( double * ) mm_malloc ( length * sizeof ( double ) ) ; a -> substmatrix = ( MATRIX_T * * ) mm_malloc ( length * sizeof ( MATRIX_T * ) ) ; int i ; for ( i = 0 ; i < length ; i ++ ) { a -> t [ i ] = 0.0 ; a -> substmatrix [ i ] = NULL ; } return a ; }
This function allocates an empty substmatrix_array with space allocated
 for 'length' pointers to transition matricese and corresponding times.
This function allocates an empty substmatrix_array with space allocated for ' length ' pointers to transition matricese and corresponding times .
// Initialize all array elments.