[FlopCpp] Constraint index with '-' operation
Tim Hultberg
Tim.Hultberg at eumetsat.int
Sun Jul 24 09:10:25 EDT 2011
.
Try (K,I,T_-MP_index_expression(tij(K,I)).
You could also make this a 3 dimensianal "subset", I think.
Tim
.
From: Marcos Roberto Silva [mailto:marcos.roberto.silva at uol.com.br]
Sent: Saturday, July 23, 2011 06:15 PM
To: flopcpp at list.coin-or.org <flopcpp at list.coin-or.org>
Subject: [FlopCpp] Constraint index with '-' operation
Hi all.
I'm trying to write a constraint like this:
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_);
but when I try to compile the source code I get the following error:
marcos at marcos-Infoway:~/Documentos/FlopC++-1.0.6/FlopCpp/examples$ make vap2
g++ -g -I../../include/coin vap2.cpp -L../../lib -Wl,-rpath,../../lib -lFlopCpp -lOsiCbc -lCbc -lOsiClp -lClp -lCgl -lOsi -lCoinUtils -o vap2
vap2.cpp: In function ‘int main(int, char**)’:
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())))’
../../include/coin/MP_constant.hpp:60:12: note: candidates are: flopc::Constant flopc::operator-(const flopc::Constant&)
../../include/coin/MP_constant.hpp:130:12: note: flopc::Constant flopc::operator-(const flopc::Constant&, const flopc::Constant&)
../../include/coin/MP_index.hpp:107:12: note: flopc::Constant flopc::operator-(flopc::MP_index&, flopc::MP_index&)
../../include/coin/MP_index.hpp:217:25: note: flopc::MP_index_exp flopc::operator-(flopc::MP_index&, const int&)
../../include/coin/MP_expression.hpp:177:17: note: flopc::MP_expression flopc::operator-(const flopc::MP_expression&, const flopc::MP_expression&)
../../include/coin/MP_expression.hpp:179:17: note: flopc::MP_expression flopc::operator-(const flopc::MP_expression&, const flopc::Constant&)
../../include/coin/MP_expression.hpp:181:17: note: flopc::MP_expression flopc::operator-(const flopc::Constant&, const flopc::MP_expression&)
/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&)
../../include/coin/CoinPackedVector.hpp:602:1: note: CoinPackedVector operator-(double, const CoinPackedVectorBase&)
../../include/coin/CoinPackedVector.hpp:564:1: note: CoinPackedVector operator-(const CoinPackedVectorBase&, double)
../../include/coin/CoinPackedVector.hpp:462:25: note: CoinPackedVector operator-(const CoinPackedVectorBase&, const CoinPackedVectorBase&)
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())))’
../../include/coin/MP_constant.hpp:60:12: note: candidates are: flopc::Constant flopc::operator-(const flopc::Constant&)
../../include/coin/MP_constant.hpp:130:12: note: flopc::Constant flopc::operator-(const flopc::Constant&, const flopc::Constant&)
../../include/coin/MP_index.hpp:107:12: note: flopc::Constant flopc::operator-(flopc::MP_index&, flopc::MP_index&)
../../include/coin/MP_index.hpp:217:25: note: flopc::MP_index_exp flopc::operator-(flopc::MP_index&, const int&)
../../include/coin/MP_expression.hpp:177:17: note: flopc::MP_expression flopc::operator-(const flopc::MP_expression&, const flopc::MP_expression&)
../../include/coin/MP_expression.hpp:179:17: note: flopc::MP_expression flopc::operator-(const flopc::MP_expression&, const flopc::Constant&)
../../include/coin/MP_expression.hpp:181:17: note: flopc::MP_expression flopc::operator-(const flopc::Constant&, const flopc::MP_expression&)
/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&)
../../include/coin/CoinPackedVector.hpp:602:1: note: CoinPackedVector operator-(double, const CoinPackedVectorBase&)
../../include/coin/CoinPackedVector.hpp:564:1: note: CoinPackedVector operator-(const CoinPackedVectorBase&, double)
../../include/coin/CoinPackedVector.hpp:462:25: note: CoinPackedVector operator-(const CoinPackedVectorBase&, const CoinPackedVectorBase&)
make: ** [vap2] Erro 1
marcos at marcos-Infoway:~/Documentos/FlopC++-1.0.6/FlopCpp/examples$
When I remove the term:
... - sum(K, (X(K,I,(T_-tij(K,I))) + Y(K,I, (T_-tij(K,I)) )) )
I can compile without problems. It seems that the problem is when I try to do T_-tij(K,I).
Do you have any idea of how can I write this constraint?
Thank you very much.
Marcos Roberto Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/flopcpp/attachments/20110724/153db553/attachment-0001.html
More information about the FlopCpp
mailing list