<font style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
.
<br>
<br>Try (K,I,T_-MP_index_expression(tij(K,I)). <br><br>You could also make this a 3 dimensianal "subset", I think.<br><br>Tim<br>
<br>.</font><br> <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:"Tahoma","sans-serif"">
<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 <flopcpp@list.coin-or.org>
<br><b>Subject</b>: [FlopCpp] Constraint index with '-' operation
<br></font> <br></div>
Hi all.<br>I'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&)(& flopc::MP_index_exp(((flopc::MP_index&)(& K.flopc::MP_set::<anonymous>.flopc::MP_set_base::<anonymous>))))), ((const flopc::MP_index_exp&)(& flopc::MP_index_exp(((flopc::MP_index&)(& I.flopc::MP_set::<anonymous>.flopc::MP_set_base::<anonymous>))))), ((const flopc::MP_index_exp&)((const flopc::MP_index_exp*)flopc::MP_index_exp::getEmpty())), ((const flopc::MP_index_exp&)((const flopc::MP_index_exp*)flopc::MP_index_exp::getEmpty())), ((const flopc::MP_index_exp&)((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&)<br>../../include/coin/MP_constant.hpp:130:12: note: flopc::Constant flopc::operator-(const flopc::Constant&, const flopc::Constant&)<br>
../../include/coin/MP_index.hpp:107:12: note: flopc::Constant flopc::operator-(flopc::MP_index&, flopc::MP_index&)<br>../../include/coin/MP_index.hpp:217:25: note: flopc::MP_index_exp flopc::operator-(flopc::MP_index&, const int&)<br>
../../include/coin/MP_expression.hpp:177:17: note: flopc::MP_expression flopc::operator-(const flopc::MP_expression&, const flopc::MP_expression&)<br>../../include/coin/MP_expression.hpp:179:17: note: flopc::MP_expression flopc::operator-(const flopc::MP_expression&, const flopc::Constant&)<br>
../../include/coin/MP_expression.hpp:181:17: note: flopc::MP_expression flopc::operator-(const flopc::Constant&, const flopc::MP_expression&)<br>/usr/include/c++/4.5/bits/stl_bvector.h:179:3: note: ptrdiff_t std::operator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&)<br>
../../include/coin/CoinPackedVector.hpp:602:1: note: CoinPackedVector operator-(double, const CoinPackedVectorBase&)<br>../../include/coin/CoinPackedVector.hpp:564:1: note: CoinPackedVector operator-(const CoinPackedVectorBase&, double)<br>
../../include/coin/CoinPackedVector.hpp:462:25: note: CoinPackedVector operator-(const CoinPackedVectorBase&, const CoinPackedVectorBase&)<br>vap2.cpp:179:116: error: no match for ‘operator-’ in ‘T_ - tij.flopc::MP_data::operator()(((const flopc::MP_index_exp&)(& flopc::MP_index_exp(((flopc::MP_index&)(& K.flopc::MP_set::<anonymous>.flopc::MP_set_base::<anonymous>))))), ((const flopc::MP_index_exp&)(& flopc::MP_index_exp(((flopc::MP_index&)(& I.flopc::MP_set::<anonymous>.flopc::MP_set_base::<anonymous>))))), ((const flopc::MP_index_exp&)((const flopc::MP_index_exp*)flopc::MP_index_exp::getEmpty())), ((const flopc::MP_index_exp&)((const flopc::MP_index_exp*)flopc::MP_index_exp::getEmpty())), ((const flopc::MP_index_exp&)((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&)<br>../../include/coin/MP_constant.hpp:130:12: note: flopc::Constant flopc::operator-(const flopc::Constant&, const flopc::Constant&)<br>
../../include/coin/MP_index.hpp:107:12: note: flopc::Constant flopc::operator-(flopc::MP_index&, flopc::MP_index&)<br>../../include/coin/MP_index.hpp:217:25: note: flopc::MP_index_exp flopc::operator-(flopc::MP_index&, const int&)<br>
../../include/coin/MP_expression.hpp:177:17: note: flopc::MP_expression flopc::operator-(const flopc::MP_expression&, const flopc::MP_expression&)<br>../../include/coin/MP_expression.hpp:179:17: note: flopc::MP_expression flopc::operator-(const flopc::MP_expression&, const flopc::Constant&)<br>
../../include/coin/MP_expression.hpp:181:17: note: flopc::MP_expression flopc::operator-(const flopc::Constant&, const flopc::MP_expression&)<br>/usr/include/c++/4.5/bits/stl_bvector.h:179:3: note: ptrdiff_t std::operator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&)<br>
../../include/coin/CoinPackedVector.hpp:602:1: note: CoinPackedVector operator-(double, const CoinPackedVectorBase&)<br>../../include/coin/CoinPackedVector.hpp:564:1: note: CoinPackedVector operator-(const CoinPackedVectorBase&, double)<br>
../../include/coin/CoinPackedVector.hpp:462:25: note: CoinPackedVector operator-(const CoinPackedVectorBase&, const CoinPackedVectorBase&)<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>