# Can we use IloObjective::setLinearCoefs with collection of pointers to IloObjective?

 -1 I am trying to generate scenario subproblems for a decomposition algorithm. 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 as follows: std::vectormodelPtrs (numberOfSceanrios); std::vectorobjectivePtrs (numberOfSceanrios);  After creating subproblem pointers, I try to change the objective function coefficients of the first scenario subproblem as follows: IloObjective* tempObj= objectivePtrs[0]; *tempObj.setLinearCoefs(X,XCoeff);  I get the error of "unhandled exception: Access violation reading location". I will appreciate if anyone let me know what I am doing wrong. Thank you much. asked 09 Oct '15, 13:39 ORSE 5●3 accept rate: 0% See if my answer to your other question would answer this question as well and report back. Good luck. (09 Oct '15, 14:14) Ehsan ♦ Subproblems have also different constraint sets. So I have to define pointers. Thanks, (09 Oct '15, 14:21) ORSE
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