<div>&nbsp;</div>
<div>Thanks Tim, that worked. </div>
<div>&nbsp;</div>
<div>For the benefit of those who are reading this thread in future: you must run the following three commands all over again anytime you make changes in source code:</div>
<div>&nbsp;</div>
<div>&gt;&gt; make<br>&gt;&gt; make test</div>
<div>&gt;&gt; make install</div>
<div>&nbsp;</div>
<div>this would reinstall the affected libraries...<br>&nbsp;</div>
<div>Once again Tim, this was really great help.</div>
<div>&nbsp;</div>
<div>regards,</div>
<div>vishy</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><span class="gmail_quote">On 12/20/06, <b class="gmail_sendername">Tim Hultberg</b> &lt;<a href="mailto:Tim.Hultberg@eumetsat.int">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>a) you probably want to use: such_that(N &lt; N.size()-1)&nbsp;&nbsp;(since N<br>implicitly counts from zero)
<br><br>b) the bad news is that this wont work either with the current version.<br>(it used to though) To correct it go to MP_constraint.cpp<br>and find the lines:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; left-&gt;generate(<br>S1(I1)*S2(I2)*S3(I3)*S4(I4)*S5(I5).such_that(B),v,f,
1.0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right-&gt;generate(<br>S1(I1)*S2(I2)*S3(I3)*S4(I4)*S5(I5).such_that(B),v,f,-1.0);<br>and change them to:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; left-&gt;generate(<br>(S1(I1)*S2(I2)*S3(I3)*S4(I4)*S5(I5)).such_that(B),v,f,1.0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right-&gt;generate(
<br>(S1(I1)*S2(I2)*S3(I3)*S4(I4)*S5(I5)).such_that(B),v,f,-1.0);<br>I will correct it in the next release. Sorry for the inconvenience.<br><br>Let me know if you get any more problems with this.<br><br>Cheesr, Tim<br><br>
<br>Tim Hultberg<br><br>&gt;&gt;&gt; &quot;Vishy Jeet&quot; &lt;<a href="mailto:vishv.jeet@gmail.com">vishv.jeet@gmail.com</a>&gt; 12/19/06 8:53 PM &gt;&gt;&gt;<br>I have written the following small prograg to solve GAP on size (3, 10)
<br><br>&nbsp;&nbsp;&nbsp;&nbsp; 1 // $Id$<br>&nbsp;&nbsp;&nbsp;&nbsp; 2 #include &quot;flopc.hpp&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp; 3 using namespace flopc;<br>&nbsp;&nbsp;&nbsp;&nbsp; 4 #include &quot;OsiCbcSolverInterface.hpp&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp; 5<br>&nbsp;&nbsp;&nbsp;&nbsp; 6 /* Generalized Assignment Problem */<br>&nbsp;&nbsp;&nbsp;&nbsp; 7<br>
&nbsp;&nbsp;&nbsp;&nbsp; 8 class Gap : public MP_model {<br>&nbsp;&nbsp;&nbsp;&nbsp; 9 public:<br>&nbsp;&nbsp;&nbsp;&nbsp;10&nbsp;&nbsp; MP_set M,N;<br>&nbsp;&nbsp;&nbsp;&nbsp;11&nbsp;&nbsp; MP_data c;<br>&nbsp;&nbsp;&nbsp;&nbsp;12&nbsp;&nbsp; MP_data a;<br>&nbsp;&nbsp;&nbsp;&nbsp;13&nbsp;&nbsp; MP_data b;<br>&nbsp;&nbsp;&nbsp;&nbsp;14&nbsp;&nbsp; MP_variable x;<br>&nbsp;&nbsp;&nbsp;&nbsp;15&nbsp;&nbsp; MP_constraint cap, feas;<br>&nbsp;&nbsp;&nbsp;&nbsp;16
<br>&nbsp;&nbsp;&nbsp;&nbsp;17&nbsp;&nbsp; Gap(int numM, int numN) : MP_model(new OsiCbcSolverInterface),<br>&nbsp;&nbsp;&nbsp;&nbsp;18&nbsp;&nbsp; M(numM), N(numN),<br>&nbsp;&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp; c(M,N), a(M,N), b(M),<br>&nbsp;&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp; x(M,N),<br>&nbsp;&nbsp;&nbsp;&nbsp;21&nbsp;&nbsp; cap(M), feas(N)<br>&nbsp;&nbsp;&nbsp;&nbsp;22&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;23&nbsp;&nbsp;&nbsp;&nbsp; x.binary
();<br>&nbsp;&nbsp;&nbsp;&nbsp;24&nbsp;&nbsp;&nbsp;&nbsp; cap(M) = sum(N, a(M,N)*x(M,N)) &lt;= b(M);<br>&nbsp;&nbsp;&nbsp;&nbsp;25&nbsp;&nbsp;&nbsp;&nbsp; feas(N).*such_that(N &lt; N.size())* = sum(M, x(M,N)) == 1;<br>&nbsp;&nbsp;&nbsp;&nbsp;26&nbsp;&nbsp;&nbsp;&nbsp; add(cap); add(feas);<br>&nbsp;&nbsp;&nbsp;&nbsp;27&nbsp;&nbsp;&nbsp;&nbsp; setObjective( sum(M*N, c(M,N)*x(M,N)));
<br>&nbsp;&nbsp;&nbsp;&nbsp;28&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;29 };<br>&nbsp;&nbsp;&nbsp;&nbsp;30<br>&nbsp;&nbsp;&nbsp;&nbsp;31 int main() {<br>&nbsp;&nbsp;&nbsp;&nbsp;32&nbsp;&nbsp;&nbsp;&nbsp; double cost[3][11]&nbsp;&nbsp;= {{47,16,27,21,25,12,55,31,40,40,1000},<br>&nbsp;&nbsp;&nbsp;&nbsp;33&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; {45,18,56,33,36,46,11,17,31,50,1000},<br>&nbsp;&nbsp;&nbsp;&nbsp;34&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; {50,23,22,59,31,35,40,41,40,11,1000}};
<br>&nbsp;&nbsp;&nbsp;&nbsp;35<br>&nbsp;&nbsp;&nbsp;&nbsp;36&nbsp;&nbsp;&nbsp;&nbsp; double req[3][11] = {{24,12,8,12,16,14,13,15,23,5,100},<br>&nbsp;&nbsp;&nbsp;&nbsp;37&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; {7,17,8,5,6,19,20,7,22,9,100},<br>&nbsp;&nbsp;&nbsp;&nbsp;38&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; {23,18,14,8,18,23,19,11,15,11,100}};<br>
&nbsp;&nbsp;&nbsp;&nbsp;39<br>&nbsp;&nbsp;&nbsp;&nbsp;40&nbsp;&nbsp;&nbsp;&nbsp; double capc[3] =&nbsp;&nbsp;{37,32,42};<br>&nbsp;&nbsp;&nbsp;&nbsp;41<br>&nbsp;&nbsp;&nbsp;&nbsp;42&nbsp;&nbsp;&nbsp;&nbsp; Gap instance(3,11);<br>&nbsp;&nbsp;&nbsp;&nbsp;43<br>&nbsp;&nbsp;&nbsp;&nbsp;44&nbsp;&nbsp;&nbsp;&nbsp; instance.c.value(&amp;cost[0][0]);<br>&nbsp;&nbsp;&nbsp;&nbsp;45&nbsp;&nbsp;&nbsp;&nbsp; instance.a.value(&amp;req[0][0]);<br>&nbsp;&nbsp;&nbsp;&nbsp;46&nbsp;&nbsp;&nbsp;&nbsp; instance.b.value
(&amp;capc[0]);<br>&nbsp;&nbsp;&nbsp;&nbsp;47<br>&nbsp;&nbsp;&nbsp;&nbsp;48&nbsp;&nbsp;&nbsp;&nbsp; instance.minimize();<br>&nbsp;&nbsp;&nbsp;&nbsp;49<br>&nbsp;&nbsp;&nbsp;&nbsp;50&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;&quot;numRow:=&quot;&lt;&lt;instance-&gt;getNumRows()&lt;&lt;&quot;\n&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;51&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;&quot;numCols:=&quot;&lt;&lt;instance-&gt;getNumCols()&lt;&lt;&quot;\n&quot;;
<br>&nbsp;&nbsp;&nbsp;&nbsp;52&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;&quot;numEle:=&quot;&lt;&lt;instance-&gt;getNumElements()&lt;&lt;&quot;\n&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;53&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;&quot;obj:=&quot;&lt;&lt;instance-&gt;getObjValue()&lt;&lt;&quot;\n&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;54&nbsp;&nbsp;&nbsp;&nbsp; 
instance.x.display(&quot;Solution of first instance (x)&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;55 }<br><br>To learn how the such_that statement works, I introduced the 11th job<br>with<br>very high cost of assignment and infeasible<br>requirement on any of the machines...to prevent infeasibility I write
<br>the<br>&quot;feas&quot; constraints using such_that statement so<br>that 11th job doesn&#39;t have to be assigned....but I am not able to see<br>whats<br>wrong with the code that it doesn&#39;t work.<br>Any help on this is much appreciated..
<br><br>regards,<br>vishy<br><br></blockquote></div><br><br clear="all"><br>-- <br>--vishy