Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1.43 KB

CONTRIBUTING.md

File metadata and controls

21 lines (16 loc) · 1.43 KB

General guidelines

Contribution happens through github.

Please format your code with cargo fmt, and if you add a new feature, update the README, the doc comments, and the doc tests accordingly.

Adding a new solver

Adding a new solver should not take more than a few hundred lines of code, tests included.

  • add the solver as an optional dependency in Cargo.toml
  • add a file named after your solver in the solvers folder
    • you can copy minilp, our smallest solver interface, as a starting point.
    • create a struct to store linear problems in a way that will make it cheap to dynamically add new constraints to the problem, and easy to pass the problem to the solver once it has been fully constructed. This generally means constructing vectors to which you can push values for each new constraint. You can generally reuse data structures provided by the library for which you are creating a wrapper.
    • implement a function named after your solver that takes an UnsolvedProblem and returns the struct you defined above.
    • implement the SolverModel trait for your new problem type.
    • add your solver to lib.rs and to the all_default_solvers feature in Cargo.toml.
    • open a pull request