[FlopCpp] Question on indexing constraints
Michal Kaut
mail at michalkaut.net
Mon Jun 11 04:11:36 EDT 2007
Hello,
sorry for the flood of emails, but I believe that it is better to keep
different questions in separate emails.
I have been struggling to understand the indexing of FlopC++ constraints
and must admit I still do not understand it properly. What confuses me
most is that for each type of constraints I wanted to test, I was able
to find several "seemingly equivalent" formulations, all of which
compile, but only one of which gives the expected results.
I have tried to demonstrate it on the attached example, where the
constraints with a name differing only in number are supposed to do the
same thing, but only those that have "WORKS" in the comment actually
generate the expected result. (I should probably confess that I am an
AMPL user, so I have probably different understanding what an "index"
means, compared to the GAMS-influenced designers of FlopC++.)
- Could someone try to explain to me why the bad formulations do not
work, i.e. what they actually do? (They do something, as they compile.)
- Note that the example is only to illustrate indexing, the resulting
model is not supposed to make any sense.
In addition, I was rather disappointed by the compilation speed (i.e.
the lack of it): this very small example takes over a minute to compile
on mu 3GHz Pentium 4 machine with gcc 3.4.5 (mingw on WinXP).
Of this time, 39 seconds are spend on the last three sets of constraints
(getIndx1-3), i.e. the compile+link time is 26 seconds without those
constraints. Is this normal/expected behaviour?
(Another interesting thing is that adding each of the three sets of
constraints individually adds 5s, 10s and 10s respectively, i.e. 25
seconds in total, while adding all three adds 39 seconds to the
compilation time...)
And one more question: is it possible to get rid of the "eval subsetref"
messages? Even with this small example, I get hundreds of them and
setting model.silent() does not switch them off...
Thanks a lot in advance.
Regards,
Michal Kaut
More information about the FlopCpp
mailing list