Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[benchmark] fix compilation #101

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/operator1x1x0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace
void operator1x1x0(::benchmark::State &state)
{
for (auto _ : state) {
using kalman = fcarouge::kalman<float, 1, 1, 0>;
using kalman = fcarouge::kalman<float, float>;
kalman k;

::benchmark::ClobberMemory();
Expand Down
2 changes: 1 addition & 1 deletion benchmark/operator1x1x1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace
void operator1x1x1(::benchmark::State &state)
{
for (auto _ : state) {
using kalman = fcarouge::kalman<float, 1, 1, 1>;
using kalman = fcarouge::kalman<float, float, float>;
kalman k;

::benchmark::ClobberMemory();
Expand Down
2 changes: 1 addition & 1 deletion benchmark/predict1x1x0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace
void predict1x1x0(::benchmark::State &state)
{
for (auto _ : state) {
using kalman = fcarouge::kalman<float, 1, 1, 0>;
using kalman = fcarouge::kalman<float, float>;
kalman k;

::benchmark::ClobberMemory();
Expand Down
2 changes: 1 addition & 1 deletion benchmark/predict1x1x1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace
void predict1x1x1(::benchmark::State &state)
{
for (auto _ : state) {
using kalman = fcarouge::kalman<float, 1, 1, 1>;
using kalman = fcarouge::kalman<float, float, float>;
kalman k;

::benchmark::ClobberMemory();
Expand Down
2 changes: 1 addition & 1 deletion benchmark/update1x1x0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace
void update1x1x0(::benchmark::State &state)
{
for (auto _ : state) {
using kalman = fcarouge::kalman<float, 1, 1, 0>;
using kalman = fcarouge::kalman<float, float>;
kalman k;

::benchmark::ClobberMemory();
Expand Down
2 changes: 1 addition & 1 deletion benchmark/update1x1x1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace
void update1x1x1(::benchmark::State &state)
{
for (auto _ : state) {
using kalman = fcarouge::kalman<float, 1, 1, 1>;
using kalman = fcarouge::kalman<float, float, float>;
kalman k;

const float input{ 0. };
Expand Down
116 changes: 58 additions & 58 deletions include/fcarouge/kalman.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,51 +789,43 @@ class kalman
//! @name Public Filtering Member Functions
//! @{

//! @brief Runs a step of the filter.
//!
//! @details Predicts and updates the estimates per prediction arguments,
//! control input, and measurement output.
//! @brief Produces estimates of the state variables and uncertainties.
//!
//! @tparam InputTypes The template parameter pack types passed in the
//! `arguments` parameters after the update arguments and before the output
//! arguments. `InputTypes` must be compatible with the `Input` type template
//! parameter of the control u.
//! @details Implements the total probability theorem.
//!
//! @param arguments The prediction, update, input, and output parameters of
//! @param arguments The prediction and input parameters of
//! the filter, in that order. The arguments need to be compatible with the
//! filter types. The prediction parameters convertible to the
//! `PredictionTypes` template pack types are passed through for computations
//! of prediction matrices. The update parameters convertible to the
//! `UpdateTypes` template pack types are passed through for computations of
//! update matrices. The control parameter pack types convertible to the
//! `Input` template type. The observation parameter pack types convertible to
//! the `Output` template type. The update and prediction types are explicitly
//! defined with the class definition and the observation parameter pack types
//! are always deduced per the greedy matching rule. However the control
//! parameter pack types must always be explicitly defined per the fair
//! matching rule.
//!
//! @note Called as `k(...);` with prediction values and output values when
//! the filter has no input parameters. The input type list is explicitly
//! empty. Otherwise can be called as `k.template operator()<input1_t,
//! input2_t, ...>(...);` with prediction values, input values, and output
//! values. The input type list being explicitly specified per the fair
//! matching rule. A lambda can come in handy to reduce the verbose call
//! `const auto kf{ [&k](const auto
//! &...args) { k.template operator()<input1_t, input2_t,
//! ...>(args...); } };` then called as `kf(...);`.
//! of prediction matrices. The control parameter pack types convertible to
//! the `Input` template type. The prediction types are explicitly defined
//! with the class definition.
//!
//! @todo Consider whether this method needs to exist or if the operator() is
//! sufficient for all clients?
//! @todo Consider if returning the state column vector X would be preferable?
//! Or fluent interface? Would be compatible with an ES-EKF implementation?
//! @todo Understand why the implementation cannot be moved out of the class.
//! @todo What should be the order of the parameters? Update first?
template <typename... InputTypes>
inline constexpr void operator()(const auto &...arguments);
//! @todo Can the parameter pack of `PredictionTypes` be explicit in the
//! method declaration for user clarity?
inline constexpr void predict(const auto &...arguments);

//! @brief Returns the Nth prediction argument.
//!
//! @details Convenience access to the last used prediction arguments.
//!
//! @tparam The non-type template parameter index position of the prediction
//! argument types.
//!
//! @return The prediction argument corresponding to the Nth position of the
//! parameter pack of the tuple-like `PredictionTypes` class template type.
//!
//! @complexity Constant.
template <std::size_t Position> inline constexpr auto predict() const;

//! @brief Updates the estimates with the outcome of a measurement.
//!
//! @details Implements the Bayes' theorem. Combine one measurement and the
//! prior estimate.
//! @details Also known as the observation or correction step. Implements the
//! Bayes' theorem. Combine one measurement and the prior estimate.
//!
//! @param arguments The update and output parameters of
//! the filter, in that order. The arguments need to be compatible with the
Expand Down Expand Up @@ -864,38 +856,46 @@ class kalman
//! @complexity Constant.
template <std::size_t Position> inline constexpr auto update() const;

//! @brief Produces estimates of the state variables and uncertainties.
//! @brief Runs a full step of the filter.
//!
//! @details Implements the total probability theorem.
//! @details Predicts and updates the estimates per arguments,
//! control input, and measurement output.
//!
//! @param arguments The prediction and input parameters of
//! @tparam InputTypes The template parameter pack types passed in the
//! `arguments` parameters after the update arguments and before the output
//! arguments. `InputTypes` must be compatible with the `Input` type template
//! parameter of the control u.
//!
//! @param arguments The prediction, update, input, and output parameters of
//! the filter, in that order. The arguments need to be compatible with the
//! filter types. The prediction parameters convertible to the
//! `PredictionTypes` template pack types are passed through for computations
//! of prediction matrices. The control parameter pack types convertible to
//! the `Input` template type. The prediction types are explicitly defined
//! with the class definition.
//! of prediction matrices. The update parameters convertible to the
//! `UpdateTypes` template pack types are passed through for computations of
//! update matrices. The control parameter pack types convertible to the
//! `Input` template type. The observation parameter pack types convertible to
//! the `Output` template type. The update and prediction types are explicitly
//! defined with the class definition and the observation parameter pack types
//! are always deduced per the greedy matching rule. However the control
//! parameter pack types must always be explicitly defined per the fair
//! matching rule.
//!
//! @note Called as `k(...);` with prediction values and output values when
//! the filter has no input parameters. The input type list is explicitly
//! empty. Otherwise can be called as `k.template operator()<input1_t,
//! input2_t, ...>(...);` with prediction values, input values, and output
//! values. The input type list being explicitly specified per the fair
//! matching rule. A lambda can come in handy to reduce the verbose call
//! `const auto kf{ [&k](const auto
//! &...args) { k.template operator()<input1_t, input2_t,
//! ...>(args...); } };` then called as `kf(...);`.
//!
//! @todo Consider whether this method needs to exist or if the operator() is
//! sufficient for all clients?
//! @todo Consider if returning the state column vector X would be preferable?
//! Or fluent interface? Would be compatible with an ES-EKF implementation?
//! @todo Can the parameter pack of `PredictionTypes` be explicit in the
//! method declaration for user clarity?
inline constexpr void predict(const auto &...arguments);

//! @brief Returns the Nth prediction argument.
//!
//! @details Convenience access to the last used prediction arguments.
//!
//! @tparam The non-type template parameter index position of the prediction
//! argument types.
//!
//! @return The prediction argument corresponding to the Nth position of the
//! parameter pack of the tuple-like `PredictionTypes` class template type.
//!
//! @complexity Constant.
template <std::size_t Position> inline constexpr auto predict() const;
//! @todo Understand why the implementation cannot be moved out of the class.
//! @todo What should be the order of the parameters? Update first?
template <typename... InputTypes>
inline constexpr void operator()(const auto &...arguments);

//! @}
};
Expand Down