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 Types

using DenseVector = Eigen::Vector< Scalar, Eigen::Dynamic >
 Type alias for dense vector.
 
using SparseVector = Eigen::SparseVector< Scalar >
 Type alias for sparse vector.
 

Public Member Functions

constexpr Filter (Scalar initial_constraint_violation=Scalar(0))
 
void reset ()
 Resets the filter.
 
bool try_add (const FilterEntry< Scalar > &current_entry, const FilterEntry< Scalar > &trial_entry, const DenseVector &p_x, const SparseVector &g, Scalar α)
 
bool last_rejection_due_to_filter () 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

◆ last_rejection_due_to_filter()

template<typename Scalar >
bool slp::Filter< Scalar >::last_rejection_due_to_filter ( ) const
inline

Returns true if the most recent trial entry rejection was due to the filter.

Returns
True if the most recent trial entry rejection was due to the filter.

◆ try_add()

template<typename Scalar >
bool slp::Filter< Scalar >::try_add ( const FilterEntry< Scalar > &  current_entry,
const FilterEntry< Scalar > &  trial_entry,
const DenseVector p_x,
const SparseVector g,
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.
p_xDecision variable primal step.
gCost function gradient.
αThe step size (0, 1].
Returns
True if the given entry is acceptable to the filter.

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