Stan Math Library  2.20.0
reverse mode automatic differentiation
categorical_log.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_PROB_CATEGORICAL_LOG_HPP
2 #define STAN_MATH_PRIM_MAT_PROB_CATEGORICAL_LOG_HPP
3 
7 #include <boost/math/tools/promotion.hpp>
8 #include <vector>
9 
10 namespace stan {
11 namespace math {
12 
16 template <bool propto, typename T_prob>
17 typename boost::math::tools::promote_args<T_prob>::type categorical_log(
18  int n, const Eigen::Matrix<T_prob, Eigen::Dynamic, 1>& theta) {
19  return categorical_lpmf<propto, T_prob>(n, theta);
20 }
21 
25 template <typename T_prob>
26 typename boost::math::tools::promote_args<T_prob>::type categorical_log(
28  const Eigen::Matrix<T_prob, Eigen::Dynamic, 1>& theta) {
29  return categorical_lpmf<T_prob>(n, theta);
30 }
31 
35 template <bool propto, typename T_prob>
36 typename boost::math::tools::promote_args<T_prob>::type categorical_log(
37  const std::vector<int>& ns,
38  const Eigen::Matrix<T_prob, Eigen::Dynamic, 1>& theta) {
39  return categorical_lpmf<propto, T_prob>(ns, theta);
40 }
41 
45 template <typename T_prob>
46 inline typename boost::math::tools::promote_args<T_prob>::type categorical_log(
47  const std::vector<int>& ns,
48  const Eigen::Matrix<T_prob, Eigen::Dynamic, 1>& theta) {
49  return categorical_lpmf<false>(ns, theta);
50 }
51 
52 } // namespace math
53 } // namespace stan
54 #endif
Primary template class for the metaprogram to compute the index type of a container.
Definition: index_type.hpp:18
boost::math::tools::promote_args< T_prob >::type categorical_log(int n, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)

     [ Stan Home Page ] © 2011–2018, Stan Development Team.