deps/kb_meme/meme-5.0.1/src/prior-dist.c
/***********************************************************************
 * Create a new PRIOR_DIST_T object by reading the distribution 
 * from a file.
 ***********************************************************************/
Create a new PRIOR_DIST_T object by reading the distribution
from a file.
Create a new PRIOR_DIST_T object by reading the distribution from a file .
PRIOR_DIST_T *new_prior_dist(const char *filename) {
  PRIOR_DIST_T *prior_dist = mm_malloc(sizeof(PRIOR_DIST_T));
  prior_dist->dist = read_priors_from_file(
    filename,
    &(prior_dist->min),
    &(prior_dist->max),
    &(prior_dist->median)
  );
  prior_dist->range = get_array_length(prior_dist->dist);
  prior_dist->offset = prior_dist->min;
  prior_dist->scale = (prior_dist->range - 1) / (prior_dist->max - prior_dist->min);
  return prior_dist;
}
PRIOR_DIST_T * new_prior_dist ( const char * filename ) { PRIOR_DIST_T * prior_dist = mm_malloc ( sizeof ( PRIOR_DIST_T ) ) ; prior_dist -> dist = read_priors_from_file ( filename , & ( prior_dist -> min ) , & ( prior_dist -> max ) , & ( prior_dist -> median ) ) ; prior_dist -> range = get_array_length ( prior_dist -> dist ) ; prior_dist -> offset = prior_dist -> min ; prior_dist -> scale = ( prior_dist -> range - 1 ) / ( prior_dist -> max - prior_dist -> min ) ; return prior_dist ; }
Create a new PRIOR_DIST_T object by reading the distribution
 from a file.
Create a new PRIOR_DIST_T object by reading the distribution from a file .
// The first two items in the array contain // the minimum and maximium priors.