WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
slp::Filter< Scalar > Class Template Reference

Step filter. More...

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/optimization/solver/util/filter.hpp>

Public Member Functions

 Filter ()
 Constructs an empty filter.
void reset ()
 Resets the filter.
void add (const FilterEntry< Scalar > &entry)
 Adds a new entry to the filter.
void add (FilterEntry< Scalar > &&entry)
 Adds a new entry to the filter.
bool try_add (const FilterEntry< Scalar > &entry, Scalar α)
 Returns true if the given iterate is accepted by the filter.
bool try_add (FilterEntry< Scalar > &&entry, Scalar α)
 Returns true if the given iterate is accepted by the filter.
bool is_acceptable (const FilterEntry< Scalar > &entry, Scalar α)
 Returns true if the given entry is acceptable to the filter.
const FilterEntry< Scalar > & back () const
 Returns the most recently added filter entry.

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.

Member Data Documentation

◆ max_constraint_violation

template<typename Scalar>
Scalar slp::Filter< Scalar >::max_constraint_violation {1e4}

The maximum constraint violation.


The documentation for this class was generated from the following file:
  • /home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/optimization/solver/util/filter.hpp