-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
# cobyla | ||
# cobyla - a pure Rust implementation | ||
|
||
[![tests](https://github.com/relf/cobyla/workflows/tests/badge.svg)](https://github.com/relf/cobyla/actions?query=workflow%3Atests) | ||
[![crates.io](https://img.shields.io/crates/v/cobyla)](https://crates.io/crates/cobyla) | ||
[![docs](https://docs.rs/cobyla/badge.svg)](https://docs.rs/cobyla) | ||
|
||
COBYLA 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: | ||
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 into two flavours : | ||
* As an [argmin solver](), the Rust code was generated from the C code from [here](https://github.com/emmt/Algorithms/tree/master/cobyla) | ||
* As a function `minimize`, the Rust code was generated from the C code the [NLopt](https://github.com/stevengj/nlopt) project (version 2.7.1) | ||
|
||
In both cases, an initial transpilation was done with [c2rust](https://github.com/immunant/c2rust) then the code was manually edited to make it work. Note that the callback mechanism | ||
is inspired from the excellent Rust binding of NLopt, namely [rust-nlopt](https://github.com/adwhit/rust-nlopt) | ||
|
||
## Example | ||
|
||
```bash | ||
cargo run --example paraboloid | ||
``` | ||
``` | ||
|
||
## Related projects | ||
|
||
* [rust-nlopt](https://github.com/adwhit/rust-nlopt): the Rust binding of the [NLopt project](https://nlopt.readthedocs.io) | ||
* [argmin](https://github.com/argmin-rs/argmin): the pure-Rust optimization framework | ||
* [slsqp](https://github.com/relf/slsqp): As for `cobyla`, a pure Rust implementation of SLSQP transpiled and manually edited from NLopt C code. | ||
|
||
## License | ||
|
||
The project is released under MIT License. |