/*---------------------------------------------------------------------- Main Program ----------------------------------------------------------------------*/ int main(int argc, char **argv) { FILE *nl; ASL *asl; int i, j, k ; double Times[4]; char *stub, *getenvErr; cgrad *cg; ograd *og; real *loVarBnd, *upVarBnd, *loConBnd, *upConBnd; Times[0] = xectim_(); /*** Get name of .nl file; read problem sizes ***/ if (argc < 2) { fprintf(stderr, "Usage: %s stub\n", argv[0]); return 1; } asl = ASL_alloc(ASL_read_f); stub = getstub(&argv, &Oinfo); nl = jac0dim(stub, (fint)strlen(stub)); nonlin(nlc, "constraint"); nonlin(nlo, "objective"); /*** Read coefficients & bounds from .nl file ***/ Uvx = (real *)Malloc(n_var*sizeof(real)); Urhsx = (real *)Malloc(n_con*sizeof(real)); f_read(nl,0); loVarBnd = LUv; upVarBnd = Uvx; loConBnd = LUrhs; upConBnd = Urhsx; /*** Get and record ILOG Planner options ***/ IlcInitFloat(); IlcManager mip(IlcEdit); smplx = IlcSimplex(mip); if (amplflag) need_nl = printf("%s: ", solverID); if (getopts(argv, &Oinfo)) exit(1); int n_badvals = 0; switch(ilcDisplay) { case 0: break; case 1: printf("\n Branch Objective ChPt Iter\n"); break; default: cout << "Invalid value " << ilcDisplay << " for directive display" << endl; n_badvals++; } if (ilcDispFreq < 0) { cout << "Invalid value " << ilcDispFreq << " for directive disp_freq" << endl; n_badvals++; } switch(ilcBranchDir) { case 0: boundMixedVar = IlcTryUpwardFirst; break; case 1: boundMixedVar = IlcTryDownwardFirst; break; case 2: boundMixedVar = IlcTryCloserFirst; break; case 3: boundMixedVar = IlcTryFartherFirst; break; default: cout << "Invalid value " << ilcBranchDir << " for directive branch_dir" << endl; n_badvals++; } switch(ilcBranchVar) { case 0: chooseMixedIndex = MostNotInteger; break; case 1: chooseMixedIndex = LeastNotInteger; break; default: cout << "Invalid value " << ilcBranchVar << " for directive branch_var" << endl; n_badvals++; } switch(ilcSparseCon) { case 0: break; case 1: break; default: cout << "Invalid value " << ilcSparseCon << " for directive sparse_con" << endl; n_badvals++; } switch(ilcSparseObj) { case 0: break; case 1: break; default: cout << "Invalid value " << ilcSparseObj << " for directive sparse_obj" << endl; n_badvals++; } switch(ilcTiming) { case 0: break; case 1: break; default: cout << "Invalid value " << ilcTiming << " for directive timing" << endl; n_badvals++; } IlcBool postAll, duplAll; switch(ilcUseSolver) { case 0: postAll = IlcFalse; duplAll = IlcFalse; break; case 1: postAll = IlcTrue; duplAll = IlcFalse; break; case 2: postAll = IlcFalse; duplAll = IlcTrue; break; case 3: postAll = IlcTrue; duplAll = IlcTrue; break; default: cout << "Invalid value " << ilcUseSolver << " for directive use_solver" << endl; n_badvals++; } switch(ilcUseInt) { case 0: break; case 1: break; default: cout << "Invalid value " << ilcUseInt << " for directive use_integer" << endl; n_badvals++; } if (n_badvals) exit(1); /*** Get integrality tolerance ***/ char* s; if (s = getenv("presolve_inteps")) inteps = atof(s); if (inteps < 0) { cout << "Illegal value " << inteps << " for presolve_inteps: must be nonnegative" << endl; exit(1); }