/*Provide dimension of the problem. Integer >= 1.*/ #define N 9 /*Provide the diameter of the feasible region.*/ /*Provide maximum number of iterations.*/ #define MAXITER 100*N*N/*500*N */ #define PI 3.14159265359 void bounds(double lb[], double ub[]); int feasible(double x[]); double objfn(double x[]); void bounds(double lb[], double ub[]) /*Provide lower and upper bounds for each of N variables. Number of bounds is equal to N.*/ { int i; for (i=0; i> %f %f\n", 2.0/m*j, pow(2.0/m*j,N-i-1)); } if (w>1) pj = (w-1)*(w-1); else if (w<-1) pj = (w+1)*(w+1); else pj = 0.0; // printf("j %d %f %f\n", j, w, pj); p3 += pj; } sum = p1+p2+p3; // printf("%f %f %f %f %f\n", u, p1, v, p2, p3); return (sum); }