I am using c++ to solve a simple linear model ,however there is a fatal error when compiling program:

///////////////

#include

ILOSTLBEGIN

static void

usage (const char *progname),

populatebyrow (IloModel model, IloNumVarArray var, IloRangeArray con),

populatebycolumn (IloModel model, IloNumVarArray var, IloRangeArray con),

populatebynonzero (IloModel model, IloNumVarArray var, IloRangeArray con);

int

main (int argc, char **argv)

{

IloEnv env;

try {

IloModel model(env);

if (( argc != 2 ) ||

( argv[1][0] != '-' ) ||

( strchr ("rcn", argv[1][1]) == NULL ) ) {

usage (argv[0]);

throw(-1);

}

IloNumVarArray var(env);

IloRangeArray con(env);

switch (argv[1][1]) {

case 'r':

populatebyrow (model, var, con);

break;

case 'c':

populatebycolumn (model, var, con);

break;

case 'n':

populatebynonzero (model, var, con);

break;

}

IloCplex cplex(model);

// Optimize the problem and obtain solution.

if ( !cplex.solve() ) {

env.error()

More Iman Rahimi's questions See All
Similar questions and discussions