pub struct SubproblemSolver {
pub max_cg_iter: usize,
pub cg_tol: f64,
}Expand description
Constrained trust-region subproblem solver using projected conjugate gradient.
Solves: min_{p} g^T p + 0.5 p^T B p s.t. ||p|| <= Δ, A p = 0 (projected on constraint manifold)
Uses the Steihaug-Toint projected CG approach.
Fields§
§max_cg_iter: usizeMaximum CG iterations
cg_tol: f64CG convergence tolerance
Implementations§
Source§impl SubproblemSolver
impl SubproblemSolver
Sourcepub fn solve<BV>(
&self,
g: &[f64],
b_times_v: BV,
radius: f64,
) -> (Vec<f64>, bool)
pub fn solve<BV>( &self, g: &[f64], b_times_v: BV, radius: f64, ) -> (Vec<f64>, bool)
Solve the trust-region subproblem using Steihaug-Toint PCG.
Returns the step p and whether the trust region boundary was hit.
§Arguments
g- Gradient vectorb_times_v- Function computing B*v (Hessian-vector product)radius- Trust region radius Δ
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SubproblemSolver
impl RefUnwindSafe for SubproblemSolver
impl Send for SubproblemSolver
impl Sync for SubproblemSolver
impl Unpin for SubproblemSolver
impl UnsafeUnpin for SubproblemSolver
impl UnwindSafe for SubproblemSolver
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.