From ffcc28921aaf021d8c374556cf5d7d20dd4e407d Mon Sep 17 00:00:00 2001 From: Francois Carouge Date: Wed, 26 Oct 2022 20:42:43 -0700 Subject: [PATCH] [filter] constexpr some operations --- include/fcarouge/internal/kalman.hpp | 4 ++-- include/fcarouge/internal/utility.hpp | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/fcarouge/internal/kalman.hpp b/include/fcarouge/internal/kalman.hpp index 855f81b47..24094a77e 100644 --- a/include/fcarouge/internal/kalman.hpp +++ b/include/fcarouge/internal/kalman.hpp @@ -84,7 +84,7 @@ struct kalman, using update_types = std::tuple; using prediction_types = std::tuple; - inline static const auto i{identity_v>}; + static inline const auto i{identity_v>}; state x{zero_v}; estimate_uncertainty p{identity_v}; @@ -214,7 +214,7 @@ struct kalman, using update_types = std::tuple; using prediction_types = std::tuple; - inline static const auto i{identity_v>}; + static inline const auto i{identity_v>}; state x{zero_v}; estimate_uncertainty p{identity_v}; diff --git a/include/fcarouge/internal/utility.hpp b/include/fcarouge/internal/utility.hpp index fe2c8ce8e..75e878e14 100644 --- a/include/fcarouge/internal/utility.hpp +++ b/include/fcarouge/internal/utility.hpp @@ -81,23 +81,24 @@ constexpr void for_constexpr(Function &&function) { } template -inline const Type identity_v{ +inline constexpr Type identity_v{ //! @todo Implement standard, default form. }; template -inline const Arithmetic identity_v{1}; +inline constexpr Arithmetic identity_v{1}; template requires requires(Matrix value) { value.Identity(); } inline const auto identity_v{Matrix::Identity()}; template -inline const Type zero_v{ +inline constexpr Type zero_v{ //! @todo Implement standard, default form. }; -template inline const Arithmetic zero_v{0}; +template +inline constexpr Arithmetic zero_v{0}; template requires requires(Matrix value) { value.Zero(); }