pub struct PANOCOptimizer<'a, GradientType, ConstraintType, CostType>where
GradientType: Fn(&[f64], &mut [f64]) -> FunctionCallResult,
CostType: Fn(&[f64], &mut f64) -> FunctionCallResult,
ConstraintType: Constraint,{ /* private fields */ }
Expand description
Optimizer using the PANOC algorithm
Implementations§
Source§impl<'a, GradientType, ConstraintType, CostType> PANOCOptimizer<'a, GradientType, ConstraintType, CostType>where
GradientType: Fn(&[f64], &mut [f64]) -> FunctionCallResult,
CostType: Fn(&[f64], &mut f64) -> FunctionCallResult,
ConstraintType: Constraint,
impl<'a, GradientType, ConstraintType, CostType> PANOCOptimizer<'a, GradientType, ConstraintType, CostType>where
GradientType: Fn(&[f64], &mut [f64]) -> FunctionCallResult,
CostType: Fn(&[f64], &mut f64) -> FunctionCallResult,
ConstraintType: Constraint,
Sourcepub fn new(
problem: Problem<'a, GradientType, ConstraintType, CostType>,
cache: &'a mut PANOCCache,
) -> Self
pub fn new( problem: Problem<'a, GradientType, ConstraintType, CostType>, cache: &'a mut PANOCCache, ) -> Self
Sourcepub fn with_tolerance(self, tolerance: f64) -> Self
pub fn with_tolerance(self, tolerance: f64) -> Self
Sets the tolerance on the norm of the fixed-point residual
The algorithm will exit if the form of gamma*FPR drops below this tolerance
§Panics
The method panics if the specified tolerance is not positive
Sourcepub fn with_akkt_tolerance(self, akkt_tolerance: f64) -> Self
pub fn with_akkt_tolerance(self, akkt_tolerance: f64) -> Self
Specify the tolerance $\epsilon$ related to the AKKT condition
$$ \Vert{}\gamma^{-1}(u-u^+) + \nabla f(u) - \nabla f(u^+){}\Vert \leq \epsilon $$
§Arguments
akkt_tolerance
: the AKKT-specific tolerance
§Returns
Returns the current mutable and updated instance of the provided object
§Panics
The method panics if the provided value of the AKKT-specific tolerance is not positive.
Sourcepub fn with_max_iter(self, max_iter: usize) -> Self
pub fn with_max_iter(self, max_iter: usize) -> Self
Sets the maximum number of iterations
§Panics
Panics if the provided number of iterations is equal to zero
Sourcepub fn with_max_duration(self, max_duation: Duration) -> Self
pub fn with_max_duration(self, max_duation: Duration) -> Self
Sets the maximum solution time, useful in real-time applications
Trait Implementations§
Source§impl<'life, GradientType, ConstraintType, CostType> Optimizer for PANOCOptimizer<'life, GradientType, ConstraintType, CostType>where
GradientType: Fn(&[f64], &mut [f64]) -> FunctionCallResult + 'life,
CostType: Fn(&[f64], &mut f64) -> FunctionCallResult,
ConstraintType: Constraint + 'life,
impl<'life, GradientType, ConstraintType, CostType> Optimizer for PANOCOptimizer<'life, GradientType, ConstraintType, CostType>where
GradientType: Fn(&[f64], &mut [f64]) -> FunctionCallResult + 'life,
CostType: Fn(&[f64], &mut f64) -> FunctionCallResult,
ConstraintType: Constraint + 'life,
Source§fn solve(&mut self, u: &mut [f64]) -> Result<SolverStatus, SolverError>
fn solve(&mut self, u: &mut [f64]) -> Result<SolverStatus, SolverError>
solves a given problem and updates the initial estimate
u
with the solution Read moreAuto Trait Implementations§
impl<'a, GradientType, ConstraintType, CostType> Freeze for PANOCOptimizer<'a, GradientType, ConstraintType, CostType>
impl<'a, GradientType, ConstraintType, CostType> RefUnwindSafe for PANOCOptimizer<'a, GradientType, ConstraintType, CostType>
impl<'a, GradientType, ConstraintType, CostType> Send for PANOCOptimizer<'a, GradientType, ConstraintType, CostType>
impl<'a, GradientType, ConstraintType, CostType> Sync for PANOCOptimizer<'a, GradientType, ConstraintType, CostType>
impl<'a, GradientType, ConstraintType, CostType> Unpin for PANOCOptimizer<'a, GradientType, ConstraintType, CostType>
impl<'a, GradientType, ConstraintType, CostType> !UnwindSafe for PANOCOptimizer<'a, GradientType, ConstraintType, CostType>
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