Download Blaze Trial
Follow FICO
LinkedIn   Twitter   Youtube
Close To access this section, please choose the Community Neighborhood in which you have the most interest.

» Business Rules Management
» Collections & Recovery
» Fraud Management
» Risk Management
» Scoring
Close To access this section, please choose the Community Neighborhood in which you have the most interest.

» Business Rules Management
» Collections & Recovery
» Fraud Management
» Risk Management
» Scoring
Reply
Visitor
Rhyd
Posts: 4
Registered: ‎02-19-2010
Accepted Solution

Loading an MIP solution

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

 

Visitor
Rhyd
Posts: 4
Registered: ‎02-19-2010

Re: Loading an MIP solution

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!