1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! One-dimensional minimization algorithms.
//!
//! Find `x` that minimizes `f(x)` within a bracket `[a, b]`.
pub use brent_min;
pub use golden_section;
use Float;
/// Result of a 1-D minimization algorithm.
///
/// # Examples
///
/// ```
/// # use scivex_optim::minimize_1d::golden_section;
/// let result = golden_section(|x: f64| (x - 2.0).powi(2), 0.0, 5.0, 1e-10, 100).unwrap();
/// assert!(result.converged);
/// assert!((result.x_min - 2.0).abs() < 1e-5);
/// ```