deps/kb_meme/meme-5.0.1/src/substmatrix-table.c
/******************************************************************************
  * This function allocates an empty substmatrix_table with space allocated
  * for 'length' pointers to substmatrix_arrays.
******************************************************************************/
This function allocates an empty substmatrix_table with space allocated
for 'length' pointers to substmatrix_arrays.
This function allocates an empty substmatrix_table with space allocated for ' length ' pointers to substmatrix_arrays .
SUBSTMATRIX_TABLE_T* allocate_substmatrix_table(int length) {
  SUBSTMATRIX_TABLE_T* table = 
    (SUBSTMATRIX_TABLE_T*) mm_malloc(sizeof(SUBSTMATRIX_TABLE_T));
  table->length = length;
  table->substmatrix_array = (SUBSTMATRIX_ARRAY_T**) 
    mm_malloc(length * sizeof(SUBSTMATRIX_ARRAY_T*));
  int i;
  for (i = 0; i < length; i++) {
    table->substmatrix_array[i] = NULL;
  }
  return table;
}
SUBSTMATRIX_TABLE_T * allocate_substmatrix_table ( int length ) { SUBSTMATRIX_TABLE_T * table = ( SUBSTMATRIX_TABLE_T * ) mm_malloc ( sizeof ( SUBSTMATRIX_TABLE_T ) ) ; table -> length = length ; table -> substmatrix_array = ( SUBSTMATRIX_ARRAY_T * * ) mm_malloc ( length * sizeof ( SUBSTMATRIX_ARRAY_T * ) ) ; int i ; for ( i = 0 ; i < length ; i ++ ) { table -> substmatrix_array [ i ] = NULL ; } return table ; }
This function allocates an empty substmatrix_table with space allocated
 for 'length' pointers to substmatrix_arrays.
This function allocates an empty substmatrix_table with space allocated for ' length ' pointers to substmatrix_arrays .
// Initialize all array elments.