From efa8082f5da2c30f2d4797702daf4dbbcca23873 Mon Sep 17 00:00:00 2001 From: FrancoisCarouge Date: Sun, 12 Jan 2025 21:31:42 -0800 Subject: [PATCH] [linalg] avoid auto and deduce type --- include/fcarouge/utility.hpp | 8 ++++---- test/kalman_f_5x4x3.cpp | 1 - test/linalg_zero.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/fcarouge/utility.hpp b/include/fcarouge/utility.hpp index 256d8e209..9ac93a4e9 100644 --- a/include/fcarouge/utility.hpp +++ b/include/fcarouge/utility.hpp @@ -253,11 +253,11 @@ inline constexpr Arithmetic identity{1}; template requires requires { Type::Identity(); } -inline auto identity{Type::Identity()}; +inline Type identity{Type::Identity()}; template requires requires { Type::identity(); } -inline auto identity{Type::identity()}; +inline Type identity{Type::identity()}; //! @brief The zero matrix. //! @@ -272,11 +272,11 @@ inline constexpr Arithmetic zero{0}; template requires requires { Type::Zero(); } -inline auto zero{Type::Zero()}; +inline Type zero{Type::Zero()}; template requires requires { Type::zero(); } -inline auto zero{Type::zero()}; +inline Type zero{Type::zero()}; //! @} diff --git a/test/kalman_f_5x4x3.cpp b/test/kalman_f_5x4x3.cpp index a6131b258..d6e807d83 100644 --- a/test/kalman_f_5x4x3.cpp +++ b/test/kalman_f_5x4x3.cpp @@ -51,7 +51,6 @@ template using matrix = matrix; [[maybe_unused]] auto test{[] { const auto i5x5{identity>}; const auto z5x5{zero>}; - const vector<3> z3{zero>}; kalman filter{state{vector<5>{0., 0., 0., 0., 0.}}, output>, input>, update_types, prediction_types}; diff --git a/test/linalg_zero.cpp b/test/linalg_zero.cpp index a59509a50..affe7550d 100644 --- a/test/linalg_zero.cpp +++ b/test/linalg_zero.cpp @@ -44,7 +44,7 @@ namespace fcarouge::test { namespace { //! @test Verifies the zero matrices values are null. [[maybe_unused]] auto test{[] { - auto z{zero>}; + matrix z{zero>}; assert(z(0, 0) == 0.0); assert(z(0, 1) == 0.0);