EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
Recursion.h
Go to the documentation of this file.
1#pragma once
2
10
11#include <concepts>
12
16
17namespace Emrys
18{
19
72template <typename R>
73concept Recursion = RealScalar<typename R::Scalar> && Space<typename R::SpaceType> && requires(R const & recursion) {
74 typename R::StateType;
75 typename R::ModelType;
76 typename R::MethodType;
77 { R::Reentrant } -> std::convertible_to<bool>;
78 { recursion.model() } -> std::same_as<typename R::ModelType const &>;
79 { recursion.method() } -> std::same_as<typename R::MethodType const &>;
80};
81
86template <typename R, typename Component_>
87concept RecursionOver = Recursion<R> && std::same_as<typename R::StateType, Params<Component_>>;
88
89namespace internal
90{
91
97struct UpdateAccess
98{
100 template <typename Update>
101 [[nodiscard]] static auto &
102 logLikelihood(Update & update)
103 {
104 return update.m_logLikelihood;
105 }
106
108 template <typename Update>
109 [[nodiscard]] static auto &
110 posteriorEnds(Update & update)
111 {
112 return update.m_posteriorEnds;
113 }
114};
115
116} // namespace internal
117
118} // namespace Emrys
Mathematical constants and scalar functions that work in every scalar type the library accepts,...
Params and Density: the traits that pair a distribution's parameters with its density,...
The Space concept and what every continuous space shares (decisions.md [sizes-and-dimensions]): the t...
A type usable as the scalar of a distribution: a real number type such as float, double,...
Definition Math.h:80
A Recursion whose steps act on the parameters of the component Component_, the constraint a filter ov...
Definition Recursion.h:87
A recursion: a filter without its state, acting in place on a state passed in (decisions....
Definition Recursion.h:73
A type usable as the space of a distribution.
Definition Space.h:186
Derived::Scalar logLikelihood(M const &measurement, Space const &space, Eigen::MatrixBase< Derived > const &x)
Definition Likelihood.h:433
std::expected< CategoricalUpdate< Space, Scalar >, WeightError > update(CategoricalParams< Space, Scalar > const &prior, E const &emission)
Definition Emission.h:97