/*Provide dimension of the problem. Integer >= 1.*/ #define N 17 /*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; i1) pj = (w-1)*(w-1); else if (w<-1) pj = (w+1)*(w+1); else pj = 0.0; p3 += pj; } sum = p1+p2+p3; return (sum); }