snpy/dm15temp/dm15temp_CRB.c
double Wdm15(char FUNC[], double center_temp, double center_dm15, double fwidth) { 
  int array[3],i=0,j,C;
  double weight;
  struct functions
  {
    char func1[50];
    char func2[50];
    char func3[50];
  };
  struct functions name={"triangle","box","log"};
  C = strcmp(FUNC,name.func1);
  array[0]=C;
  C = strcmp(FUNC,name.func2);
  array[1]=C;
  C = strcmp(FUNC,name.func3);
  array[2]=C;
  for(i=0; i < 3; i++) {
    if(array[i] == 0) {j=i+1;}
  }
  weight=triweight(center_temp, center_dm15, fwidth, j);
  return weight;
}
/*
  Definition of different weighting functions: triangle, box function,
  and a log function (the log function doesn't work !)
*/
Definition of different weighting functions: triangle, box function,
and a log function (the log function doesn't work !)
Definition of different weighting functions : triangle box function and a log function ( the log function doesn ' t work ! )
double Wdm15(char FUNC[], double center_temp, double center_dm15, double fwidth) { 
  int array[3],i=0,j,C;
  double weight;
  struct functions
  {
    char func1[50];
    char func2[50];
    char func3[50];
  };
  struct functions name={"triangle","box","log"};
  C = strcmp(FUNC,name.func1);
  array[0]=C;
  C = strcmp(FUNC,name.func2);
  array[1]=C;
  C = strcmp(FUNC,name.func3);
  array[2]=C;
  for(i=0; i < 3; i++) {
    if(array[i] == 0) {j=i+1;}
  }
  weight=triweight(center_temp, center_dm15, fwidth, j);
  return weight;
}
double Wdm15 ( char FUNC [ ] , double center_temp , double center_dm15 , double fwidth ) { int array [ 3 ] , i = 0 , j , C ; double weight ; struct functions { char func1 [ 50 ] ; char func2 [ 50 ] ; char func3 [ 50 ] ; } ; struct functions name = { " " , " " , " " } ; C = strcmp ( FUNC , name . func1 ) ; array [ 0 ] = C ; C = strcmp ( FUNC , name . func2 ) ; array [ 1 ] = C ; C = strcmp ( FUNC , name . func3 ) ; array [ 2 ] = C ; for ( i = 0 ; i < 3 ; i ++ ) { if ( array [ i ] == 0 ) { j = i + 1 ; } } weight = triweight ( center_temp , center_dm15 , fwidth , j ) ; return weight ; }
Definition of different weighting functions: triangle, box function,
and a log function (the log function doesn't work !)
Definition of different weighting functions : triangle box function and a log function ( the log function doesn ' t work ! )