# Unhandled exception error c++ when using pointer of Objects IloModel and IloObjective::setLinearCoefs?

 -1 I am coding a decomposition algorithm including scenario subproblems. I used 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 used pointers to avoid creating the subproblem models every time from scratch. The code is shown partially as follows; the subproblem model pointers (for 2 scenarios) are generated and then objective function coefficients for one scenario subproblem must change using IloObjective::setLinearCoefficients. The modified subproblem must be solved again: int main (int argc, char **argv) { int ScenearioNum=2;//Number of scenarios in small example IloEnv env; try { //Generate the subproblem model pointers: IloModel* MaxProblemPtr= new(env) IloModel[ScenearioNum]; IloObjective* MaxObjPtr= new(env) IloObjective[ScenearioNum]; for (int s=0;s
Be the first one to answer this question!
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags:

×191
×30
×21
×9
×1