1 #ifndef STAN_MATH_PRIM_MAT_FUN_TO_ARRAY_1D_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_TO_ARRAY_1D_HPP 14 template <
typename T,
int R,
int C>
15 inline std::vector<T>
to_array_1d(
const Eigen::Matrix<T, R, C>& matrix) {
16 const T* datap = matrix.data();
17 int size = matrix.size();
18 std::vector<T> result(size);
19 for (
int i = 0; i <
size; i++)
32 inline std::vector<typename scalar_type<T>::type>
to_array_1d(
33 const std::vector<std::vector<T> >& x) {
34 size_t size1 = x.size();
38 std::vector<T> y(size1 * size2);
39 for (
size_t i = 0, ij = 0; i < size1; i++)
40 for (
size_t j = 0; j < size2; j++, ij++)
int size(const std::vector< T > &x)
Return the size of the specified standard vector.
std::vector< T > to_array_1d(const Eigen::Matrix< T, R, C > &matrix)