EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
SqrtKalmanFilter.h
Go to the documentation of this file.
1#pragma once
2
8
9#include <utility>
10
18
19namespace Emrys
20{
21
54template <
55 Space Space_,
56 typename Model_,
57 typename Method_ = DefaultMethodFor<Model_>,
58 RealScalar Scalar_ = double,
59 typename Upkeep_ = upkeep::None>
61 : public KalmanFilter<
62 SqrtGaussian<Space_, Scalar_>,
63 Model_,
64 Method_,
65 KalmanRecursion<SqrtGaussian<Space_, Scalar_>, Model_, Method_>,
66 Upkeep_>
67{
68public:
69
72 Model_,
73 Method_,
75 Upkeep_>;
76
82 Model_ model,
85 std::type_identity_t<Upkeep_> upkeep = {}
86 )
87 : Base{std::move(model), std::move(state), std::move(method), std::move(upkeep)}
88 {}
89
94 requires(!std::same_as<Upkeep_, Emrys::upkeep::None>)
95 : Base{std::move(model), std::move(state), MethodFor<Model_, Method_>{}, std::move(upkeep)}
96 {}
97};
98
100// One guide with a defaulted method, its parameters in the class's order.
101template <typename Space, typename Model, typename Method = DefaultMethodFor<Model>, typename Scalar>
102 requires(!internal::UpkeepArgument<Method>)
103SqrtKalmanFilter(Model, SqrtGaussianParams<Space, Scalar>, Method = {})
104 -> SqrtKalmanFilter<Space, internal::BoundStep<Model, Space, Scalar>, Method, Scalar>;
105
106template <typename Space, typename Model, typename Scalar, typename U>
107 requires internal::UpkeepArgument<U>
108SqrtKalmanFilter(Model, SqrtGaussianParams<Space, Scalar>, U)
109 -> SqrtKalmanFilter<Space, internal::BoundStep<Model, Space, Scalar>, DefaultMethodFor<Model>, Scalar, U>;
110
111template <typename Space, typename Model, typename Method, typename Scalar, typename U>
112SqrtKalmanFilter(Model, SqrtGaussianParams<Space, Scalar>, Method, U)
113 -> SqrtKalmanFilter<Space, internal::BoundStep<Model, Space, Scalar>, Method, Scalar, U>;
115
116} // namespace Emrys
117
118#ifndef EMRYS_FILTER_NO_IO
119
120namespace Emrys
121{
122
123namespace internal
124{
125
127template <typename Space_, typename Model_, typename Method_, typename Scalar_, typename Upkeep_>
128void
129describe(
130 std::ostream & stream,
131 SqrtKalmanFilter<Space_, Model_, Method_, Scalar_, Upkeep_> const & filter,
132 Indent indent
133)
134{
135 describeFilter(stream, "square-root Kalman filter", filter.state(), indent);
136}
137
138} // namespace internal
139
140} // namespace Emrys
141
142#endif // EMRYS_FILTER_NO_IO
Spaces built from other spaces (decisions.md [sizes-and-dimensions], [several-resizable-blocks]): Com...
KalmanRecursion and KalmanFilter (decisions.md [templated-measurements] and [filters-and-recursions])...
Mathematical constants and scalar functions that work in every scalar type the library accepts,...
Printing: operator<< and std::formatter for every distribution, every filter (which prints its name a...
Process models as functions with reads and writes (decisions.md [model-policies], [continuous-time-no...
The Space concept and what every continuous space shares (decisions.md [sizes-and-dimensions]): the t...
The square-root form of the Gaussian (decisions.md [gaussian-forms]): its parameters SqrtGaussianPara...
Method_ const & method() const
Definition KalmanFilter.h:663
KalmanFilter(Model_ model, Params< Component_ > state, MethodFor< Model_, Method_ > method={}, std::type_identity_t< Upkeep_ > upkeep={})
A filter with process model model, initial state state, prediction method method, and upkeep upkeep,...
Definition KalmanFilter.h:580
StateType const & state() const
Definition KalmanFilter.h:615
Model_ const & model() const
Definition KalmanFilter.h:649
The Kalman filter's steps over one component, without the state: a process model and a prediction met...
Definition KalmanFilter.h:121
A Gaussian kept as a mean and a lower-triangular root of its covariance.
Definition SqrtGaussian.h:81
KalmanFilter< SqrtGaussian< Space_, Scalar_ >, Model_, Method_, KalmanRecursion< SqrtGaussian< Space_, Scalar_ >, Model_, Method_ >, Upkeep_ > Base
the filter this is
Definition SqrtKalmanFilter.h:70
SqrtKalmanFilter(Model_ model, SqrtGaussianParams< Space_, Scalar_ > state, std::type_identity_t< Upkeep_ > upkeep)
A filter with process model model, initial state state, the default prediction method,...
Definition SqrtKalmanFilter.h:93
SqrtKalmanFilter(Model_ model, SqrtGaussianParams< Space_, Scalar_ > state, MethodFor< Model_, Method_ > method={}, std::type_identity_t< Upkeep_ > upkeep={})
A filter with process model model, initial state state, and prediction method method; a fixed-step mo...
Definition SqrtKalmanFilter.h:81
A type usable as the scalar of a distribution: a real number type such as float, double,...
Definition Math.h:80
A type usable as the space of a distribution.
Definition Space.h:186
FormGaussian< SqrtGaussianParams< Space_, Scalar_ > > SqrtGaussian
The Gaussian in square-root form, which evaluates its density: what SqrtGaussianParams::toDensity() r...
Definition SqrtGaussian.h:505
typename internal::DefaultMethodOf< Model >::type DefaultMethodFor
The prediction method of a filter with process model Model, unless it is given one: Linearized,...
Definition ProcessModel.h:3220
std::conditional_t< isFixedStep< Model >, ModelsMethod, Method > MethodFor
The type of a filter constructor's method argument: Method, or ModelsMethod for a fixed-step Model,...
Definition ProcessModel.h:3236
The upkeep operations, each made by its factory (decisions.md [policy-factories], [upkeep]): the acti...
Definition Upkeep.h:380
The upkeep a filter holds when it is given none: it takes any state, changes nothing,...
Definition Upkeep.h:889