Skip to content

Commit

Permalink
Update CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mmghannam authored Apr 1, 2024
1 parent e13d20d commit b44bc33
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 b44bc33

Please sign in to comment.