[Cbc] CbcCompareUser.cpp does not compile on trunk branch

Lou Hafer lou at cs.sfu.ca
Sat Oct 9 11:18:13 EDT 2010


Kish,

> I have just downloaded the latest revision of the trunk branch of Cbc, 
> and as usual after building the system, I tried to compile 
> CbcCompareUser and CbcBranchUser in Cbc/examples, but CbcCompareUser 
> fail to compile, because the return type of newSolution method  was 
> changed from void to bool in  CbcCompareBase a few days ago, but 
> newSolution in CbcCompareUser have not been updated to reflect this change.
> 
> I got the code to compile by changing the return type to bool, and added 
> return values (mostly returning true), but I really don't know if these 
> are the correct values to return.

	The change in return type was part of the fix for a long- standing bug
that affected MS Visual Studio. Briefly, the search tree is maintained
as a heap. It was impossible to work with a debug build in VS because
incorrect handling of revisions to the node evaluation function
triggered debug checks in the MS heap implementation. I didn't go
through the examples after making the fix (on my list of things to do
before trunk moves out to stable, but not real high priority right now).

	For anyone affected by this change, the rule of thumb for the return
value of newSolution is that it must be true if newSolution changes the
node evaluation function; in such a case the heap must be rebuilt.  This
is documented in CbcCompareBase.hpp; looks like I need to touch up
CbcCompareDefault.hpp. A return value of true is always safe but may do
extra work.

	Kish, if you get a chance, submit your mods as a patch in a cbc ticket.
It'll keep the problem in our minds and make it a bit easier to fix when
one of the maintainers goes through the examples.

						Thanks,
							Lou



More information about the Cbc mailing list