7 #ifndef SSMPACK_PROCESS_HIERARCHICAL_HPP
8 #define SSMPACK_PROCESS_HIERARCHICAL_HPP
30 template <
class... Args>
33 static_assert(AreProcesses<Args...>::value,
"");
37 using TArities = std::tuple<typename ProcessTraits<Args>::TArity...>;
39 static constexpr
size_t depth =
sizeof...(Args)-1;
46 using TRandomVAR = std::tuple<typename ProcessTraits<Args>::TRandomVAR...>;
50 std::tuple<Args...> processes_;
66 Hierarchical(Args... processes) : processes_{std::move(processes)...} {}
74 detail::GetInitialized<depth>::apply(rvs, processes_);
89 template <
class... TVARs>
98 constexpr
size_t arity = std::tuple_element<0, TArities>::type::value;
99 detail::GetRandom<0, arity, depth, TArities>::apply(
100 std::make_index_sequence<arity>(), rvs, processes_,
101 std::make_tuple(args...));
119 template <
class... TArgs>
122 constexpr
size_t arity = std::tuple_element<0, TArities>::type::value;
123 detail::GetLikelihood<0, arity, depth, TArities>::apply(
124 tao::seq::make_index_range<0, arity>(), lik, rvs, processes_,
125 std::make_tuple(args...));
139 typename std::tuple_element<L, std::tuple<Args...>>::type &
150 template <
class... TArgs>
158 #endif // SSMPACK_PROCESS_HIERARCHICAL_HPP
A stochastic process constructed as hierarchy of stochastic processes.
TRandomVAR initialize()
Initialize process.
TRandomVAR random(const TVARs &...args)
Sample random variable.
std::tuple_element< L, std::tuple< Args...> >::type & getProcess()
get a reference to the process at level L
Hierarchical(Args...processes)
Constructor.
std::tuple< typename ProcessTraits< Args >::TRandomVAR...> TRandomVAR
Type of the random variable.
Hierarchical< TArgs...> makeHierarchical(TArgs...args)
A convenient builder for Hierarchical process.
double likelihood(const TRandomVAR &rvs, const TArgs &...args)
Calculate likelihood.