diff --git a/Cargo.toml b/Cargo.toml index a3b0095..3ab0f03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] authors = ["Remi Lafage "] name = "cobyla" -version = "0.1.4" +version = "0.2.0" edition = "2018" license-file = "LICENSE.md" -description = "Rust wrapping of a C implementation of the COBYLA optimizer." +description = "COBYLA optimizer for Rust" readme = "README.md" repository = "https://github.com/relf/cobyla/" keywords = ["optimizer", "optimization", "constrained", "derivative-free"] diff --git a/README.md b/README.md index 161380c..e9cc44b 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,19 @@ [![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) -This a Rust wrapper for COBYLA optimizer (COBYLA stands for Constrained Optimization BY Linear Approximations). - 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: > 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). + +## cobyla 0.2.x + +COBYLA C code has been translated to Rust using [c2rust](https://github.com/immunant/c2rust) then manually edited. + +## cobyla 0.1.x + +Rust wrapper for COBYLA optimizer (COBYLA stands for Constrained Optimization BY Linear Approximations). +COBYLA C code was copied from [here](https://github.com/emmt/Algorithms/tree/master/cobyla) + diff --git a/cobyla/cobyla.c b/cobyla/cobyla.c index ba3bb6a..be0802c 100644 --- a/cobyla/cobyla.c +++ b/cobyla/cobyla.c @@ -18,6 +18,9 @@ * * Copyright (c) 1992, Mike Powell (FORTRAN version). * Copyright (c) 2015, Éric Thiébaut (C version). + * + * Rémi Lafage (2021): copied from https://github.com/emmt/Algorithms/tree/master/cobyla + * cobyla() was renamed raw_cobyla() to avoid name clash with NlOpt implementation */ /* To re-use as much as the code for the reverse communication routines, we use diff --git a/src/lib.rs b/src/lib.rs index 874c428..4fc476e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,5 @@ //! cobyla //! -//! This a Rust wrapper for COBYLA optimizer (COBYLA stands for Constrained Optimization BY Linear Approximations). -//! //! 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: //! @@ -14,7 +12,12 @@ //! //! The algorithm is run using the [`fmin_cobyla`] function. //! -//! Implementation Note: the binding is generated with bindgen is visible as the `raw_cobyla` function using the callback type +//! Implementation Notes: +//! +//! 0.2.x : The C code is now translated in Rust using c2rust transpiler then manually edited to avoid FFI usage +//! to get Rust (unsafe) implementation. +//! +//! 0.1.x : the C code is wrapped with with bindgen is visible as the `raw_cobyla` function using the callback type //! `cobyla_calcfc` which is used to compute the objective function and the constraints. //!