1#ifndef STAN_MATH_PRIM_FUN_APPEND_COL_HPP
2#define STAN_MATH_PRIM_FUN_APPEND_COL_HPP
32template <
typename T1,
typename T2,
typename = require_all_eigen_t<T1, T2>>
37 constexpr int row_type
38 = (T1::RowsAtCompileTime == 1 && T2::RowsAtCompileTime == 1)
48 Matrix<T_return, row_type, Dynamic> result(Arows, Acols + Bcols);
49 result.leftCols(Acols) = A.template cast<T_return>();
50 result.rightCols(Bcols) = B.template cast<T_return>();
68template <
typename Scal,
typename RowVec,
71inline Eigen::Matrix<return_type_t<Scal, RowVec>, 1, Eigen::Dynamic>
append_col(
72 const Scal& A,
const RowVec& B) {
77 Matrix<T_return, 1, Dynamic> result(B.size() + 1);
78 result << A, B.template cast<T_return>();
96template <
typename RowVec,
typename Scal,
99inline Eigen::Matrix<return_type_t<RowVec, Scal>, 1, Eigen::Dynamic>
append_col(
100 const RowVec& A,
const Scal& B) {
101 using Eigen::Dynamic;
105 Matrix<T_return, 1, Dynamic> result(A.size() + 1);
106 result << A.template cast<T_return>(), B;
auto append_col(Ta &&a, Tb &&b)
Stack the cols of the arguments.
require_t< is_stan_scalar< std::decay_t< T > > > require_stan_scalar_t
Require type satisfies is_stan_scalar.
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
std::enable_if_t< Check::value > require_t
If condition is true, template is enabled.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...