pub struct LBfgs { /* private fields */ }Expand description
Limited-memory Powell-damped BFGS, storing up to m_history
most-recent (s, y) pairs.
Implementations§
Source§impl LBfgs
impl LBfgs
Sourcepub fn new(n: usize, m_history: usize) -> Self
pub fn new(n: usize, m_history: usize) -> Self
m_history is the number of (s, y) pairs to keep
(Nocedal-Wright recommends 3–20; upstream IPOPT defaults to
6). Must be ≥ 1; a value of 0 would degenerate to plain
identity which is rarely useful.
pub fn has_prev(&self) -> bool
Sourcepub fn update(&mut self, x_new: &[Number], grad_lag_new: &[Number])
pub fn update(&mut self, x_new: &[Number], grad_lag_new: &[Number])
Record a new pair (s, y) = (x_new − x_prev, ∇L_new − ∇L_prev) if a prior iterate exists. The first call merely
stores (x_new, ∇L_new).
Sourcepub fn as_triplet(&self) -> Triplet
pub fn as_triplet(&self) -> Triplet
Materialize the current B_k as a dense Triplet over the
upper triangle. Always returns the full n(n+1)/2 triplets
(the same fixed pattern across iterations, so the QP
solver’s symbolic factorization stays valid).
Auto Trait Implementations§
impl Freeze for LBfgs
impl RefUnwindSafe for LBfgs
impl Send for LBfgs
impl Sync for LBfgs
impl Unpin for LBfgs
impl UnsafeUnpin for LBfgs
impl UnwindSafe for LBfgs
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
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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