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 (collections::uniformly_gettable<T> and ... and collections::uniformly_gettable<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 (collections::uniformly_gettable<T> and ... and collections::uniformly_gettable<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...);
90 return static_cast<const Derived&
>(*this).transform_with_cross_covariance(x, args...);
constexpr bool uniformly_gettable
T is a fixed-size object that is gettable for all indices.
Definition: uniformly_gettable.hpp:55
decltype(auto) constexpr apply(F &&f, T &&t)
A generalization of std::apply.
Definition: apply.hpp:49
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