Hi Tim,<br>I tried with (K,I,T_ - MP_index_expression(tij(K,I))) but I got 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:114: error: ‘MP_index_expression’ was not declared in this scope<br>vap2.cpp:179:137: 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>After that, I saw in the MP_index.hpp that there is a method MP_index_exp, and I also tried this, but without success:<br><br>I tried (K,I,T_ - MP_index_exp(tij(K,I))) and:<br><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:107: error: no match for ‘operator-’ in ‘T_ - flopc::MP_index_exp(((const flopc::Constant&)(& flopc::Constant(((const flopc::DataRef&)((const flopc::DataRef*)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:130: 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>Could you please help me?<br><br>Thank you very much!<br><br>Marcos<br><br><br><div class="gmail_quote">2011/7/24 Tim Hultberg <span dir="ltr"><<a href="mailto:Tim.Hultberg@eumetsat.int">Tim.Hultberg@eumetsat.int</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font style="font-size:11.0pt;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">
<b>From</b>: Marcos Roberto Silva [mailto:<a href="mailto:marcos.roberto.silva@uol.com.br" target="_blank">marcos.roberto.silva@uol.com.br</a>]
<br><b>Sent</b>: Saturday, July 23, 2011 06:15 PM<br><b>To</b>: <a href="mailto:flopcpp@list.coin-or.org" target="_blank">flopcpp@list.coin-or.org</a> <<a href="mailto:flopcpp@list.coin-or.org" target="_blank">flopcpp@list.coin-or.org</a>>
<br><b>Subject</b>: [FlopCpp] Constraint index with '-' operation
<br></font> <br></div><div><div></div><div class="h5">
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>
</div></div></blockquote></div><br>