snpy/dm15temp/dm15temp_CRB.c
double *center_dm15(double center, double dm15_templates[],int N) {
  int j=0,i=0;  
  double WE=0, sum=0, DM15=0, *wit, functionwidth=0, dm15_temp_width=0, dm15_temp=0;
  
  for(i=0; i<200;i++){
    weight[i]=0;
  }
  i=0;
  for( j=0; j < N; j++) {  
    dm15_temp = dm15_templates[j];
    functionwidth = width(center);
    WE = Wdm15("triangle",dm15_temp, center, functionwidth);
    weight[j] = WE;
    sum = sum + WE;
  }

  for(i=0; i<N; i++){
    weight[i] = (weight[i]/sum);
  }
  for(i=0; i<N; i++) {
    DM15 = DM15 + weight[i]*dm15_templates[i];
  }
  weight[N]= DM15;
  return weight;
}
/* This function returns the final vector of weights */
This function returns the final vector of weights
This function returns the final vector of weights
double *center_dm15(double center, double dm15_templates[],int N) {
  int j=0,i=0;  
  double WE=0, sum=0, DM15=0, *wit, functionwidth=0, dm15_temp_width=0, dm15_temp=0;
  for(i=0; i<200;i++){
    weight[i]=0;
  }
  i=0;
  for( j=0; j < N; j++) {  
    dm15_temp = dm15_templates[j];
    functionwidth = width(center);
    WE = Wdm15("triangle",dm15_temp, center, functionwidth);
    weight[j] = WE;
    sum = sum + WE;
  }
  for(i=0; i<N; i++){
    weight[i] = (weight[i]/sum);
  }
  for(i=0; i<N; i++) {
    DM15 = DM15 + weight[i]*dm15_templates[i];
  }
  weight[N]= DM15;
  return weight;
}
double * center_dm15 ( double center , double dm15_templates [ ] , int N ) { int j = 0 , i = 0 ; double WE = 0 , sum = 0 , DM15 = 0 , * wit , functionwidth = 0 , dm15_temp_width = 0 , dm15_temp = 0 ; for ( i = 0 ; i < 200 ; i ++ ) { weight [ i ] = 0 ; } i = 0 ; for ( j = 0 ; j < N ; j ++ ) { dm15_temp = dm15_templates [ j ] ; functionwidth = width ( center ) ; WE = Wdm15 ( " " , dm15_temp , center , functionwidth ) ; weight [ j ] = WE ; sum = sum + WE ; } for ( i = 0 ; i < N ; i ++ ) { weight [ i ] = ( weight [ i ] / sum ) ; } for ( i = 0 ; i < N ; i ++ ) { DM15 = DM15 + weight [ i ] * dm15_templates [ i ] ; } weight [ N ] = DM15 ; return weight ; }
This function returns the final vector of weights
This function returns the final vector of weights