Sleipnir C++ API
Loading...
Searching...
No Matches
slp::Filter< Scalar > Class Template Reference

#include </home/runner/work/Sleipnir/Sleipnir/include/sleipnir/optimization/solver/util/filter.hpp>

Public Member Functions

constexpr Filter (Scalar initial_constraint_violation=Scalar(0))
 
void reset ()
 Resets the filter.
 
bool try_reset (const FilterEntry< Scalar > &current_entry)
 
bool try_add (const FilterEntry< Scalar > &current_entry, const FilterEntry< Scalar > &trial_entry, Scalar D_ϕ, Scalar α)
 
void add (const FilterEntry< Scalar > &entry)
 
bool is_acceptable (const FilterEntry< Scalar > &entry) const
 
Scalar min_step_size (const FilterEntry< Scalar > &current_entry, Scalar D_ϕ) const
 

Public Attributes

Scalar min_constraint_violation
 The minimum constraint violation.
 
Scalar max_constraint_violation
 The maximum constraint violation.
 

Detailed Description

template<typename Scalar>
class slp::Filter< Scalar >

Step filter.

See the section on filters in chapter 15 of [1].

Template Parameters
ScalarScalar type.

Constructor & Destructor Documentation

◆ Filter()

template<typename Scalar >
constexpr slp::Filter< Scalar >::Filter ( Scalar  initial_constraint_violation = Scalar(0))
inlineexplicitconstexpr

Constructs an empty filter.

Parameters
initial_constraint_violationThe optimization problem's initial constraint violation.

Member Function Documentation

◆ add()

template<typename Scalar >
void slp::Filter< Scalar >::add ( const FilterEntry< Scalar > &  entry)
inline

Adds the given entry to the filter.

The entry is shifted by the sufficient decrease margins, so iterates that don't sufficiently decrease the cost or constraint violation relative to it are rejected afterward.

Parameters
entryThe entry to add to the filter.

◆ is_acceptable()

template<typename Scalar >
bool slp::Filter< Scalar >::is_acceptable ( const FilterEntry< Scalar > &  entry) const
inline

Returns true if the given entry is acceptable to the filter.

Parameters
entryThe entry.
Returns
True if the given entry is acceptable to the filter.

◆ min_step_size()

template<typename Scalar >
Scalar slp::Filter< Scalar >::min_step_size ( const FilterEntry< Scalar > &  current_entry,
Scalar  D_ϕ 
) const
inline

Returns the minimum step size of the backtracking line search.

Below this step size, no trial iterate can satisfy the sufficient decrease condition or both the switching condition and Armijo condition, so feasibility restoration should be invoked.

Parameters
current_entryThe entry corresponding to the current iterate.
D_ϕCost directional derivative along the search direction.
Returns
The minimum step size.

◆ try_add()

template<typename Scalar >
bool slp::Filter< Scalar >::try_add ( const FilterEntry< Scalar > &  current_entry,
const FilterEntry< Scalar > &  trial_entry,
Scalar  D_ϕ,
Scalar  α 
)
inline

Returns true if the given trial entry is acceptable to the filter.

Parameters
current_entryThe entry corresponding to the current iterate.
trial_entryThe entry corresponding to the trial iterate.
D_ϕCost directional derivative along the search direction.
αThe step size (0, 1].
Returns
True if the given entry is acceptable to the filter.

◆ try_reset()

template<typename Scalar >
bool slp::Filter< Scalar >::try_reset ( const FilterEntry< Scalar > &  current_entry)
inline

Resets the filter and lowers the maximum constraint violation if the filter may be impeding progress.

Parameters
current_entryThe entry corresponding to the current iterate.
Returns
True if the filter was reset.

The documentation for this class was generated from the following file: