<font style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">
. <br> <br>Try (K,I,T_-MP_index_expression(tij(K,I)).   <br><br>You could also make this a 3 dimensianal &quot;subset&quot;,  I think.<br><br>Tim<br> <br>.</font><br>&nbsp;<br>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<font style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">
<b>From</b>: Marcos Roberto Silva [mailto:marcos.roberto.silva@uol.com.br] <br><b>Sent</b>: Saturday, July 23, 2011 06:15 PM<br><b>To</b>: flopcpp@list.coin-or.org &lt;flopcpp@list.coin-or.org&gt; <br><b>Subject</b>: [FlopCpp] Constraint index with '-' operation <br></font>&nbsp;<br></div>
Hi all.<br>I&#39;m trying to write a constraint like this:<br><br>balanco2(I,T_) = sum(J, (X(I,J,T_) + Y(I,J,T_))) - Y(I,I,T_-1) - sum(K, (X(K,I,(T_-tij(K,I))) + Y(K,I, (T_-tij(K,I)) )) ) == mit(I,T_);<br><br>but when I try to compile the source code I get the following error:<br>
<br>marcos@marcos-Infoway:~/Documentos/FlopC++-1.0.6/FlopCpp/examples$ make vap2<br>g++ -g -I../../include/coin vap2.cpp -L../../lib -Wl,-rpath,../../lib -lFlopCpp -lOsiCbc -lCbc -lOsiClp -lClp -lCgl -lOsi -lCoinUtils -o vap2<br>
vap2.cpp: In function ‘int main(int, char**)’:<br>vap2.cpp:179:92: error: no match for ‘operator-’ in ‘T_ - tij.flopc::MP_data::operator()(((const flopc::MP_index_exp&amp;)(&amp; flopc::MP_index_exp(((flopc::MP_index&amp;)(&amp; K.flopc::MP_set::&lt;anonymous&gt;.flopc::MP_set_base::&lt;anonymous&gt;))))), ((const flopc::MP_index_exp&amp;)(&amp; flopc::MP_index_exp(((flopc::MP_index&amp;)(&amp; I.flopc::MP_set::&lt;anonymous&gt;.flopc::MP_set_base::&lt;anonymous&gt;))))), ((const flopc::MP_index_exp&amp;)((const flopc::MP_index_exp*)flopc::MP_index_exp::getEmpty())), ((const flopc::MP_index_exp&amp;)((const flopc::MP_index_exp*)flopc::MP_index_exp::getEmpty())), ((const flopc::MP_index_exp&amp;)((const flopc::MP_index_exp*)flopc::MP_index_exp::getEmpty())))’<br>
../../include/coin/MP_constant.hpp:60:12: note: candidates are: flopc::Constant flopc::operator-(const flopc::Constant&amp;)<br>../../include/coin/MP_constant.hpp:130:12: note:                 flopc::Constant flopc::operator-(const flopc::Constant&amp;, const flopc::Constant&amp;)<br>
../../include/coin/MP_index.hpp:107:12: note:                 flopc::Constant flopc::operator-(flopc::MP_index&amp;, flopc::MP_index&amp;)<br>../../include/coin/MP_index.hpp:217:25: note:                 flopc::MP_index_exp flopc::operator-(flopc::MP_index&amp;, const int&amp;)<br>
../../include/coin/MP_expression.hpp:177:17: note:                 flopc::MP_expression flopc::operator-(const flopc::MP_expression&amp;, const flopc::MP_expression&amp;)<br>../../include/coin/MP_expression.hpp:179:17: note:                 flopc::MP_expression flopc::operator-(const flopc::MP_expression&amp;, const flopc::Constant&amp;)<br>
../../include/coin/MP_expression.hpp:181:17: note:                 flopc::MP_expression flopc::operator-(const flopc::Constant&amp;, const flopc::MP_expression&amp;)<br>/usr/include/c++/4.5/bits/stl_bvector.h:179:3: note:                 ptrdiff_t std::operator-(const std::_Bit_iterator_base&amp;, const std::_Bit_iterator_base&amp;)<br>
../../include/coin/CoinPackedVector.hpp:602:1: note:                 CoinPackedVector operator-(double, const CoinPackedVectorBase&amp;)<br>../../include/coin/CoinPackedVector.hpp:564:1: note:                 CoinPackedVector operator-(const CoinPackedVectorBase&amp;, double)<br>
../../include/coin/CoinPackedVector.hpp:462:25: note:                 CoinPackedVector operator-(const CoinPackedVectorBase&amp;, const CoinPackedVectorBase&amp;)<br>vap2.cpp:179:116: error: no match for ‘operator-’ in ‘T_ - tij.flopc::MP_data::operator()(((const flopc::MP_index_exp&amp;)(&amp; flopc::MP_index_exp(((flopc::MP_index&amp;)(&amp; K.flopc::MP_set::&lt;anonymous&gt;.flopc::MP_set_base::&lt;anonymous&gt;))))), ((const flopc::MP_index_exp&amp;)(&amp; flopc::MP_index_exp(((flopc::MP_index&amp;)(&amp; I.flopc::MP_set::&lt;anonymous&gt;.flopc::MP_set_base::&lt;anonymous&gt;))))), ((const flopc::MP_index_exp&amp;)((const flopc::MP_index_exp*)flopc::MP_index_exp::getEmpty())), ((const flopc::MP_index_exp&amp;)((const flopc::MP_index_exp*)flopc::MP_index_exp::getEmpty())), ((const flopc::MP_index_exp&amp;)((const flopc::MP_index_exp*)flopc::MP_index_exp::getEmpty())))’<br>
../../include/coin/MP_constant.hpp:60:12: note: candidates are: flopc::Constant flopc::operator-(const flopc::Constant&amp;)<br>../../include/coin/MP_constant.hpp:130:12: note:                 flopc::Constant flopc::operator-(const flopc::Constant&amp;, const flopc::Constant&amp;)<br>
../../include/coin/MP_index.hpp:107:12: note:                 flopc::Constant flopc::operator-(flopc::MP_index&amp;, flopc::MP_index&amp;)<br>../../include/coin/MP_index.hpp:217:25: note:                 flopc::MP_index_exp flopc::operator-(flopc::MP_index&amp;, const int&amp;)<br>
../../include/coin/MP_expression.hpp:177:17: note:                 flopc::MP_expression flopc::operator-(const flopc::MP_expression&amp;, const flopc::MP_expression&amp;)<br>../../include/coin/MP_expression.hpp:179:17: note:                 flopc::MP_expression flopc::operator-(const flopc::MP_expression&amp;, const flopc::Constant&amp;)<br>
../../include/coin/MP_expression.hpp:181:17: note:                 flopc::MP_expression flopc::operator-(const flopc::Constant&amp;, const flopc::MP_expression&amp;)<br>/usr/include/c++/4.5/bits/stl_bvector.h:179:3: note:                 ptrdiff_t std::operator-(const std::_Bit_iterator_base&amp;, const std::_Bit_iterator_base&amp;)<br>
../../include/coin/CoinPackedVector.hpp:602:1: note:                 CoinPackedVector operator-(double, const CoinPackedVectorBase&amp;)<br>../../include/coin/CoinPackedVector.hpp:564:1: note:                 CoinPackedVector operator-(const CoinPackedVectorBase&amp;, double)<br>
../../include/coin/CoinPackedVector.hpp:462:25: note:                 CoinPackedVector operator-(const CoinPackedVectorBase&amp;, const CoinPackedVectorBase&amp;)<br>make: ** [vap2] Erro 1<br>marcos@marcos-Infoway:~/Documentos/FlopC++-1.0.6/FlopCpp/examples$ <br>
<br><br>When I remove the term:<br><br>... - sum(K, (X(K,I,(T_-tij(K,I))) + Y(K,I, (T_-tij(K,I)) )) )<br><br>I can compile without problems. It seems that the problem is when I try to do T_-tij(K,I).<br><br>Do you have any idea of how can I write this constraint?<br>
<br>Thank you very much.<br><br>Marcos Roberto Silva<br><br>