Skip to content

Commit

Permalink
[algorithms] initial algorithms implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoisCarouge committed Jan 10, 2023
1 parent 20f9538 commit 5c5f248
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 323 deletions.
5 changes: 3 additions & 2 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ target_sources(
FILES
"fcarouge/internal/detail.hpp"
"fcarouge/internal/format.hpp"
"fcarouge/internal/kalman.hpp"
"fcarouge/internal/filter.hpp"
"fcarouge/internal/utility.hpp"
"fcarouge/algorithm.hpp"
"fcarouge/filter.hpp"
"fcarouge/kalman.hpp")
"fcarouge/kalman.hpp"
"fcarouge/utility.hpp")
target_compile_options(kalman INTERFACE ${OPTIONS})
target_compile_features(kalman INTERFACE cxx_std_23)
target_link_libraries(
Expand Down
18 changes: 16 additions & 2 deletions include/fcarouge/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,21 @@ For more information, please refer to <https://unlicense.org> */
//! @brief The collection of Kalman algorithms.
//!
//! @details Definitions and documentation.
//!
//! @todo Implement and test.

namespace fcarouge {

inline constexpr void update(const auto &h, auto &&p, const auto &r, auto &&x,
const auto &z);
// {
// auto y{z - h * x};
// auto s{h * p * h + r};
// auto k{p * h / s};
// x += k * y;
// p *= 1 - k * h;
// }

inline constexpr void predict(const auto &f, auto &&p, const auto &q, auto &&x);

} // namespace fcarouge

#endif // FCAROUGE_ALGORITHM_HPP
11 changes: 2 additions & 9 deletions include/fcarouge/filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ For more information, please refer to <https://unlicense.org> */
//!
//! @details Definitions and documentation.

#include "internal/format.hpp"
#include "internal/kalman.hpp"
#include "internal/utility.hpp"
#include "internal/filter.hpp"
#include "utility.hpp"

#include <concepts>
#include <cstddef>
Expand All @@ -56,12 +55,6 @@ For more information, please refer to <https://unlicense.org> */

namespace fcarouge {

//! @brief Convenience tuple-like empty pack type.
using empty_pack = internal::empty_pack;

//! @brief Convenience tuple-like pack type.
template <typename... Types> using pack = internal::pack<Types...>;

//! @brief A generic Kalman filter for C++23.
//!
//! @details The Kalman filter is a Bayesian filter that uses multivariate
Expand Down
2 changes: 2 additions & 0 deletions include/fcarouge/internal/detail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ For more information, please refer to <https://unlicense.org> */

#include "fcarouge/filter.hpp"

#include "format.hpp"

namespace fcarouge {

template <typename State, typename Output, typename Input, typename Divide,
Expand Down
6 changes: 1 addition & 5 deletions include/fcarouge/internal/format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,12 @@ For more information, please refer to <https://unlicense.org> */
#ifndef FCAROUGE_INTERNAL_FORMAT_HPP
#define FCAROUGE_INTERNAL_FORMAT_HPP

#include "fcarouge/filter.hpp"
#include "utility.hpp"

#include <cstddef>
#include <format>

namespace fcarouge {
template <typename, typename, typename, typename, typename, typename>
class kalman;
} // namespace fcarouge

template <typename State, typename Output, typename Input, typename Divide,
typename UpdateTypes, typename PredictionTypes, typename Char>
// It is allowed to add template specializations for any standard library class
Expand Down
305 changes: 0 additions & 305 deletions include/fcarouge/internal/kalman.hpp

This file was deleted.

Loading

0 comments on commit 5c5f248

Please sign in to comment.