<div> </div>
<div>I guess the constructor name: which should be myMP_model not MP_model to be able to compile the program; however, the problem remains the same. I have posted a message to the Osi list.</div>
<div> </div>
<div>thanks Tim.</div>
<div> </div>
<div>regards,</div>
<div>vishy</div>
<div> </div>
<div> </div>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><span class="e" id="q_1128c43f543706a9_2">
<div><span class="gmail_quote">On 5/14/07, <b class="gmail_sendername">Tim Hultberg</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Tim.Hultberg@eumetsat.int" target="_blank">Tim.Hultberg@eumetsat.int
</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Vishy,<br><br>Try using<br><br>class myMP_model {<br>public:<br> MP_model(OsiSolverInterface* s) : Solver(s) {}
<br><br> OsiSolverInterface* operator->() {<br> return Solver;<br> }<br> OsiSolverInterface* Solver;<br>};<br><br>in your code below instead of MP_model. If the OsiCbcSolverInterface<br>behaves differently when called through the generic interface, you
<br>should post it to the OSI list.<br><br>Cheers, Tim<br><br>>>> "Vishy Jeet" <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:vishv.jeet@gmail.com" target="_blank">vishv.jeet@gmail.com
</a>> 05/11/07 9:23 PM >>><br>Hi Tim,<br><br>I am using an MPS file which is located at the following location: <br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://uts.cc.utexas.edu/~jeetv/MIPproblem.mps" target="_blank">
http://uts.cc.utexas.edu/~jeetv/MIPproblem.mps</a> (too big to be posted<br>here...)<br><br>when I am using the following code it returns the message isAbandoned <br>regardless<br>whether branchAndBound() is called or not....but if I use Cbc solver
<br>directly, it returns the primal infeasibility. Could you check if the<br>status<br>functions (called in the code below) written OsiCbcSolverInterface() are <br>working properly..<br><br>regards,<br>vishy<br><br>#include "
flopc.hpp"<br>using namespace flopc;<br>#include "OsiCbcSolverInterface.hpp"<br><br>int main() {<br>MP_model my_knap(new OsiCbcSolverInterface); <br>int num_err = 0;<br>num_err = my_knap->readMps("MIPproblem");
<br>if(num_err != 0)<br>cout << "errors reading MPS file\n";<br><br>my_knap->branchAndBound();<br>// my_knap.minimize(); // doesn't work and throws segmentation fault; <br>wonder why?<br><br>cout << "Num Cols:=" << my_knap->getNumCols()<<endl;
<br>cout << "Num Rows:=" << my_knap->getNumRows()<<endl;<br><br>if( my_knap->isProvenPrimalInfeasible() == true) <br> cout << "primal infeasible\n";<br>else if( my_knap->isProvenDualInfeasible() == true)
<br> cout << "dual infeasible\n";<br>else if( my_knap->isAbandoned() == true)<br> cout << "isAbandoned\n"; <br>else if( my_knap->isProvenOptimal() == true)<br> cout << "isProvenOptimal\n";
<br>else if( my_knap->isDualObjectiveLimitReached() == true)<br> cout << "isDualObjectiveLimitReached\n"; <br>else if( my_knap->isPrimalObjectiveLimitReached() == true)<br> cout << "isPrimalObjectiveLimitReached\n";
<br>else if( my_knap->isIterationLimitReached() == true)<br> cout << "isIterationLimitReached\n"; <br>}<br><br><br><br><br><br>On 5/10/07, Tim Hultberg <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Tim.Hultberg@eumetsat.int" target="_blank">
Tim.Hultberg@eumetsat.int</a>> wrote:<br>><br>> First make sure that the wrong status comes from Cbc by trying<br>> instance->isProvenOptimal()<br>> Then post the question to the Cbc mailing list.<br>>
<br>> You can also try your model with cplex as solver (i.e not via MPS<br>> file)<br>> and Cbc on the MPS file... <br>><br>> Cheers, Tim<br>><br>> >>> "Vishy Jeet" <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:vishv.jeet@gmail.com" target="_blank">
vishv.jeet@gmail.com</a> > 09/05/2007 18:32 >>><br>> Hi Everyone,<br>><br>> I am running the following little program. My class "dir" has a set of <br>> binary variables called "X".
<br>> After minimization getStatus() return "OPTIMAL" while Xs are displayed<br>> as<br>> fractional. When I<br>> solve the mipModel.mps using CPLEX: it tells me the problem is <br>> infeasible! I
<br>> don't understand<br>> why cbc solver is returning false message OPTIMAL. Any help on this is<br>> appreciated.<br>><br>> regards,<br>> vishy<br>><br>><br>> #include " mathModel.h"
<br>><br>> typedef enum {SUCCESS = 0, FAILURE = -1};<br>><br>> int main() {<br>> int retcode = FAILURE;<br>> container c; /* container<br>> class <br>> object that will contains all data*/
<br>> c.readData("c:/dataLocation");<br>> dir instance(c); /* Instantiate an<br>> object<br>> of dir class */<br>> instance.minimize ();<br>> retcode = instance.getStatus
();<br>> if (MP_model::OPTIMAL == retcode){<br>> instance->writeMps("mipModel", "mps", 1.0);<br>> instance.X.display("instance (X)"); <br>> cout<<"obj val:="<<instance->getObjValue()<<endl;
<br>> }<br>> return SUCCESS;<br>> }// main<br>><br><br><br><br>--<br>Best Regards,<br>Vishv Jeet, Ph.D.,<br>Operations Research Scientist, <br>Gravitant Inc.,<br>(The Business Governance Company)<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.gravitant.com/" target="_blank">
http://www.gravitant.com</a><br>Austin, TX, USA.<br>Cell : 1-512-657-8678<br>Home : 1-512-788-5795<br>Work : 1-512-535-7399 <br>_______________________<br>Youngest Music Meastro<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.mayanksahu.net/" target="_blank">
http://www.mayanksahu.net</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br>Vishv Jeet, Ph.D.,<br>Operations Research Scientist, <br>Gravitant Inc.,<br>(The Business Governance Company)<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.gravitant.com/" target="_blank">
http://www.gravitant.com</a><br>Austin, TX, USA.<br>Cell : 1-512-657-8678<br>Home : 1-512-788-5795<br>Work : 1-512-535-7399 <br>_______________________<br>Youngest Music Meastro<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.mayanksahu.net/" target="_blank">
http://www.mayanksahu.net</a> </span></div></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br>Vishv Jeet, Ph.D.,<br>Operations Research Scientist,<br>Gravitant Inc.,<br>(The Business Governance Company)<br>
<a href="http://www.gravitant.com">http://www.gravitant.com</a><br>Austin, TX, USA.<br>Cell : 1-512-657-8678<br>Home : 1-512-788-5795<br>Work : 1-512-535-7399 <br>_______________________<br>Youngest Music Meastro<br><a href="http://www.mayanksahu.net">
http://www.mayanksahu.net</a>