scipopt / russcip

Rust interface for SCIP
https://crates.io/crates/russcip
Apache License 2.0
30 stars 10 forks source link

add support for cardinality constraints #106

Closed yonch closed 9 months ago

yonch commented 10 months ago

This adds support for SCIP cardinality constraints, which constrain solutions to have at most N non-zeros out of a set of variables (see https://www.scipopt.org/doc/html/cons__cardinality_8h.php).

This follows the others addcons* implementations in the crate, and adds a (passing) test.

scip-sys already has the relevant functions wrapped, so this is ready to be merged.

A follow up pull request to good_lp relies on this PR, so if possible, maintainers should consider making a named release, for good_lp to depend on.

codecov[bot] commented 10 months ago

Codecov Report

Merging #106 (3d93a06) into main (667ad6c) will increase coverage by 0.20%. The diff coverage is 84.21%.

@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
+ Coverage   75.01%   75.22%   +0.20%     
==========================================
  Files          13       13              
  Lines        1669     1707      +38     
==========================================
+ Hits         1252     1284      +32     
- Misses        417      423       +6     
Files Changed Coverage Δ
src/scip.rs 84.62% <66.67%> (-0.63%) :arrow_down:
src/model.rs 92.64% <100.00%> (+0.37%) :arrow_up: