示例#1
0
文件: reg1.cpp 项目: rforge/genabel
void logistic_reg::score(mematrix<double>& resid, regdata& rdata, int verbose,
                         double tol_chol, int model, int interaction,
                         int ngpreds, masked_matrix& invvarmatrix,
                         int nullmodel)
{
    base_score(resid, rdata, verbose, tol_chol, model, interaction, ngpreds,
               invvarmatrix, nullmodel = 0);
}
示例#2
0
文件: reg1.cpp 项目: rforge/genabel
void linear_reg::score(mematrix<double>& resid, regdata& rdatain, int verbose,
                       double tol_chol, int model, int interaction, int ngpreds,
                       const masked_matrix& invvarmatrix, int nullmodel)
{
    regdata rdata = rdatain.get_unmasked_data();
    base_score(resid, rdata, verbose, tol_chol, model, interaction, ngpreds,
               invvarmatrix, nullmodel = 0);
}
示例#3
0
void logistic_reg::score(const mematrix<double>& resid,
                         const int model,
                         const int interaction, const int ngpreds,
                         const masked_matrix& invvarmatrix,
                         int nullmodel) {
    base_score(resid, model, interaction, ngpreds,
               invvarmatrix, nullmodel = 0);
    // TODO: find out why nullmodel is assigned 0 in the call above.
}
示例#4
0
void linear_reg::score(const mematrix<double>& resid,
                       const int model,
                       const int interaction, const int ngpreds,
                       const masked_matrix& invvarmatrix,
                       int nullmodel)
{
    //regdata rdata = rdatain.get_unmasked_data();
    base_score(resid, model, interaction, ngpreds,
               invvarmatrix, nullmodel = 0);
    // TODO: find out why nullmodel is assigned 0 in the call above.
}
示例#5
0
文件: meter.c 项目: kroger/rameau
void build_pip_array(Note *nl) {
  /* Build the pip array from the note list.  This is where the
     quantization of the notes takes place.

     Also clears the first_beat[] array.
  */
    
  Note * xn;
  int last_time=0, xtime;
  int i, j;
  Pip_note_list *pnl;

  for (j=0; j<N_LEVELS; j++) {
    first_beat[j] = 0;
  }
    
  for (xn = nl; xn != NULL; xn = xn->next) {
    xtime = xn->start + xn->duration;
    if (last_time < xtime) last_time = xtime;
  }
    
  N_pips = quantize(last_time)+1;  /* the pips start at 0 */
    
  pip_array = (Pip *) xalloc(N_pips * sizeof(Pip));
    
  for (i=0; i<N_pips; i++) {
    pip_array[i].pnl = NULL;
    pip_array[i].nnotes = 0;
    for (j=0; j<N_LEVELS; j++) {
	    pip_array[i].is_beat[j] = 0;  /* turn off all beat marks */
    }
  }
    
  add_chords(); /* Davy added */
    
  /* now let's quantize all the notes and put them into the pip array */
    
  for (xn = nl; xn != NULL; xn = xn->next) {
    i = quantize(xn->start);
    /*This routine takes each note and "quantizes" it (i.e.
      determines the number of the pip containing it), then
      then adds the note to the pip of that number. -Davy */
    /* now add this note to pip list [i] */
    pnl = (Pip_note_list *) xalloc(sizeof(Pip_note_list));
    pnl->note = xn;
    pnl->weight = 1.0;
    pnl->next = pip_array[i].pnl;
    pip_array[i].pnl = pnl;	
    pip_array[i].nnotes++;
    /* This tallies up the number of notes starting on each pip */
  }
    
  /*    find_gaps(); */
    
    
  /* Ok we've just done the first part of the quantization.  Now
     we we apply a very crude system to deal with close notes that happen
     to be rounded to different pips.  Simple walk through the pip array,
     and when a pip has notes, and its precedecessor has notes, move them
     to the predecessor.  This results in no two occupied pips in a row.
  */
    
  for (i=1; i<N_pips; i++) {
    if (pip_array[i-1].pnl != NULL && pip_array[i].pnl != NULL) move_notes(i-1, i);
  }
    
  for (i=0; i<N_pips; i++) {
    pip_array[i].base = base_score(pip_array[i].pnl, FALSE) + pip_array[i].chord;
    /* Here I add the chord value of each pip
       to its base value - Davy */
    pip_array[i].higher_base = base_score(pip_array[i].pnl, TRUE) + pip_array[i].chord; 
    pip_array[i].score = NULL;
  }
}