AnsweredAssumed Answered

Loading an MIP solution

Question asked by Rhyd Lewis on Mar 8, 2012
Latest reply on Mar 8, 2012 by Rhyd Lewis

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?