The main program starts by declaring the environment and terminates by calling method end()
for the environment. The code in between is encapsulated in a try block that catches all Concert Technology exceptions and prints them to the C++ error stream cerr
. All other exceptions are caught as well, and a simple error message is issued. The first action of the program is to evaluate command line parameters and call function usage in cases of misuse.
|
IloModel mod(env);
|
mod.add(IloMinimize(env, IloScalProd(Buy, foodCost)));
|
mod.add(nutrMin[i] <= expr <= nutrMax[i]);
|
After an expression has been used for creating a constraint, it is deleted by calling expr.end()
.
Finally, the array of modeling variables Buy
is returned.
IloObjective cost = IloAdd(mod, IloMinimize(env));
|
IloNumVar(col, foodMin[j], foodMax[j], type)
|