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 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 microlp, 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 theall_default_solvers
feature in Cargo.toml. - open a pull request
This repository contains a dev container definition. This gives you a working system setup with all solvers installed with a single command. It will also give you the entire Rust toolchain as well as all necessary VS Code extensions.
- Make sure you have Docker installed on your system
- Make sure you have the Dev Containers extension installed in VS Code
- Run the command
Dev Containers: Reopen in Container
in VS Code
Done.