diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index bda7e6db7..8ac6873ed 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -41,15 +41,12 @@ jobs: --suppress=missingIncludeSystem \ --suppress=preprocessorErrorDirective \ --suppress=unusedFunction:include/fcarouge/format.hpp \ - --suppress=syntaxError: test/units_kf_6x2x0_vehicle_location.cpp \ --verbose \ -I benchmark/include \ -I include \ -I support/eigen \ -I support/generator \ - -I support/indexed \ -I support/lazy \ -I support/mp_units \ -I support/naive \ - -I support/quantity \ . diff --git a/include/fcarouge/internal/x_z_p_q_r_h_f.hpp b/include/fcarouge/internal/x_z_p_q_r_h_f.hpp index 9643f9b45..08cc41e51 100644 --- a/include/fcarouge/internal/x_z_p_q_r_h_f.hpp +++ b/include/fcarouge/internal/x_z_p_q_r_h_f.hpp @@ -50,8 +50,6 @@ template struct x_z_p_q_r_h_f { using output_uncertainty = ᴀʙᵀ; using state_transition = ᴀʙᵀ; using output_model = ᴀʙᵀ; - - //! @todo Fix me: this gain type is incorrect for physical arithmetic types. using gain = ᴀʙᵀ; using innovation = output; using innovation_uncertainty = output_uncertainty; diff --git a/include/fcarouge/kalman.hpp b/include/fcarouge/kalman.hpp index 5a11cab50..625bd42c2 100644 --- a/include/fcarouge/kalman.hpp +++ b/include/fcarouge/kalman.hpp @@ -231,11 +231,6 @@ class kalman : public internal::conditional_member_types { //! @note Overloading the operator dot would have been nice had it existed. inline constexpr auto &&x(this auto &&self); - template inline constexpr auto x(this auto &&self) { - return std::forward(self) - .filter.x.template operator()(); - } - //! @brief Sets the state estimate column vector X. //! //! @param value The first copied initializer used to set the state estimate diff --git a/include/fcarouge/utility.hpp b/include/fcarouge/utility.hpp index 7dc7dab8f..ea4f2991b 100644 --- a/include/fcarouge/utility.hpp +++ b/include/fcarouge/utility.hpp @@ -159,10 +159,6 @@ template struct evaluater { [[nodiscard]] inline constexpr auto operator()() const -> Type; }; -// template struct evaluater { -// [[nodiscard]] inline constexpr auto operator()() const -> Arithmetic; -// }; - //! @brief Evaluater helper type. template using evaluate = std::invoke_result_t>; diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt index 4e3ab7d87..7b270c7ec 100644 --- a/support/CMakeLists.txt +++ b/support/CMakeLists.txt @@ -37,11 +37,9 @@ OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to ]] add_subdirectory("eigen") -add_subdirectory("indexed") add_subdirectory("main") add_subdirectory("mp_units") add_subdirectory("naive") -add_subdirectory("quantity") add_library(kalman_options INTERFACE) diff --git a/support/indexed/CMakeLists.txt b/support/indexed/CMakeLists.txt deleted file mode 100644 index 166d19a46..000000000 --- a/support/indexed/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -#[[ __ _ __ __ _ _ -| |/ / /\ | | | \/ | /\ | \ | | -| ' / / \ | | | \ / | / \ | \| | -| < / /\ \ | | | |\/| | / /\ \ | . ` | -| . \ / ____ \| |____| | | |/ ____ \| |\ | -|_|\_\/_/ \_\______|_| |_/_/ \_\_| \_| - -Kalman Filter -Version 0.4.0 -https://github.com/FrancoisCarouge/Kalman - -SPDX-License-Identifier: Unlicense - -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -For more information, please refer to ]] - -add_library(kalman_linalg_indexed INTERFACE) -target_sources( - kalman_linalg_indexed INTERFACE FILE_SET "unit_headers" TYPE "HEADERS" FILES - "fcarouge/indexed_linalg.hpp") -target_link_libraries(kalman_linalg_indexed INTERFACE kalman) diff --git a/support/indexed/fcarouge/indexed_linalg.hpp b/support/indexed/fcarouge/indexed_linalg.hpp deleted file mode 100644 index 266a1cf48..000000000 --- a/support/indexed/fcarouge/indexed_linalg.hpp +++ /dev/null @@ -1,414 +0,0 @@ -/* __ _ __ __ _ _ -| |/ / /\ | | | \/ | /\ | \ | | -| ' / / \ | | | \ / | / \ | \| | -| < / /\ \ | | | |\/| | / /\ \ | . ` | -| . \ / ____ \| |____| | | |/ ____ \| |\ | -|_|\_\/_/ \_\______|_| |_/_/ \_\_| \_| - -Kalman Filter -Version 0.4.0 -https://github.com/FrancoisCarouge/Kalman - -SPDX-License-Identifier: Unlicense - -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -For more information, please refer to */ - -#ifndef FCAROUGE_INDEXED_LINALG_HPP -#define FCAROUGE_INDEXED_LINALG_HPP - -//! @file -//! @brief Index typed linear algebra implementation. -//! -//! @details Matrix, vectors, and named algebraic values. - -#include "fcarouge/utility.hpp" - -#include -#include -#include -#include -#include - -namespace fcarouge { - -//! @todo Provide a conformance concept for the index types? -template -using index_t = typename std::tuple_element_t::type; - -template -using element_t = - product, index_t>; - -//! @name Algebraic Types -//! @{ - -//! @brief Indexed matrix. -//! -//! @details Compose a matrix into a indexed matrix. Supports type safety. Unit -//! safety. Row and column indexes provide each index type. -//! -//! @tparam Matrix The underlying linear algebra matrix. -//! @tparam RowIndexes The packed types of the row indexes. -//! @tparam ColumnIndexes The packed types of the column indexes. -//! -//! @todo Explore various types of indexes: arithmetic, units, frames, etc... -template -class indexed_matrix { -public: - inline constexpr indexed_matrix() = default; - - inline constexpr indexed_matrix(const indexed_matrix &other) = default; - - inline constexpr indexed_matrix & - operator=(const indexed_matrix &other) = default; - - inline constexpr indexed_matrix(indexed_matrix &&other) = default; - - inline constexpr indexed_matrix &operator=(indexed_matrix &&other) = default; - - //! @todo Is this function safe? Correct? - //! @todo Add other move assignement function? - template - inline constexpr indexed_matrix & - operator=(const indexed_matrix &other) { - data = other.data; - return *this; - } - - //!@todo Is this function safe? Correct? - // template - explicit inline constexpr indexed_matrix(const Matrix &other) : data{other} {} - - //! @todo Can the tuple packing be avoided altogether? - explicit inline constexpr indexed_matrix(const auto &...elements) - requires(std::tuple_size_v == 1 && - sizeof...(elements) == std::tuple_size_v) - { - std::tuple element_pack{elements...}; - for_constexpr<0, std::tuple_size_v, 1>( - [this, &element_pack](auto position) { - data[position] = std::tuple_element_t::convert( - std::get(element_pack)); - }); - } - - //! @todo Can the tuple packing be avoided altogether? - explicit inline constexpr indexed_matrix(const auto &...elements) - requires(std::tuple_size_v == 1 && - std::tuple_size_v != 1 && - sizeof...(elements) == std::tuple_size_v) - { - std::tuple element_pack{elements...}; - for_constexpr<0, std::tuple_size_v, 1>([this, &element_pack]( - auto position) { - data[position] = std::tuple_element_t::convert( - std::get(element_pack)); - }); - } - - //! @todo Fix the conversion index, perhaps with constexpr loop, and size - //! verification? - template - inline constexpr explicit indexed_matrix( - std::initializer_list> rows) { - for (std::size_t i{0}; const auto &row : rows) { - for (std::size_t j{0}; const auto &element : row) { - data(i, j) = std::tuple_element_t<0, ColumnIndexes>::convert(element); - ++j; - } - ++i; - } - } - - //! @todo Is this function safe? Correct? - template - requires requires(Type value) { value.data; } - explicit inline constexpr indexed_matrix(const Type &other) - : data{other.data} {} - - template - inline constexpr auto operator()() - requires(std::tuple_size_v != 1 && - std::tuple_size_v == 1) - { - using type = element_t; - - return data(Index, 0) * identity; - } - - // Proxy reference in support of indexed type conversion to and from - // underlying scalar. - template struct reference { - Type &value; - - //! @todo Fix the conversion indexes? - inline constexpr double operator=(const auto &element) { - value = std::tuple_element_t<0, RowIndexes>::convert(element); - return 0.; - } - }; - - inline constexpr auto operator[](std::size_t i) - requires(std::tuple_size_v != 1 && - std::tuple_size_v == 1) - { - return reference{data(i, 0)}; - } - - inline constexpr auto operator[](std::size_t i, std::size_t j) - requires(std::tuple_size_v != 1 && - std::tuple_size_v != 1) - { - return reference{data(i, j)}; - } - - template - [[nodiscard]] inline constexpr auto operator[]() const { - using type = element_t; - - return data(Index, 0) * identity; - } - - Matrix data; -}; - -struct placeholder_index { - using type = int; -}; - -using one_row = std::tuple; -using one_column = std::tuple; - -//! @brief Column vector. -template -using indexed_column_vector = - indexed_matrix, one_column>; - -//! @brief Row vector. -template -using indexed_row_vector = - indexed_matrix>; - -//! @brief Specialization of the evaluation type. -//! -//! @note Implementation not needed. -template