EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
Emrys::upkeep::PruneToSize Struct Reference

Action that removes the least probable points until at most maxSize remain, renormalizing the rest. More...

#include <EmrysFilter/Distributions/Upkeep.h>

Public Member Functions

template<typename State>
requires requires(State & state, Eigen::Index size) { state.pruneToSize(size); }
std::expected< bool, WeightError > operator() (State &state) const
 Prunes state.

Public Attributes

std::ptrdiff_t maxSize
 the most points left, at least one

Detailed Description

Action that removes the least probable points until at most maxSize remain, renormalizing the rest.

The state is anything with pruneToSize(maxSize), as for PruneBelow. Under upkeep::whenSize(std::greater{}, 64, upkeep::pruneToSize(32)) the work is done in batches rather than at every step.

See also
PruneBelow, PruneTail

Member Function Documentation

◆ operator()()

template<typename State>
requires requires(State & state, Eigen::Index size) { state.pruneToSize(size); }
std::expected< bool, WeightError > Emrys::upkeep::PruneToSize::operator() ( State & state) const
inlinenodiscard

Prunes state.

Returns
whether any point was removed, or the WeightError of the state's weights

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