Skip to content

Commit

Permalink
[eigen] extend support for 1x1xN filters (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoisCarouge authored Jul 8, 2022
1 parent 97ebd23 commit 4ee77d3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
22 changes: 22 additions & 0 deletions include/fcarouge/internal/kalman_eigen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ struct transpose {

return result_type{ value.transpose() };
}

//! @brief Returns the transpose of `value`.
//!
//! @param value Value to compute the transpose of.
//!
//! @todo Can this be optimized?
[[nodiscard]] inline constexpr auto
operator()(const arithmetic auto &value) const
{
return value;
}
};

//! @brief Function object for performing Eigen matrix symmetrization.
Expand All @@ -97,6 +108,17 @@ struct symmetrize {

return result_type{ (value + value.transpose()) / 2 };
}

//! @brief Returns the symmetrized `value`.
//!
//! @param value Value to compute the symmetry of.
//!
//! @todo Can this be optimized?
[[nodiscard]] inline constexpr auto
operator()(const arithmetic auto &value) const
{
return value;
}
};

//! @brief Function object for performing Eigen matrix division.
Expand Down
6 changes: 4 additions & 2 deletions include/fcarouge/kalman.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,10 @@ class kalman<Type, State, Output, Input, Transpose, Symmetrize, Divide,
//! @details Predicts and updates the estimates per prediction arguments,
//! control input, and measurement output.
//!
//! @param arguments Optional prediction parameters passed through for
//! computations of prediction matrices.
//! @param prediction_arguments Optional prediction parameters passed through
//! for computations of prediction matrices.
//! @param update_arguments Optional update parameters passed through for
//! computations of update matrices.
//! @param input_u Optional control parameters. Types must be compatible with
//! the `Input` types. The parameter pack types must always be explicitly
//! defined per the
Expand Down

0 comments on commit 4ee77d3

Please sign in to comment.