1#ifndef STAN_MATH_PRIM_FUN_TO_ROW_VECTOR_HPP
2#define STAN_MATH_PRIM_FUN_TO_ROW_VECTOR_HPP
14template <
typename EigMat, require_eigen_t<EigMat>* =
nullptr>
15inline Eigen::Matrix<value_type_t<EigMat>, 1, Eigen::Dynamic>
to_row_vector(
16 const EigMat& matrix) {
18 Eigen::Matrix<T, 1, Eigen::Dynamic> res(matrix.size());
20 Eigen::Matrix<T, EigMat::RowsAtCompileTime, EigMat::ColsAtCompileTime>>
21 res_map(res.data(), matrix.rows(), matrix.cols());
29 const std::vector<T>& vec) {
30 return Eigen::Matrix<T, 1, Eigen::Dynamic>::Map(vec.data(), vec.size());
35 const std::vector<int>& vec) {
37 Eigen::Matrix<double, 1, Eigen::Dynamic> result(C);
38 for (
int i = 0; i < C; i++) {
auto to_row_vector(T_x &&x)
Returns input matrix reshaped into a row vector.
typename value_type< T >::type value_type_t
Helper function for accessing underlying type.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...