- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Loading an MIP solution
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-08-2012 04:49 AM
I'm having trouple loading an existing MIP solution into XPRESS using C++. The documentation for "load MIP solution" has the following example based on C:
XPRBprob expl2;
double vals[] = {1.5, 1, 0, 4, 2.2};
expl2 = XPRBnewprob("example2");
if (XPRBloadmipsol(expl2, vals, 5, 0)!=0)
printf("Loading the solution failed.\n");Here, vals is an array (of size 5) that holds the MIP solution you want to feed in, and expl2 is the name of your problem.
This all seems fine, but I am implementing a similar system in C++, so I have written the following code:
XPRBprob expl2("example2");
double vals[] = {1.5, 1, 0, 4, 2.2};
if (XPRBloadmipsol(expl2, vals, 5, 0)!=0)
cout<<"Loading the solution failed.\n";However, the XPRBloadmipsol statement does not work. Specifically, I get the following error when I compile:
error C2664: 'xbloadmipsol_prob' : cannot convert parameter 1 from 'class dashoptimization::XPRBprob' to 'struct Xbprob *'
This suggests that the paramters for the C++ version of this function are different to the C version. But I cannot find any documentation on this.
Could anyone offer any help?
Thanks
Rhyd
Solved! Go to Solution.
Re: Loading an MIP solution
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Not the Solution
- Email to a Friend
- Report Inappropriate Content
03-08-2012 07:29 AM
Problem solved.
Here's the c++ code that will work
if(expl2.loadMIPSol(vals, 5, 0)!=0)
cout<<"Loading the solution failed.\n";
The fact the "MIP" is in upper-case in the C++ command and lower-case in the C command was not particularly helpful!

