Exemple #1
0
void getYlmDes(int m, int num, double *thetas, double **YlmDes) {
  // YlmDes = { {Y(l=0) for many thetas},{Y(l=1) for many thetas}, ... }
  // The complex exponential has be factored out (hence De)
  *YlmDes = new double[num*num];
  if(m==0) {
    double *manyN  = new double[num];
    for(int i=0; i<num; i++) {
      dleg(cos(thetas[i]),manyN,num);
      for(int lmm=0; lmm<num; lmm++)
	(*YlmDes)[lmm*num+i] = manyN[lmm]*sqrt( (2*lmm+1.)/(4*M_PI) );
    }
    delete[] manyN;
  } else {
    double twomfac = 1.; for(int i=2*m; i>0; i--) twomfac *= i;
    for(int i=0; i<num; i++) {
      double costhetai = cos(thetas[i]);
      double lmmfacDlpmfac = 1./twomfac;	    
      for(int lmm=0; lmm<num; lmm++) {
	if(lmm!=0) lmmfacDlpmfac *= lmm/(lmm+2.*m);
	(*YlmDes)[lmm*num+i] = dplgndr(lmm+m,m,costhetai)
	  *sqrt( (2*(lmm+m)+1.)/(4*M_PI)*lmmfacDlpmfac ); 
      }
    }
  }
} // getYlmDes
Exemple #2
0
/*
 * Compare-descending (Score)

  meta \result == 0 - comp_auc_desc(bp, ap);
*/
 static int comp_auc_desc(const void *ap, const void *bp)
{
  Score *a, *b;
    
  a = (Score *)ap;
  b = (Score *)bp;
  
  return dleg(b->auc, a->auc);
}