int main(int argc, char **argv)
{

	int i,j;
	FILE *out;
	TwoDoubles res;
	isInitDone = 0;
	trialid = 3;

	out = fopen("/Users/zhangtao/storage/Tsinghua_work/UQ/algorithms/partition_downhill_simplex/problems/bbob/res_data", "w");

	DIM = argc - 1;
	double *X = (double*)malloc(DIM*sizeof(double));

	for(i = 0; i < DIM; i++){
		X[i] = atof(argv[i+1]);
		//printf("%e ", X[i]);
	}
	//printf("\n");

	initbenchmarks();
	initbenchmarkshelper();
	res = f24(X);

	//printf("Res is %lf\n", res.Fval);
	fprintf(out,"%e\n",res.Fval);

	fclose(out);

  	return 0;	
}
// This function is responsable for the init process of BBOB functions.
//
// @param dimension [unsigned int] Dimension of the problem.
// @param fid [unsigned int] Function id. Integer in {1, ..., 24}.
// @param iid [unsigned int] Instance id.
//
// @return Nothing. Just do some side-effects.
static void initializeBBOBFunction(const unsigned int dimension, const unsigned int fid, const unsigned int iid) {
  if (init == 0 || last_fid != fid || last_iid != iid || last_dimension != dimension) {
    if (init != 0) {
      finibenchmarks();
      finibenchmarkshelper();
      init = 0;
    }
    // init BBOB function
    isInitDone = 0;
    DIM = dimension;
    last_dimension = dimension;

    // call BBOB initilizer functions
    initbenchmarkshelper();
    initbenchmarks();
    trialid = last_iid = iid;
    last_fid = fid;

    // inititialization finished
    init = 1;
    Fopt = computeFopt(fid, iid);
  }
}