[Cbc] revamping the Cbc C interface

Miles Lubin miles.lubin at gmail.com
Thu Mar 13 14:20:18 EDT 2014


Hi Haroldo, all,

I've done some preliminary work on this, removing over 1000 lines of crufty
code including multiple synonyms and unimplemented stubs. There is also an
interface to set parameters which translate directly to cbc command-line
arguments. I think this is a lightweight way to deal with parameters,
instead of trying to mirror all of cbc's parameters in explicit functions.
For example, to disable logging, you write:

Cbc_setParameter(model, "log", "0");

To disable cuts:

Cbc_setParameter(model, "cuts", "off");

Etc.

This is committed to trunk. For some example code, see
https://projects.coin-or.org/Cbc/browser/trunk/Cbc/test/CInterfaceTest.c.
There's still more work to be done (I haven't looked at callbacks yet), but
beta-testers and feedback are welcome.

Miles




On Mon, Mar 10, 2014 at 8:21 PM, Haroldo Santos <haroldo.santos at gmail.com>wrote:

> Hi Miles,
>
> This would great.  CbcMain0 and CbcMain1 are where the best settings are
> kept and you really should use these.
>
> It would nice also to add a clean interface  to configure cuts, heuristics
> and pre-preprocessing in CBC (at least the most important options) (this
> would be translated to CbcMain1 parameters).
>
> This would probably be a better way to call CBC from C++ too, since
> CbcMain0 and CbcMain1 are a functional but ugly way of calling the solver
> IMHO.
>
> Using opaque data types in C would also be nice to keep a low level of
> required includes.
>
> Cheers,
>
> Haroldo
>
>
>
>
>
>
>
> On Mon, Mar 10, 2014 at 7:52 PM, Miles Lubin <miles.lubin at gmail.com>wrote:
>
>> Hi all,
>>
>> I'm planning on doing some significant restructuring on the Cbc C
>> interface (
>> https://projects.coin-or.org/Cbc/browser/trunk/Cbc/src/Cbc_C_Interface.h),
>> which doesn't seem to have received much attention in the past number of
>> years. Before making any breaking changes, I wanted to share my plans and
>> get feedback from potential users (and current users, if any).
>>
>> The main redesign points are:
>> - Use CbcMain0/CbcMain1
>> - Drop LP-specific functionality (dual solutions, rays, etc.) -- Most of
>> this was never even implemented, while Clp already has a fully functional C
>> interface.
>> - Break 1-1 correspondence with C++ names, if appropriate. Some tweaking
>> of the names could help for non-expert users. The C interface should be
>> accessible to someone who isn't necessarily familiar with the C++ interface.
>> - Include unit tests.
>>
>> Overall the goal is to have a lightweight, well documented interface that
>> makes Cbc easy to access from outside of C++, including from dynamic
>> languages like Python and Julia, following CoinMP's lead but included
>> directly in Cbc.
>>
>> Thanks,
>> Miles
>>
>> _______________________________________________
>> Cbc mailing list
>> Cbc at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/cbc
>>
>>
>
>
> --
> =============================================================
> Haroldo Gambini Santos
> Computing Department
> Universidade Federal de Ouro Preto - UFOP
> email: haroldo [at ] iceb.ufop.br
> home/research page: www.decom.ufop.br/haroldo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20140313/75684369/attachment.html>


More information about the Cbc mailing list