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

#include <sleipnir/optimization/solver/util/filter.hpp>

Public Member Functions

 Filter ()
 
void reset ()
 
void add (const FilterEntry< Scalar > &entry)
 
void add (FilterEntry< Scalar > &&entry)
 
bool try_add (const FilterEntry< Scalar > &entry, Scalar α)
 
bool try_add (FilterEntry< Scalar > &&entry, Scalar α)
 
bool is_acceptable (const FilterEntry< Scalar > &entry, Scalar α)
 
const FilterEntry< Scalar > & back () const
 

Public Attributes

Scalar max_constraint_violation {1e4}
 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 >
slp::Filter< Scalar >::Filter ( )
inline

Constructs an empty filter.

Member Function Documentation

◆ add() [1/2]

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

Adds a new entry to the filter.

Parameters
entryThe entry to add to the filter.

◆ add() [2/2]

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

Adds a new entry to the filter.

Parameters
entryThe entry to add to the filter.

◆ back()

template<typename Scalar >
const FilterEntry< Scalar > & slp::Filter< Scalar >::back ( ) const
inline

Returns the most recently added filter entry.

Returns
The most recently added filter entry.

◆ is_acceptable()

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

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

Parameters
entryThe entry to check.
αThe step size (0, 1].
Returns
True if the given entry is acceptable to the filter.

◆ reset()

template<typename Scalar >
void slp::Filter< Scalar >::reset ( )
inline

Resets the filter.

◆ try_add() [1/2]

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

Returns true if the given iterate is accepted by the filter.

Parameters
entryThe entry to attempt adding to the filter.
αThe step size (0, 1].
Returns
True if the given iterate is accepted by the filter.

◆ try_add() [2/2]

template<typename Scalar >
bool slp::Filter< Scalar >::try_add ( FilterEntry< Scalar > &&  entry,
Scalar  α 
)
inline

Returns true if the given iterate is accepted by the filter.

Parameters
entryThe entry to attempt adding to the filter.
αThe step size (0, 1].
Returns
True if the given iterate is accepted by the filter.

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