
//global.h

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <iostream.h>
#include <fstream.h>
#include <assert.h>
#define abss(a)     (a<0 ? (-a) : a)

//------------------------------------
#define IM1 2147483563
#define IM2 2147483399
#define AM (1.0/IM1)
#define IMM1 (IM1-1)
#define IA1 40014
#define IA2 40692
#define IQ1 53668
#define IQ2 52774
#define IR1 12211
#define IR2 3791
#define NTAB 32
#define NDIV (1+IMM1/NTAB)
#define EPS 1.2e-7
#define RNMX (1.0-EPS)
//------------------------------------
#define PI	3.141592653589793
#define e	exp(1.0)

#define abss(a)     (a<0 ? (-a) : a)
#define max(a , b)  (a>b ?   a  : b)
#define min(a , b)  (a>b ?   b  : a)


#define		NF			20
//-------------------------------------------Parameter Settings------------------
#define		Run			25   // running times

#define		ps			60   // population size

#define		D			50   // dimension size
// D = 50, D = 100, D=200, D=500, and D = 1000

#define		MAX_FEs			5000*D	 // MAX_FEs

// 5000 * D
//				F = 1, 2, 3, ...12, 13, 14,...,19
#define		F			1


//////////////////////////////////////////////////////
double Rand_double(double low, double up);
double u(double xi,double a,double k,double m);
///---------bechmark functions
double func(int func_number , int dim , double* x);
 

void divideFunctions(int dim, double *s, double *part1, double *part2, double m, int *psize1, int *psize2);

//----------------baisc functions used in f12-f21------

double func(int func_number , int dim , double* x);
double Shifted_Sphere(double* x );
double Schwefel_Problem(double* x );
double Shifted_Rosenbrock(double* x );
double Shifted_Rastrigin(double* x );
double Shifted_Griewank(double* x );
double Shifted_Ackley(double* x );
double Shifted_Weierstrass(double* x );


//----------------------------------------
long double Shifted_Sphere( int dim , const double* x );
long double Schwefel_Problem( int dim , const double* x);
long double Shifted_Rosenbrock( int dim , const double* x );
long double Shifted_Rastrigin( int dim , const double * x );
long double Shifted_Griewank( int dim , const double * x );
long double Shifted_Ackley( int dim , const double* x );
//-----------f7-f11-new
long double f_Schwefel2_22(int dim, double *s);
long double f_Schwefel1_2(int dim, double *s);
long double Extended_f_10(int dim, double *x);
long double f_Bohachevsky(int dim, double *s);
long double f_Schaffer(int dim, double *s);
///////////////////////  f12-f19
long double f_Hybrid_12(int dim, double *s); 
long double f_Hybrid_13(int dim, double *s); 
long double f_Hybrid_14(int dim, double *s); 
long double f_Hybrid_15(int dim, double *s); 
long double f_Hybrid_16new(int dim, double *s); 
long double f_Hybrid_17new(int dim, double *s); 
long double f_Hybrid_18new(int dim, double *s); 
long double f_Hybrid_19new(int dim, double *s);  