From 2b2f35cdcc6a7628e837254acbf0ee93fbb466e3 Mon Sep 17 00:00:00 2001 From: Francois Carouge Date: Sun, 10 Jul 2022 19:08:46 -0700 Subject: [PATCH] [format] add standard format support --- .clang-tidy | 1 + .../deploy_test_coverage_coveralls.yml | 25 ++-- .../verify_code_static_analysis_tidy.yml | 24 ++-- .../workflows/verify_test_memory_valgrind.yml | 25 ++-- .../verify_test_sanitizer_address.yml | 25 ++-- .../workflows/verify_test_sanitizer_leak.yml | 25 ++-- .../verify_test_sanitizer_thread.yml | 25 ++-- ...rify_test_sanitizer_undefined_behavior.yml | 25 ++-- .../verify_test_ubuntu-22-04_clang-trunk.yml | 26 ++-- .../verify_test_ubuntu-22-04_gcc-trunk.yml | 26 ++-- README.md | 12 ++ include/fcarouge/internal/format.hpp | 41 ++++++ include/fcarouge/kalman.hpp | 2 +- support/include/fcarouge/format | 119 ++++++++++++++++++ test/format.cpp | 64 ++++++++++ 15 files changed, 401 insertions(+), 64 deletions(-) create mode 100644 support/include/fcarouge/format create mode 100644 test/format.cpp diff --git a/.clang-tidy b/.clang-tidy index 824a3f5ac..40b910b0f 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,6 +2,7 @@ Checks: '*, -altera-struct-pack-align, -fuchsia-overloaded-operator, -fuchsia-trailing-return, + -llvmlibc-callee-namespace, -llvmlibc-implementation-in-namespace, -llvmlibc-restrict-system-libc-headers, -portability-simd-intrinsics, diff --git a/.github/workflows/deploy_test_coverage_coveralls.yml b/.github/workflows/deploy_test_coverage_coveralls.yml index 82b4ae515..7d6e186f5 100644 --- a/.github/workflows/deploy_test_coverage_coveralls.yml +++ b/.github/workflows/deploy_test_coverage_coveralls.yml @@ -17,16 +17,27 @@ jobs: - name: Install run: | sudo apt install gcc-11 g++-11 lcov - ( cd /tmp ; mkdir eigen ; + ( cd /tmp ; git clone --depth 1 https://gitlab.com/libeigen/eigen.git ; ( cd eigen ; - mkdir build ) ; - ( cd eigen/build ; - cmake .. ; - cmake --build . ; - sudo make install ) ) + mkdir build ; + ( cd build ; + cmake .. ; + cmake --build . ; + sudo make install ; ) ) ) + ( cd /tmp ; + git clone --depth 1 https://github.com/fmtlib/fmt.git ; + ( cd fmt ; + mkdir build ; + ( cd build ; + cmake .. ; + sudo make install ; ) ) ) - name: Build - run: gcc-11 sample/*.cpp source/*.cpp test/*.cpp -Iinclude -I/usr/local/include/eigen3 -O0 -g -std=c++23 -fmodules-ts --coverage -fno-inline -lstdc++ -lm + run: | + gcc-11 \ + sample/*.cpp source/*.cpp test/*.cpp \ + -Iinclude -I/usr/local/include/eigen3 -Isupport/include/fcarouge \ + -O0 -g -std=c++23 -fmodules-ts --coverage -fno-inline -lstdc++ -lm -lfmt - name: "Coverage: Base" run: | lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-11 --capture --initial --directory . --output-file base.info diff --git a/.github/workflows/verify_code_static_analysis_tidy.yml b/.github/workflows/verify_code_static_analysis_tidy.yml index 1205ab477..7c763e151 100644 --- a/.github/workflows/verify_code_static_analysis_tidy.yml +++ b/.github/workflows/verify_code_static_analysis_tidy.yml @@ -17,17 +17,27 @@ jobs: - name: Install run: | sudo apt install clang-tidy-14 - ( cd /tmp ; mkdir eigen ; + ( cd /tmp ; git clone --depth 1 https://gitlab.com/libeigen/eigen.git ; ( cd eigen ; - mkdir build ) ; - ( cd eigen/build ; - cmake .. ; - cmake --build . ; - sudo make install ) ) + mkdir build ; + ( cd build ; + cmake .. ; + cmake --build . ; + sudo make install ; ) ) ) + ( cd /tmp ; + git clone --depth 1 https://github.com/fmtlib/fmt.git ; + ( cd fmt ; + mkdir build ; + ( cd build ; + CXX=clang++-14 cmake -DFMT_HEADER_ONLY=TRUE .. ; + sudo make install ; ) ) ) - name: Tidy run: | FILES=`find . -iname *.hpp` clang-tidy-14 ${FILES} \ --warnings-as-errors=* \ - -- -x c++ -Wall -Wextra -pedantic -std=c++2b -Iinclude -I/usr/local/include/eigen3 + -- -x c++ \ + -Iinclude -I/usr/local/include/eigen3 -Isupport/include/fcarouge \ + -DFMT_HEADER_ONLY \ + -Wall -Wextra -pedantic -std=c++2b -stdlib=libc++ -lfmt diff --git a/.github/workflows/verify_test_memory_valgrind.yml b/.github/workflows/verify_test_memory_valgrind.yml index 799a3979b..64e65c8ab 100644 --- a/.github/workflows/verify_test_memory_valgrind.yml +++ b/.github/workflows/verify_test_memory_valgrind.yml @@ -17,15 +17,26 @@ jobs: - name: Install run: | sudo apt install gcc-11 g++-11 valgrind - ( cd /tmp ; mkdir eigen ; + ( cd /tmp ; git clone --depth 1 https://gitlab.com/libeigen/eigen.git ; ( cd eigen ; - mkdir build ) ; - ( cd eigen/build ; - cmake .. ; - cmake --build . ; - sudo make install ) ) + mkdir build ; + ( cd build ; + cmake .. ; + cmake --build . ; + sudo make install ; ) ) ) + ( cd /tmp ; + git clone --depth 1 https://github.com/fmtlib/fmt.git ; + ( cd fmt ; + mkdir build ; + ( cd build ; + cmake .. ; + sudo make install ; ) ) ) - name: Build - run: gcc-11 sample/*.cpp test/*.cpp source/*.cpp -Iinclude -I/usr/local/include/eigen3 -g -O0 -std=c++23 -lstdc++ -lm + run: | + gcc-11 \ + sample/*.cpp test/*.cpp source/*.cpp \ + -Iinclude -I/usr/local/include/eigen3 -Isupport/include/fcarouge \ + -g -O0 -std=c++23 -lstdc++ -lm -lfmt - name: Test run: valgrind --verbose ./a.out diff --git a/.github/workflows/verify_test_sanitizer_address.yml b/.github/workflows/verify_test_sanitizer_address.yml index 85a9ef890..b6d001a7d 100644 --- a/.github/workflows/verify_test_sanitizer_address.yml +++ b/.github/workflows/verify_test_sanitizer_address.yml @@ -17,15 +17,26 @@ jobs: - name: Install run: | sudo apt install gcc-11 g++-11 - ( cd /tmp ; mkdir eigen ; + ( cd /tmp ; git clone --depth 1 https://gitlab.com/libeigen/eigen.git ; ( cd eigen ; - mkdir build ) ; - ( cd eigen/build ; - cmake .. ; - cmake --build . ; - sudo make install ) ) + mkdir build ; + ( cd build ; + cmake .. ; + cmake --build . ; + sudo make install ; ) ) ) + ( cd /tmp ; + git clone --depth 1 https://github.com/fmtlib/fmt.git ; + ( cd fmt ; + mkdir build ; + ( cd build ; + cmake .. ; + sudo make install ; ) ) ) - name: Build - run: gcc-11 sample/*.cpp test/*.cpp source/*.cpp -Iinclude -I/usr/local/include/eigen3 -std=c++23 -g -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer -lstdc++ -lm + run: | + gcc-11 \ + sample/*.cpp test/*.cpp source/*.cpp \ + -Iinclude -I/usr/local/include/eigen3 -Isupport/include/fcarouge \ + -std=c++23 -g -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer -lstdc++ -lm -lfmt - name: Test run: ASAN_OPTIONS=verbosity=2:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1 ./a.out diff --git a/.github/workflows/verify_test_sanitizer_leak.yml b/.github/workflows/verify_test_sanitizer_leak.yml index a0549e58d..ad081b6c9 100644 --- a/.github/workflows/verify_test_sanitizer_leak.yml +++ b/.github/workflows/verify_test_sanitizer_leak.yml @@ -17,15 +17,26 @@ jobs: - name: Install run: | sudo apt install gcc-11 g++-11 - ( cd /tmp ; mkdir eigen ; + ( cd /tmp ; git clone --depth 1 https://gitlab.com/libeigen/eigen.git ; ( cd eigen ; - mkdir build ) ; - ( cd eigen/build ; - cmake .. ; - cmake --build . ; - sudo make install ) ) + mkdir build ; + ( cd build ; + cmake .. ; + cmake --build . ; + sudo make install ; ) ) ) + ( cd /tmp ; + git clone --depth 1 https://github.com/fmtlib/fmt.git ; + ( cd fmt ; + mkdir build ; + ( cd build ; + cmake .. ; + sudo make install ; ) ) ) - name: Build - run: gcc-11 sample/*.cpp test/*.cpp source/*.cpp -Iinclude -I/usr/local/include/eigen3 -std=c++23 -g -fsanitize=leak -lstdc++ -lm + run: | + gcc-11 \ + sample/*.cpp test/*.cpp source/*.cpp \ + -Iinclude -I/usr/local/include/eigen3 -Isupport/include/fcarouge \ + -std=c++23 -g -fsanitize=leak -lstdc++ -lm -lfmt - name: Test run: LSAN_OPTIONS=verbosity=2 ./a.out diff --git a/.github/workflows/verify_test_sanitizer_thread.yml b/.github/workflows/verify_test_sanitizer_thread.yml index 62d5de9b9..1593838dc 100644 --- a/.github/workflows/verify_test_sanitizer_thread.yml +++ b/.github/workflows/verify_test_sanitizer_thread.yml @@ -17,15 +17,26 @@ jobs: - name: Install run: | sudo apt install gcc-11 g++-11 - ( cd /tmp ; mkdir eigen ; + ( cd /tmp ; git clone --depth 1 https://gitlab.com/libeigen/eigen.git ; ( cd eigen ; - mkdir build ) ; - ( cd eigen/build ; - cmake .. ; - cmake --build . ; - sudo make install ) ) + mkdir build ; + ( cd build ; + cmake .. ; + cmake --build . ; + sudo make install ; ) ) ) + ( cd /tmp ; + git clone --depth 1 https://github.com/fmtlib/fmt.git ; + ( cd fmt ; + mkdir build ; + ( cd build ; + cmake .. ; + sudo make install ; ) ) ) - name: Build - run: gcc-11 sample/*.cpp test/*.cpp source/*.cpp -Iinclude -I/usr/local/include/eigen3 -std=c++23 -g -fsanitize=thread -lstdc++ -lm + run: | + gcc-11 \ + sample/*.cpp test/*.cpp source/*.cpp \ + -Iinclude -I/usr/local/include/eigen3 -Isupport/include/fcarouge \ + -std=c++23 -g -fsanitize=thread -lstdc++ -lm -lfmt - name: Test run: TSAN_OPTIONS=verbosity=2 ./a.out diff --git a/.github/workflows/verify_test_sanitizer_undefined_behavior.yml b/.github/workflows/verify_test_sanitizer_undefined_behavior.yml index 378ee8a4e..430b9e635 100644 --- a/.github/workflows/verify_test_sanitizer_undefined_behavior.yml +++ b/.github/workflows/verify_test_sanitizer_undefined_behavior.yml @@ -17,15 +17,26 @@ jobs: - name: Install run: | sudo apt install gcc-11 g++-11 - ( cd /tmp ; mkdir eigen ; + ( cd /tmp ; git clone --depth 1 https://gitlab.com/libeigen/eigen.git ; ( cd eigen ; - mkdir build ) ; - ( cd eigen/build ; - cmake .. ; - cmake --build . ; - sudo make install ) ) + mkdir build ; + ( cd build ; + cmake .. ; + cmake --build . ; + sudo make install ; ) ) ) + ( cd /tmp ; + git clone --depth 1 https://github.com/fmtlib/fmt.git ; + ( cd fmt ; + mkdir build ; + ( cd build ; + cmake .. ; + sudo make install ; ) ) ) - name: Build - run: gcc-11 sample/*.cpp test/*.cpp source/*.cpp -Iinclude -I/usr/local/include/eigen3 -std=c++23 -g -fsanitize=undefined -lstdc++ -lm + run: | + gcc-11 \ + sample/*.cpp test/*.cpp source/*.cpp \ + -Iinclude -I/usr/local/include/eigen3 -Isupport/include/fcarouge \ + -std=c++23 -g -fsanitize=undefined -lstdc++ -lm -lfmt - name: Test run: UBSAN_OPTIONS=verbosity=2 ./a.out diff --git a/.github/workflows/verify_test_ubuntu-22-04_clang-trunk.yml b/.github/workflows/verify_test_ubuntu-22-04_clang-trunk.yml index 2c772fdc3..343fa167f 100644 --- a/.github/workflows/verify_test_ubuntu-22-04_clang-trunk.yml +++ b/.github/workflows/verify_test_ubuntu-22-04_clang-trunk.yml @@ -20,15 +20,27 @@ jobs: - name: Install run: | sudo apt install clang-14 lld-14 libc++-14-dev libc++abi-14-dev - ( cd /tmp ; mkdir eigen ; + ( cd /tmp ; git clone --depth 1 https://gitlab.com/libeigen/eigen.git ; ( cd eigen ; - mkdir build ) ; - ( cd eigen/build ; - cmake .. ; - cmake --build . ; - sudo make install ) ) + mkdir build ; + ( cd build ; + cmake .. ; + cmake --build . ; + sudo make install ; ) ) ) + ( cd /tmp ; + git clone --depth 1 https://github.com/fmtlib/fmt.git ; + ( cd fmt ; + mkdir build ; + ( cd build ; + CXX=clang++-14 cmake -DFMT_HEADER_ONLY=TRUE .. ; + sudo make install ; ) ) ) - name: Build - run: clang++-14 sample/*.cpp source/*.cpp test/*.cpp -Iinclude -I/usr/local/include/eigen3 -Wall -Wextra -pedantic -std=c++2b -stdlib=libc++ + run: | + clang++-14 \ + sample/*.cpp source/*.cpp test/*.cpp \ + -Iinclude -I/usr/local/include/eigen3 -Isupport/include/fcarouge \ + -DFMT_HEADER_ONLY \ + -Wall -Wextra -pedantic -std=c++2b -stdlib=libc++ -lfmt - name: Run run: ./a.out diff --git a/.github/workflows/verify_test_ubuntu-22-04_gcc-trunk.yml b/.github/workflows/verify_test_ubuntu-22-04_gcc-trunk.yml index d36d6af49..3e3309621 100644 --- a/.github/workflows/verify_test_ubuntu-22-04_gcc-trunk.yml +++ b/.github/workflows/verify_test_ubuntu-22-04_gcc-trunk.yml @@ -16,15 +16,27 @@ jobs: run: | wget http://kayari.org/gcc-latest/gcc-latest.deb sudo dpkg -i gcc-latest.deb - ( cd /tmp ; mkdir eigen ; + ( cd /tmp ; git clone --depth 1 https://gitlab.com/libeigen/eigen.git ; ( cd eigen ; - mkdir build ) ; - ( cd eigen/build ; - cmake .. ; - cmake --build . ; - sudo make install ) ) + mkdir build ; + ( cd build ; + cmake .. ; + cmake --build . ; + sudo make install ; ) ) ) + ( cd /tmp ; + git clone --depth 1 https://github.com/fmtlib/fmt.git ; + ( cd fmt ; + mkdir build ; + ( cd build ; + cmake .. ; + sudo make install ; ) ) ) - name: Build - run: LD_LIBRARY_PATH=/opt/gcc-latest/lib64 LD_RUN_PATH=/opt/gcc-latest/lib64 /opt/gcc-latest/bin/gcc sample/*.cpp test/*.cpp source/*.cpp -Iinclude -I/usr/local/include/eigen3 -Wall -Wextra -pedantic -std=c++23 -lstdc++ -lm + run: | + LD_LIBRARY_PATH=/opt/gcc-latest/lib64 LD_RUN_PATH=/opt/gcc-latest/lib64 \ + /opt/gcc-latest/bin/gcc \ + sample/*.cpp test/*.cpp source/*.cpp \ + -Iinclude -I/usr/local/include/eigen3 -Isupport/include/fcarouge \ + -Wall -Wextra -pedantic -std=c++23 -lstdc++ -lm -lfmt - name: Run run: ./a.out diff --git a/README.md b/README.md index d85680c1b..48425913e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ The library supports simple and extended filters. The update equation uses the J - [Member Functions](#member-functions) - [Characteristics](#characteristics) - [Modifiers](#modifiers) +- [Format](#format) - [Resources](#resources) - [License](#license) @@ -260,6 +261,17 @@ class kalman | `update` | Updates the estimates with the outcome of a measurement. | | `predict` | Produces estimates of the state variables and uncertainties. | +# Format + +A specialization of the standard formatter is provided for the filter. Use `std::format` to store a formatted representation of all of the characteristics of the filter in a new string. Standard format parameters to be supported. + +```cpp +fcarouge::kalman k; + +std::string message{ std::format("{}", k) }; +// {f:1,h:1,k:1,p:1,q:0,r:0,s:1,x:0,y:0,z:0} +``` + # Resources Awesome resources to learn about Kalman filters: diff --git a/include/fcarouge/internal/format.hpp b/include/fcarouge/internal/format.hpp index 6f9679ce3..a10270da7 100644 --- a/include/fcarouge/internal/format.hpp +++ b/include/fcarouge/internal/format.hpp @@ -39,4 +39,45 @@ For more information, please refer to */ #ifndef FCAROUGE_INTERNAL_FORMAT_HPP #define FCAROUGE_INTERNAL_FORMAT_HPP +#include + +namespace fcarouge +{ +template +class kalman; +} // namespace fcarouge + +template +struct std::formatter< + fcarouge::kalman, + Char> { + //! @todo Support parsing arguments. + constexpr auto parse(std::basic_format_parse_context &parse_context) + { + return parse_context.begin(); + } + + // @todo How to support different nested types? + template + auto format(const fcarouge::kalman &filter, + std::basic_format_context &format_context) + -> OutputIt + { + return format_to( + format_context.out(), + "{{f:{},g:{},h:{},k:{},p:{},q:{},r:{},s:{},u:{},x:{},y:{},z:{}}}", + filter.f(), filter.g(), filter.h(), filter.k(), filter.p(), filter.q(), + filter.r(), filter.s(), filter.u(), filter.x(), filter.y(), filter.z()); + } + + //! @} +}; + #endif // FCAROUGE_INTERNAL_FORMAT_HPP diff --git a/include/fcarouge/kalman.hpp b/include/fcarouge/kalman.hpp index 53f614527..605e7d5d5 100644 --- a/include/fcarouge/kalman.hpp +++ b/include/fcarouge/kalman.hpp @@ -131,7 +131,6 @@ struct identity_matrix { //! @todo Which constructors to support? //! @todo Is the Kalman filter a recursive state estimation, confirm //! terminology? -//! @todo Prepare support for std::format? //! @todo Prepare support for larger dataset recording for graphing, metrics of //! large test data to facilitate tuning. //! @todo Support filter generator? Integration? Reflection in C++... @@ -152,6 +151,7 @@ struct identity_matrix { //! @todo A clear or reset member equivalent may be useful for real-time //! re-initializations but to what default? //! @todo Could the Input be void by default? Or empty? +//! @todo Expand std::format support with standard arguments and Eigen3 types. template < typename State = double, typename Output = State, typename Input = void, typename Transpose = std::identity, typename Symmetrize = std::identity, diff --git a/support/include/fcarouge/format b/support/include/fcarouge/format new file mode 100644 index 000000000..c7b5cac2e --- /dev/null +++ b/support/include/fcarouge/format @@ -0,0 +1,119 @@ +/*_ __ _ __ __ _ _ + | |/ / /\ | | | \/ | /\ | \ | | + | ' / / \ | | | \ / | / \ | \| | + | < / /\ \ | | | |\/| | / /\ \ | . ` | + | . \ / ____ \| |____| | | |/ ____ \| |\ | + |_|\_\/_/ \_\______|_| |_/_/ \_\_| \_| + +Kalman Filter for C++ +Version 0.1.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_FORMAT +#define FCAROUGE_FORMAT + +// Standard formatter compiler support. Some mainstream compilers do not support +// `std::format` as of July 2022. The support is brought in through the `fmt` +// library. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace fcarouge +{ +template +class kalman; +} // namespace fcarouge + +namespace std +{ +template +struct formatter : public fmt::formatter { +}; + +template +using basic_format_context = fmt::basic_format_context; + +template +using basic_format_parse_context = fmt::basic_format_parse_context; + +template +[[nodiscard]] std::string format(std::string_view format, Types &...arguments) +{ + return fmt::vformat(format, fmt::make_format_args(arguments...)); +} + +template +[[nodiscard]] std::wstring format(std::wstring_view format, Types &...arguments) +{ + return fmt::vformat(format, fmt::make_wformat_args(arguments...)); +} + +template +[[nodiscard]] std::string format(const std::locale &locale, + std::string_view format, Types &&...arguments) +{ + return fmt::vformat(locale, format, fmt::make_format_args(arguments...)); +} + +template +[[nodiscard]] std::wstring format(const std::locale &locale, + std::wstring_view format, + Types &&...arguments) +{ + return fmt::vformat(locale, format, fmt::make_wformat_args(arguments...)); +} +} // namespace std + +template +struct fmt::formatter< + fcarouge::kalman, + Char> + : public std::formatter< + fcarouge::kalman, + Char> { +}; + +#endif // FCAROUGE_FORMAT diff --git a/test/format.cpp b/test/format.cpp new file mode 100644 index 000000000..29cbeda55 --- /dev/null +++ b/test/format.cpp @@ -0,0 +1,64 @@ +/*_ __ _ __ __ _ _ + | |/ / /\ | | | \/ | /\ | \ | | + | ' / / \ | | | \ / | / \ | \| | + | < / /\ \ | | | |\/| | / /\ \ | . ` | + | . \ / ____ \| |____| | | |/ ____ \| |\ | + |_|\_\/_/ \_\______|_| |_/_/ \_\_| \_| + +Kalman Filter for C++ +Version 0.1.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 */ + +#include "fcarouge/kalman.hpp" +#include "fcarouge/kalman_eigen.hpp" + +#include +#include +#include + +namespace fcarouge::test +{ +namespace +{ + +//! @test Verifies formatting filters for single-dimension filters with input +//! control. +[[maybe_unused]] auto format111{ [] { + using kalman = fcarouge::kalman; + kalman k; + + assert(std::format("{}", k) == + "{f:1,g:1,h:1,k:1,p:1,q:0,r:0,s:1,u:0,x:0,y:0,z:0}"); + + return 0; +}() }; + +} // namespace +} // namespace fcarouge::test