1#ifndef STAN_MATH_PRIM_FUN_AS_COLUMN_VECTOR_OR_SCALAR_HPP
2#define STAN_MATH_PRIM_FUN_AS_COLUMN_VECTOR_OR_SCALAR_HPP
11template <
typename T,
typename S,
typename Enable>
12class empty_broadcast_array;
21template <
typename T, require_stan_scalar_t<T>* =
nullptr>
31template <
typename T,
typename S>
43template <
typename T, require_eigen_col_vector_t<T>* =
nullptr>
45 return std::forward<T>(a);
57template <
typename T, require_eigen_row_vector_t<T>* =
nullptr,
58 require_not_eigen_col_vector_t<T>* =
nullptr>
60 return make_holder([](
auto& x) {
return x.transpose(); }, std::forward<T>(a));
70template <
typename T, require_std_vector_t<T>* =
nullptr>
72 using plain_vector = Eigen::Matrix<value_type_t<T>, Eigen::Dynamic, 1>;
73 using optionally_const_vector
74 = std::conditional_t<std::is_const<std::remove_reference_t<T>>::value,
75 const plain_vector, plain_vector>;
76 using T_map = Eigen::Map<optionally_const_vector>;
77 return make_holder([](
auto& x) {
return T_map(x.data(), x.size()); },
auto as_column_vector_or_scalar(T &&a)
as_column_vector_or_scalar of a kernel generator expression.
auto make_holder(const F &func, Args &&... args)
Constructs an expression from given arguments using given functor.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...