[Cgl-tickets] Re: [COIN-OR Cut Generator Library] #11: trunk
CglValidator::fillRejectionReasons dumps core,
Solaris / Studio / optimised build
COIN-OR Cut Generator Library
coin-trac at coin-or.org
Wed Jun 27 22:43:46 EDT 2007
#11: trunk CglValidator::fillRejectionReasons dumps core, Solaris / Studio /
optimised build
-----------------------+----------------------------------------------------
Reporter: lou | Owner: pbonami
Type: defect | Status: assigned
Priority: major | Milestone:
Component: CglLandP | Version: trunk
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Comment (by lou):
It's back ... Sven de Vries stumbled over it this time.
I spent a bit more time poking around, and I'm 99.9% sure this is a CC
optimisation bug. The existing code, compiled without optimisation, shows
rejection_.size() = 6 on first entry to fillRejectionReasons. The exact
same code with an optimised build shows rejections_.size() = 0. The
following code works on Solaris with Studio CC 5.8, debug and optimised,
and on SuSE, GCC 4.4.1, debug and optimised. It has the advantage that
rejections_ is only filled once.
Change the declaration of rejection_ to
{{{
std::vector<std::string> CglValidator::rejections_ ;
}}}
Forget about trying to reserve space in the declaration.
Change fillRejectionReasons to
{{{
void
CglValidator::fillRejectionReasons()
{
if (rejections_.size() == 0) {
rejections_.resize(DummyEnd) ;
rejections_[NoneAccepted] = "Cut was accepted.";
rejections_[SmallViolation] = "Violation of the cut is too small.";
rejections_[SmallCoefficient] =
"There is a small coefficient we can not get rid of.";
rejections_[BigDynamic] = "Dynamic of coefficient is too important.";
rejections_[DenseCut] = "Cut is too dense.";
rejections_[EmptyCut] = "Cleaned cut is empty.";
}
}
}}}
--
Ticket URL: <https://projects.coin-or.org/Cgl/ticket/11#comment:4>
COIN-OR Cut Generator Library <http://projects.coin-or.org/Cgl>
A library of mixed-integer programming cutting plane generators.
More information about the Cgl-tickets
mailing list