-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding minimization with derivatives to multimin
- Loading branch information
Showing
3 changed files
with
316 additions
and
18 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
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 |
---|---|---|
|
@@ -2,12 +2,21 @@ | |
// A rust binding for the GSL library by Guillaume Gomez ([email protected]) | ||
// | ||
|
||
use crate::ffi::FFI; | ||
use crate::Value; | ||
|
||
/// This function tests the minimizer specific characteristic size (if applicable to the used minimizer) against absolute tolerance `epsabs`. | ||
/// The test returns `crate::Value::Success` if the size is smaller than tolerance, otherwise crate::Value::Continue is returned. | ||
#[doc(alias = "gsl_multimin_test_size")] | ||
pub fn test_size(size: f64, epsabs: f64) -> Value { | ||
Value::from(unsafe { sys::gsl_multimin_test_size(size, epsabs) }) | ||
} | ||
|
||
/// This function tests the norm of the gradient `g` against the absolute tolerance `epsabs`. | ||
/// The gradient of a multidimensional function goes to zero at a minimum. The test returns `crate::Value::Success` if the following condition is achieved, |g| < epsabs | ||
/// and returns `crate::Value::Continue` otherwise. A suitable choice of `epsabs` can be made from the desired accuracy in the function for small variations in `x`. | ||
/// The relationship between these quantities is given by \delta{f} = g\,\delta{x}. | ||
#[doc(alias = "gsl_multimin_test_gradient")] | ||
pub fn test_gradient(g: &crate::VectorF64, epsabs: f64) -> Value { | ||
Value::from(unsafe { sys::gsl_multimin_test_gradient(g.unwrap_shared(), epsabs) }) | ||
} |
Oops, something went wrong.