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

The upkeep operations, each made by its factory (decisions.md [policy-factories], [upkeep]): the actions resample(), roughen(), pruneBelow(), pruneTail(), pruneToSize(), subdivide(), floorModes(), and repairCovariance(), the triggers when(), whenEss(), and whenSize(), sequence(), and none(). More...

Classes

class  Resample
 Action that resamples a set in proportion to its weights, drawing from the generator G with the resampler Resampler_ (systematic by default) under the execution policy Policy_ (sequential by default), to a given size if one is given and to the set's size otherwise. More...
class  Roughen
 Action that moves each particle by an independent draw from a Gaussian kernel, to restore the diversity resampling removes: the regularized particle filter. More...
struct  When
 Trigger that runs its actions when its predicate holds for the state: the general trigger, of which WhenEss and WhenSize are two. More...
struct  None
 The upkeep a filter holds when it is given none: it takes any state, changes nothing, and returns false, so that maintain() can be called on every filter (decisions.md [upkeep]). More...
struct  PruneBelow
 Action that removes every point whose normalized probability is below probability, renormalizing the rest; the most probable point is always kept. More...
struct  PruneTail
 Action that removes the least probable points, as many as can be while their combined probability stays below fraction, renormalizing the rest. More...
struct  PruneToSize
 Action that removes the least probable points until at most maxSize remain, renormalizing the rest. More...
struct  Subdivide
 Action that splits every point into factor points along each axis, sharing its probability equally. More...
struct  FloorModes
 Action that raises every mode less probable than probability to it, scaling the others down to keep the sum one, so that no mode is ruled out for good. More...
struct  RepairCovariance
 Action that repairs every covariance of the state that is not positive definite, by the Repair Repair_ (roots::Ridge by default), so that its density can be read. More...

Typedefs

template<typename Compare, RealScalar Scalar_, typename... Actions>
using WhenEss = When<internal::EssTest<Compare, Scalar_>, Actions...>
 Trigger that runs its actions when compare holds between a set's effective sample size and fraction of its size: a When whose predicate is an internal::EssTest.
template<typename Compare, typename... Actions>
using WhenSize = When<internal::SizeTest<Compare>, Actions...>
 Trigger that runs its actions when compare holds between a state's number of elements and a limit, such as a mixture's components or a grid's live cells: a When whose predicate is an internal::SizeTest.
template<typename... Actions>
using Sequence = When<internal::Always, Actions...>
 Runs its actions in order on the state every time: a When whose predicate always holds, so that a filter's whole upkeep is one value (decisions.md [upkeep]).

Functions

template<std::uniform_random_bit_generator G, typename R = resamplers::Systematic>
requires (!std::integral<R>)
constexpr Resample< G, R > resample (G &generator, R resampler={})
template<std::uniform_random_bit_generator G, typename R = resamplers::Systematic>
requires (!std::integral<R>)
constexpr Resample< G, R > resample (G &generator, Eigen::Index size, R resampler={})
template<ExecutionPolicy P, std::uniform_random_bit_generator G, typename R = resamplers::Systematic>
requires (!std::integral<R>)
constexpr Resample< G, R, std::remove_cvref_t< P > > resample (P &&policy, G &generator, R resampler={})
template<ExecutionPolicy P, std::uniform_random_bit_generator G, typename R = resamplers::Systematic>
requires (!std::integral<R>)
constexpr Resample< G, R, std::remove_cvref_t< P > > resample (P &&policy, G &generator, Eigen::Index size, R resampler={})
template<std::uniform_random_bit_generator G, typename Value = double>
requires std::is_arithmetic_v<Value>
constexpr Roughen< G, internal::DeducedScalar< Value > > roughen (G &generator, Value scale=1)
template<ExecutionPolicy P, std::uniform_random_bit_generator G, typename Value = double>
requires std::is_arithmetic_v<Value>
constexpr Roughen< G, internal::DeducedScalar< Value >, std::remove_cvref_t< P > > roughen (P &&policy, G &generator, Value scale=1)
template<typename Predicate, typename... Actions>
When< Predicate, Actions... > when (Predicate predicate, Actions... actions)
template<typename Compare, typename Value, typename... Actions>
requires (!ExecutionPolicy<Compare>) && std::is_arithmetic_v<Value> && std::predicate<Compare const &, internal::DeducedScalar
<Value>, internal::DeducedScalar<Value>>
WhenEss< Compare, internal::DeducedScalar< Value >, Actions... > whenEss (Compare compare, Value fraction, Actions... actions)
template<ExecutionPolicy P, typename Compare, typename Value, typename... Actions>
requires std::is_arithmetic_v<Value> && std::predicate<Compare const &, internal::DeducedScalar<Value>, internal::DeducedScalar
<Value>>
When< internal::EssTest< Compare, internal::DeducedScalar< Value >, std::remove_cvref_t< P > >, Actions... > whenEss (P &&policy, Compare compare, Value fraction, Actions... actions)
template<typename Compare, typename... Actions>
requires std::predicate<Compare const &, std::ptrdiff_t, std::ptrdiff_t>
WhenSize< Compare, Actions... > whenSize (Compare compare, std::ptrdiff_t limit, Actions... actions)
template<typename... Actions>
Sequence< Actions... > sequence (Actions... actions)
constexpr None none ()
template<typename Value>
requires std::is_arithmetic_v<Value>
constexpr PruneBelow< internal::DeducedScalar< Value > > pruneBelow (Value probability)
template<typename Value>
requires std::is_arithmetic_v<Value>
constexpr PruneTail< internal::DeducedScalar< Value > > pruneTail (Value fraction)
constexpr PruneToSize pruneToSize (std::ptrdiff_t maxSize)
constexpr Subdivide subdivide (std::ptrdiff_t factor=2)
template<typename Value>
requires std::is_arithmetic_v<Value>
constexpr FloorModes< internal::DeducedScalar< Value > > floorModes (Value probability)
template<Repair R = roots::Ridge<>>
constexpr RepairCovariance< R > repairCovariance (R repair={})

Detailed Description

The upkeep operations, each made by its factory (decisions.md [policy-factories], [upkeep]): the actions resample(), roughen(), pruneBelow(), pruneTail(), pruneToSize(), subdivide(), floorModes(), and repairCovariance(), the triggers when(), whenEss(), and whenSize(), sequence(), and none().

The types beside them name an operation where a type is needed, as a class member or a filter's template argument.