18 releases (1 stable)
Uses new Rust 2024
| 1.0.0 | Jan 15, 2026 |
|---|---|
| 0.8.0 | Oct 21, 2025 |
| 0.7.0 | Oct 4, 2025 |
| 0.6.0 | Apr 22, 2024 |
| 0.1.2 | Jan 21, 2021 |
#218 in Algorithms
3,241 downloads per month
Used in 7 crates
(3 directly)
350KB
8K
SLoC
cobyla - a pure Rust implementation
COBYLA is an algorithm for minimizing a function of many variables. The method is derivatives-free (only the function values are needed) and take into account constraints on the variables. The algorithm is described in:
M.J.D. Powell, "A direct search optimization method that models the objective and constraint functions by linear interpolation," in Advances in Optimization and Numerical Analysis Mathematics and Its Applications, vol. 275 (eds. Susana Gomez and Jean-Pierre Hennart), Kluwer Academic Publishers, pp. 51-67 (1994).
The algorithm comes as a function minimize: the Rust code was generated from the C code of the NLopt project (version 2.7.1)
- and optionally as an argmin solver, CobylaSolver: the Rust code was generated from the C code from here
An initial transpilation was done with c2rust then the code was manually edited to make it work. The callback mechanismn is inspired from the Rust binding of NLopt, namely rust-nlopt
Example
cargo run --example paraboloid
Related projects
- rust-nlopt: the Rust binding of the NLopt project
- slsqp: a pure Rust implementation of the SLSQP algorithm.
- cobyla-argmin: COBYLA as an argmin solver
License
The project is released under MIT License.