17 #ifndef OPENKALMAN_TRANSFORMBASE_HPP 18 #define OPENKALMAN_TRANSFORMBASE_HPP 29 template<
typename Derived>
33 template<
typename Derived>
48 template<
typename InputDist,
typename T,
typename...Ts, std::enable_if_t<
49 distribution<InputDist> and (tuple_like<T> and ... and tuple_like<Ts>),
int> = 0>
51 auto operator()(
const InputDist& x,
const T& t,
const Ts&...ts)
const 53 auto y = std::apply([&](
const auto&...args) {
return static_cast<const Derived&
>(*this)(x, args...); }, t);
55 if constexpr (
sizeof...(Ts) > 0)
57 return static_cast<const Derived&
>(*this)(y, ts...);
77 template<
typename InputDist,
typename T,
typename...Ts, std::enable_if_t<
78 distribution<InputDist> and (tuple_like<T> and ... and tuple_like<Ts>),
int> = 0>
82 if constexpr (
sizeof...(Ts) > 0)
84 auto y = std::apply([&](
const auto&...args) {
return static_cast<const Derived&
>(*this)(x, args...); }, t);
85 return static_cast<const Derived&
>(*this).transform_with_cross_covariance(y, ts...);
89 return std::apply([&](
const auto&...args) {
90 return static_cast<const Derived&
>(*this).transform_with_cross_covariance(x, args...);
99 #endif //OPENKALMAN_TRANSFORMBASE_HPP Definition for collections::tuple_like.
constexpr bool distribution
T is a statistical distribution of any kind that is defined in OpenKalman.
Definition: object-types.hpp:193
Definition: basics.hpp:48
constexpr bool tuple_like
T is a non-empty tuple, pair, array, or other type that acts like a tuple.
Definition: tuple_like.hpp:51