|0.1.6||Sep 10, 2021|
|0.1.5||Apr 26, 2021|
|0.1.4||Mar 4, 2021|
|0.1.3||Feb 25, 2021|
|0.1.0||May 13, 2020|
#17 in Science
5,942 downloads per month
Used in 2 crates
Rust bindings to the CoinOR CBC MILP Solver using the C API.
Tested on Debian 10, AMD64, coinor-libcbc3 2.9.9+repack1-1.
For more details on installing the
libCbc dependencies, see below.
This crate exposes raw bindings to the C functions.
This crate exposes safe rust bindings using
coin_cbc::raw::Model exposes direct translation of the C function with assert to guaranty safe use.
coin_cbc::Model exposes a more user friendly, rustic and efficient API: it was used successfully to solve MILP with 250,000 binary variables with unnoticeable overhead.
See the examples directory.
The library files of the
Cbc need to present on your system when compiling a project that depends on
On a Debian system with a user with admin rights, this is easily achieved with:
sudo apt install coinor-libcbc-dev
For other systems, without admin rights or if you need a newer version of
Cbc (e.g. with bug fixes), you can install
You will then have to either:
- register the resulting library files with your system, or
cargowith the location of that library. For the first option,
coinbrewprovides a command suggestion after successful compilation. The second option can e.g. be done via:
RUSTFLAGS='-L /path/to/your/cbc/install/lib' cargo test
By default, this crate enforces a global lock which will force multiple
problems to be solved sequentially even if
solve is called from multiple
threads in parallel. This is because by default, libcbc is not thread safe.
If you have compiled your own libcbc with the
you can disable this behavior by disabling the
feature on this crate. Do not disable this feature if you are not certain
that you have a thread safe libcbc, or you will be exposed to memory corruption