/*------------------------------------------------------------------- Solve integer program in ILOG Planner -------------------------------------------------------------------*/ if (ilcTiming) Times[1] = xectim_(); if (nbv + niv == 0) { mip.nextSolution(); } else { Xi.setStorable(); if (objAllInt && ilcUseInt == 1) mip.add( MixedGenerateInt(mip,Xi,ObjInt,smplx,objtype[0]) ); else mip.add( MixedGenerateFloat(mip,Xi,ObjFloat,smplx,objtype[0]) ); while (mip.nextSolution()) { mip.storeSolution(); } mip.restart(); mip.nextSolution(); } /*** Write solution ***/ if (ilcTiming) Times[2] = xectim_(); int sSoFar = 0; char sMsg[256]; real *Xopt = new real [n_var]; printf ("\n"); sSoFar += Sprintf(sMsg, "%s: optimal solution found\n", solverID); sSoFar += Sprintf(sMsg+sSoFar, "%d choice points, %d simplex iterations, objective ", mip.getNumberOfChoicePoints(), smplx.getNbOfIterations()); if (objAllInt && ilcUseInt == 1) g_fmtop(sMsg+sSoFar, smplx.getCurrentValue(ObjInt)); else g_fmtop(sMsg+sSoFar, smplx.getCurrentValue(ObjFloat)); for (j = 0; j < n_var; j++) Xopt[j] = smplx.getCurrentValue(X[j]); write_soln(sMsg, Xopt, 0); delete [] Xopt; if (ilcTiming) { Times[3] = xectim_(); fprintf(stdout, "Times (seconds):\nInput = %g\nSolve = %g\nOutput = %g\n\n", Times[1] - Times[0], Times[2] - Times[1], Times[3] - Times[2]); } smplx.end(); mip.end(); return 0; }