<div>&nbsp;</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>&nbsp;</div>
<div>thanks Tim.</div>
<div>&nbsp;</div>
<div>regards,</div>
<div>vishy</div>
<div>&nbsp;</div>
<div>&nbsp;</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> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Tim.Hultberg@eumetsat.int" target="_blank">Tim.Hultberg@eumetsat.int
</a>&gt; 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>&nbsp;&nbsp; MP_model(OsiSolverInterface* s) : Solver(s) {} 
<br><br>&nbsp;&nbsp; OsiSolverInterface* operator-&gt;() {<br>&nbsp;&nbsp;&nbsp;&nbsp; return Solver;<br>&nbsp;&nbsp; }<br>&nbsp;&nbsp; OsiSolverInterface* Solver;<br>};<br><br>in your code below instead of MP_model.&nbsp;&nbsp;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>&gt;&gt;&gt; &quot;Vishy Jeet&quot; &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:vishv.jeet@gmail.com" target="_blank">vishv.jeet@gmail.com
</a>&gt; 05/11/07 9:23 PM &gt;&gt;&gt;<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 &quot;
flopc.hpp&quot;<br>using namespace flopc;<br>#include &quot;OsiCbcSolverInterface.hpp&quot;<br><br>int main() {<br>MP_model my_knap(new OsiCbcSolverInterface); <br>int num_err = 0;<br>num_err = my_knap-&gt;readMps(&quot;MIPproblem&quot;);
<br>if(num_err != 0)<br>cout &lt;&lt; &quot;errors reading MPS file\n&quot;;<br><br>my_knap-&gt;branchAndBound();<br>//&nbsp;&nbsp;my_knap.minimize(); // doesn&#39;t work and throws segmentation fault; <br>wonder why?<br><br>cout &lt;&lt; &quot;Num Cols:=&quot; &lt;&lt;&nbsp;&nbsp; my_knap-&gt;getNumCols()&lt;&lt;endl;
<br>cout &lt;&lt; &quot;Num Rows:=&quot; &lt;&lt;&nbsp;&nbsp; my_knap-&gt;getNumRows()&lt;&lt;endl;<br><br>if( my_knap-&gt;isProvenPrimalInfeasible() == true) <br>&nbsp;&nbsp; cout &lt;&lt; &quot;primal infeasible\n&quot;;<br>else if( my_knap-&gt;isProvenDualInfeasible() == true)
<br>&nbsp;&nbsp; cout &lt;&lt; &quot;dual infeasible\n&quot;;<br>else if( my_knap-&gt;isAbandoned() == true)<br>&nbsp;&nbsp; cout &lt;&lt; &quot;isAbandoned\n&quot;; <br>else if( my_knap-&gt;isProvenOptimal() == true)<br>&nbsp;&nbsp; cout &lt;&lt; &quot;isProvenOptimal\n&quot;;
<br>else if( my_knap-&gt;isDualObjectiveLimitReached() == true)<br>&nbsp;&nbsp; cout &lt;&lt; &quot;isDualObjectiveLimitReached\n&quot;; <br>else if( my_knap-&gt;isPrimalObjectiveLimitReached() == true)<br>&nbsp;&nbsp; cout &lt;&lt; &quot;isPrimalObjectiveLimitReached\n&quot;;
<br>else if( my_knap-&gt;isIterationLimitReached() == true)<br>&nbsp;&nbsp; cout &lt;&lt; &quot;isIterationLimitReached\n&quot;; <br>}<br><br><br><br><br><br>On 5/10/07, Tim Hultberg &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Tim.Hultberg@eumetsat.int" target="_blank">
Tim.Hultberg@eumetsat.int</a>&gt; wrote:<br>&gt;<br>&gt; First make sure that the wrong status comes from Cbc by trying<br>&gt; instance-&gt;isProvenOptimal()<br>&gt; Then post the question to the Cbc mailing list.<br>&gt;
<br>&gt; You can also try your model with cplex as solver (i.e not via MPS<br>&gt; file)<br>&gt; and Cbc on the MPS file... <br>&gt;<br>&gt; Cheers, Tim<br>&gt;<br>&gt; &gt;&gt;&gt; &quot;Vishy Jeet&quot; &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:vishv.jeet@gmail.com" target="_blank">
vishv.jeet@gmail.com</a> &gt; 09/05/2007 18:32 &gt;&gt;&gt;<br>&gt; Hi Everyone,<br>&gt;<br>&gt; I am running the following little program. My class &quot;dir&quot; has a set of <br>&gt; binary variables called &quot;X&quot;.
<br>&gt; After minimization getStatus() return &quot;OPTIMAL&quot; while Xs are displayed<br>&gt; as<br>&gt; fractional. When I<br>&gt; solve the mipModel.mps using CPLEX: it tells me the problem is <br>&gt; infeasible! I
<br>&gt; don&#39;t understand<br>&gt; why cbc solver is returning false message OPTIMAL. Any help on this is<br>&gt; appreciated.<br>&gt;<br>&gt; regards,<br>&gt; vishy<br>&gt;<br>&gt;<br>&gt; #include &quot; mathModel.h&quot;
<br>&gt;<br>&gt; typedef enum {SUCCESS = 0, FAILURE = -1};<br>&gt;<br>&gt; int main() {<br>&gt; int retcode = FAILURE;<br>&gt; container c;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* container<br>&gt; class <br>&gt; object that will contains all data*/
<br>&gt; c.readData(&quot;c:/dataLocation&quot;);<br>&gt; dir instance(c);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* Instantiate an<br>&gt; object<br>&gt; of dir class */<br>&gt; instance.minimize ();<br>&gt; retcode = instance.getStatus
();<br>&gt; if (MP_model::OPTIMAL == retcode){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;instance-&gt;writeMps(&quot;mipModel&quot;, &quot;mps&quot;, 1.0);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;instance.X.display(&quot;instance (X)&quot;); <br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&quot;obj val:=&quot;&lt;&lt;instance-&gt;getObjValue()&lt;&lt;endl;
<br>&gt; }<br>&gt; return SUCCESS;<br>&gt; }// main<br>&gt;<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&nbsp;&nbsp;&nbsp;&nbsp;: 1-512-657-8678<br>Home : 1-512-788-5795<br>Work&nbsp;&nbsp;: 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&nbsp;&nbsp;&nbsp;&nbsp;: 1-512-657-8678<br>Home : 1-512-788-5795<br>Work&nbsp;&nbsp;: 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&nbsp;&nbsp;&nbsp;&nbsp;: 1-512-657-8678<br>Home : 1-512-788-5795<br>Work&nbsp;&nbsp;: 1-512-535-7399 <br>_______________________<br>Youngest Music Meastro<br><a href="http://www.mayanksahu.net">
http://www.mayanksahu.net</a>