EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
FilterUpkeep.h
Go to the documentation of this file.
1#pragma once
2
7
8#include <concepts>
9#include <expected>
10#include <type_traits>
11#include <utility>
12
18
19namespace Emrys
20{
21
22namespace internal
23{
24
28template <typename U>
29concept UpkeepArgument = !TransformMethod<U> && !std::same_as<std::remove_cvref_t<U>, ModelsMethod>;
30
35template <typename Model, typename X>
36using MethodArgumentFor = std::conditional_t<UpkeepArgument<X>, DefaultMethodFor<Model>, X>;
37
39template <typename X>
40using UpkeepArgumentFor = std::conditional_t<UpkeepArgument<X>, X, upkeep::None>;
41
54template <typename Derived, typename Upkeep_>
55class HeldUpkeep
56{
57public:
58
60 using UpkeepType = Upkeep_;
61
63 [[nodiscard]] Upkeep_ const &
64 upkeep() const
65 {
66 return m_upkeep;
67 }
68
73 [[nodiscard]] std::expected<bool, NumericError>
74 maintain()
75 requires UpkeepOperation<Upkeep_, typename Derived::StateType>
76 {
77 return m_upkeep(static_cast<Derived &>(*this).state());
78 }
79
80protected:
81
83 explicit HeldUpkeep(Upkeep_ upkeep)
84 : m_upkeep{std::move(upkeep)}
85 {}
86
87private:
88
89 EMRYS_FILTER_NO_UNIQUE_ADDRESS Upkeep_ m_upkeep;
90};
91
92} // namespace internal
93
94} // namespace Emrys
The macros every header includes first.
The transform methods, as policies made by their factories (decisions.md [policy-factories],...
NumericError, the reasons a factorization or a normalization can fail, and its two names,...
Process models as functions with reads and writes (decisions.md [model-policies], [continuous-time-no...
Upkeep (decisions.md [upkeep], [rao-blackwellized-core]): the actions Resample, Roughen,...
#define EMRYS_FILTER_NO_UNIQUE_ADDRESS
Assertion used for programmer errors (misuse of the API).
Definition Macros.h:38
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