I am coding a decomposition algorithm including scenario subproblems. I need to use model pointer to create subproblem optimization models. Then, it is needed to modify the objective function coefficient of each subproblem as the algorithm proceeds. I need to use pointers to avoid creating the subproblem models every time from scratch. How should I do that? Can I use this:
IloModel** MaxProblemPtr= new(env) IloModel*[numberOfScenarios];
IloObjective** MaxObjPtr= new(env) IloObjective*[numberOfScenarios];
Then, is it correct to keep pointers to the implementation instances for each scenario subproblem like the followings:
IloModel MaxProblem(env);
*(MaxProblemPtr[scnenarioN])=MaxProblem.getImpl();
IloObjective MaxObj=IloAdd(MaxProblem, IloMaximize(env));
*(MaxObjPtr[scnenarioN])=MaxObj.getImpl();
Thank you much,