1#ifndef STAN_MATH_OPENCL_PRIM_BINOMIAL_LOGIT_LPMF_HPP 
    2#define STAN_MATH_OPENCL_PRIM_BINOMIAL_LOGIT_LPMF_HPP 
   29template <
bool propto, 
typename T_n_cl, 
typename T_N_cl, 
typename T_prob_cl,
 
   31                                                      T_prob_cl>* = 
nullptr,
 
   33              T_n_cl, T_N_cl, T_prob_cl>* = 
nullptr>
 
   36                                                    const T_prob_cl& alpha) {
 
   37  static constexpr const char* function = 
"binomial_logit_lpmf(OpenCL)";
 
   42                         "Population size parameter", N,
 
   43                         "Probability parameter", alpha);
 
   44  const size_t siz = 
max_size(n, N, alpha);
 
   53  const auto& alpha_val = 
value_of(alpha_col);
 
   56      = 
check_cl(function, 
"Successes variable", n, 
"in the interval [0, N]");
 
   57  auto n_bounded = 0 <= n && n <= N;
 
   58  auto check_N_nonnegative
 
   59      = 
check_cl(function, 
"Population size variable", n, 
"nonnegative");
 
   60  auto N_nonnegative = N >= 0;
 
   61  auto check_alpha_finite
 
   62      = 
check_cl(function, 
"Probability parameter", alpha_val, 
"finite");
 
   63  auto alpha_finite = 
isfinite(alpha_val);
 
   71      = static_select<include_summand<propto, T_n_cl, T_N_cl>::value>(
 
   78  results(check_n_bounded, check_N_nonnegative, check_alpha_finite, logp_cl,
 
   80      = 
expressions(n_bounded, N_nonnegative, alpha_finite, logp_expr,
 
   81                    calc_if<is_autodiff_v<T_prob_cl>>(alpha_deriv));
 
   85  if constexpr (is_autodiff_v<T_prob_cl>) {
 
   86    partials<0>(ops_partials) = std::move(alpha_deriv_cl);
 
   89  return ops_partials.build(logp);
 
Represents an arithmetic matrix on the OpenCL device.
 
require_any_t< is_nonscalar_prim_or_rev_kernel_expression< std::decay_t< Types > >... > require_any_nonscalar_prim_or_rev_kernel_expression_t
Require any of the types satisfy is_nonscalar_prim_or_rev_kernel_expression.
 
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_multiply(T_a &&a, T_b &&b)
 
isfinite_< as_operation_cl_t< T > > isfinite(T &&a)
 
auto check_cl(const char *function, const char *var_name, T &&y, const char *must_be)
Constructs a check on opencl matrix or expression.
 
results_cl< T_results... > results(T_results &&... results)
Deduces types for constructing results_cl object.
 
binomial_coefficient_log_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > binomial_coefficient_log(T1 &&a, T2 &&b)
 
auto as_column_vector_or_scalar(T &&a)
as_column_vector_or_scalar of a kernel generator expression.
 
calc_if_< true, as_operation_cl_t< T > > calc_if(T &&a)
 
expressions_cl< T_expressions... > expressions(T_expressions &&... expressions)
Deduces types for constructing expressions_cl object.
 
return_type_t< T_prob_cl > binomial_logit_lpmf(const T_n_cl &n, const T_N_cl N, const T_prob_cl &alpha)
Binomial log PMF in logit parametrization.
 
auto from_matrix_cl(const T &src)
Copies the source matrix that is stored on the OpenCL device to the destination Eigen matrix.
 
require_all_t< is_prim_or_rev_kernel_expression< std::decay_t< Types > >... > require_all_prim_or_rev_kernel_expression_t
Require type satisfies is_prim_or_rev_kernel_expression.
 
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
 
T value_of(const fvar< T > &v)
Return the value of the specified variable.
 
fvar< T > log_inv_logit(const fvar< T > &x)
 
void check_consistent_sizes(const char *)
Trivial no input case, this function is a no-op.
 
auto sum(const std::vector< T > &m)
Return the sum of the entries of the specified standard vector.
 
int64_t max_size(const T1 &x1, const Ts &... xs)
Calculate the size of the largest input.
 
fvar< T > log1m_inv_logit(const fvar< T > &x)
Return the natural logarithm of one minus the inverse logit of the specified argument.
 
auto make_partials_propagator(Ops &&... ops)
Construct an partials_propagator.
 
fvar< T > exp(const fvar< T > &x)
 
typename partials_return_type< Args... >::type partials_return_t
 
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
 
Template metaprogram to calculate whether a summand needs to be included in a proportional (log) prob...