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::vector<IloModel*>modelPtrs (numberOfSceanrios);
std::vector<IloObjective*>objectivePtrs (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's gravatar image

ORSE
52
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

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • 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

Asked: 09 Oct '15, 13:39

Seen: 346 times

Last updated: 09 Oct '15, 14:21

OR-Exchange! Your site for questions, answers, and announcements about operations research.