Skip to content

Commit

Permalink
Merge branch 'fix-sol-segfault' of github.com:scipopt/russcip into fi…
Browse files Browse the repository at this point in the history
…x-sol-segfault
  • Loading branch information
mmghannam committed Apr 7, 2024
2 parents b9a15a2 + 9a96cc2 commit 58fc879
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ Steps:
1. Add a method to the `ScipPtr` struct, this should in most cases return a `Result<YOU_RETURN_TYPE, Retcode>` from calling the `scip_call!` macro. Use the unsafe bindings from the `ffi` module to call SCIP methods.
2. The Model<T> struct has many [states](https://docs.rs/russcip/latest/russcip/model/index.html), choose the state that is safe to call your `ScipPtr` method in.


## Wrapping a SCIP plugin

1. SCIP plugins are essentially interfaces. So first step would be to check the plugin's (fundamental) callbacks from SCIP's documentation and write an interface that represents it. Here's the [one](https://www.scipopt.org/doc/html/CONS.php) for the constraint handler plugin for example.
2. SCIP saves PLUGIN_DATA for each plugin type. This is what _russcip_ uses to wrap the struct that implements the interface. You'd need to add an `include_{PLUGIN_NAME}` method on `Model<ProblemCreated>` that takes a box of this interface and defines the C callbacks. As a reference you can take a look at the pricer plugin [implementation](https://github.com/scipopt/russcip/blob/main/src/pricer.rs) and it's include [method](https://github.com/scipopt/russcip/blob/e13d20d3e8594d3262f312304f4f2400de48da39/src/scip.rs#L703).


## Code Quality

- Add documentation for any new methods/struct.
Expand Down

0 comments on commit 58fc879

Please sign in to comment.