Skip to content

Commit

Permalink
Bump version 0.2 and update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
relf committed Jan 9, 2023
1 parent 58ffe44 commit 6caff83
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
authors = ["Remi Lafage <[email protected]>"]
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"]
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

3 changes: 3 additions & 0 deletions cobyla/cobyla.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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:
//!
Expand All @@ -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.
//!
Expand Down

0 comments on commit 6caff83

Please sign in to comment.