argmin/solver/trustregion/mod.rs
1// Copyright 2018-2020 argmin developers
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7
8//! Argmin Trust region methods
9
10/// Cauchy Point
11pub mod cauchypoint;
12/// Dogleg method
13pub mod dogleg;
14/// Steihaug method
15pub mod steihaug;
16/// Trust region solver
17pub mod trustregion_method;
18
19pub use self::cauchypoint::*;
20pub use self::dogleg::*;
21pub use self::steihaug::*;
22pub use self::trustregion_method::*;
23
24use crate::core::ArgminFloat;
25
26/// Computes reduction ratio
27pub fn reduction_ratio<F: ArgminFloat>(fxk: F, fxkpk: F, mk0: F, mkpk: F) -> F {
28 (fxk - fxkpk) / (mk0 - mkpk)
29}