pub struct Bfgs<S: Scalar> {
pub options: OptimOptions<S>,
}Expand description
BFGS quasi-Newton optimizer (struct API).
§Example
use numra_optim::{Bfgs, OptimOptions};
let bfgs = Bfgs::new(OptimOptions::default().gtol(1e-10));
let f = |x: &[f64]| x[0] * x[0] + x[1] * x[1];
let g = |x: &[f64], grad: &mut [f64]| { grad[0] = 2.0 * x[0]; grad[1] = 2.0 * x[1]; };
let result = bfgs.minimize(f, g, &[3.0, 4.0]).unwrap();
assert!(result.converged);Fields§
§options: OptimOptions<S>Implementations§
Auto Trait Implementations§
impl<S> Freeze for Bfgs<S>where
S: Freeze,
impl<S> RefUnwindSafe for Bfgs<S>where
S: RefUnwindSafe,
impl<S> Send for Bfgs<S>
impl<S> Sync for Bfgs<S>
impl<S> Unpin for Bfgs<S>where
S: Unpin,
impl<S> UnsafeUnpin for Bfgs<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Bfgs<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more