c++ - How does cplex allocate memory to a IloExpr type? -


my algorithm aborts before finalizing creation of objective function of problem. following use of computer's memory, can see overflows. in terminal, message: "killed" appears. part of code i'm having trouble is:

iloenv env = monod.env; monod.mod = ilomodel(env);  monod.cplex = ilocplex(monod.mod);  monod.beta = ilonumvararray(env, dbeta.size(), 0, +iloinfinity,ilofloat);  iloexpr xpfo(env); (int = 0; < 18; i++){    (int j = 0; j < 18; j++){      if (w[i][j] != 0){       (int u = 19; u <= 35; u++) {          (int v = 19; v <= 35; v++) {           if (ise(u,v)) {             xpfo = xpfo - monod.beta[i,j,u,v];            }         }          (int u = 36; u <= 52; u++) {            (int v = 36; v <= 52; v++) {              if (ise(u,v)) {               xpfo = xpfo - monod.beta[i,j,u,v];              }           }        }     }   } }  monod.fo = iloadd(monod.mod, ilomaximize(env, xpfo)); xpfo.end(); 

i know have lot of variables, in ampl can solve instance without problem. other interesting thing when utilize gurobi same implementation, don't have memory's problem. then, want know if doing wrong or if can cplex's problem. knows how cplex allocate memory iloexpr type?

thank you!


Comments