コード例 #1
0
ファイル: range.c プロジェクト: usnistgov/SCTK
static void do_blk_ranges(RANK *rank, int scale, char *p_desc, char *tname, FILE *fp)
{
    int i,j;
    double Z_stat, *high, *low, *mean, *std_dev,variance,*pcts,median;
    char *title = "RANGE ANALYSIS ACROSS SPEAKERS FOR THE TEST:";
    char *title1= "by ";
    char pad[FULL_SCREEN];

    alloc_singarr(high, rank->n_blk, double);
    alloc_singarr(low, rank->n_blk, double);
    alloc_singarr(std_dev, rank->n_blk, double);
    alloc_singarr(mean, rank->n_blk, double);
    alloc_singarr(pcts, rank->n_trt, double);

    set_pad(pad,title, FULL_SCREEN);
    fprintf(fp,"\n\n\n%s%s\n",pad,title);
    set_pad(pad,tname, FULL_SCREEN);
    fprintf(fp,"%s%s\n",pad,tname);
    set_pad_cent_n(pad,strlen(title1)+strlen(p_desc), FULL_SCREEN);
    fprintf(fp,"%s%s%s\n\n\n\n\n",pad,title1,p_desc);

    /**** find the high, low, and the standard deviation for each block */
    for (i=0;i< rank->n_blk ;i++){
        high[i] = 0.0;
        low[i] = 100.0;
        mean[i] = 0.0;
        for (j=0;j< rank->n_trt ;j++){
            if (rank->pcts [ i ][ j ]  > high[i])
               high[i] = rank->pcts [ i ][ j ] ;
            if (rank->pcts [ i ][ j ]  < low[i])
                low[i] = rank->pcts [ i ][ j ] ;
            pcts[j] = rank->pcts [ i ][ j ] ;
        }
        calc_mean_var_std_dev_Zstat_double(pcts, rank->n_trt ,&(mean[i]),
                                    &(variance),&(std_dev[i]),&median,&Z_stat);
    }

    print_range_graph(scale,high,low,mean,std_dev, rank->blk_Ovr_ranks ,
		      rank->blk_name , rank->n_blk ,"  SPKR",
		      rank->trt_srt_ind,fp);

    free_singarr(high, double);
    free_singarr(low, double);
    free_singarr(std_dev, double);
    free_singarr(mean, double);
    free_singarr(pcts, double);
}
コード例 #2
0
ファイル: maxpool3d.cpp プロジェクト: nhatipoglu/MexConv3D
void factory_mp3d_homebrew::set_options(maxpool3d &holder, int opt_beg, int ni, mxArray const *vi[])
{
  // parse option/value pairs
  if ( ((ni-opt_beg)%2) != 0 )
    throw mp3d_ex("Imbalanced option/value pairs.");
  for (int i = opt_beg; i < ni; i+=2) {
    if      (isStrEqual(vi[i], "pool"))   set_pool(holder, vi[i+1]);
    else if (isStrEqual(vi[i], "stride")) set_stride(holder, vi[i+1]);
    else if (isStrEqual(vi[i], "pad"))    set_pad(holder, vi[i+1]);
    else                                  throw mp3d_ex("Unrecognized option/value pairs.");
  } // for i
}