1#ifndef STAN_MATH_PRIM_FUN_APPEND_ARRAY_HPP
2#define STAN_MATH_PRIM_FUN_APPEND_ARRAY_HPP
27template <
typename T1,
typename T2>
28inline typename append_return_type<std::vector<T1>, std::vector<T2> >::type
31 std::vector<int> zdims;
40 for (
size_t i = 0; i < x.size(); ++i) {
43 for (
size_t i = 0; i < y.size(); ++i) {
44 assign(z[i + x.size()], y[i]);
60 const std::vector<T1>& y) {
63 if (!x.empty() && !y.empty()) {
64 std::vector<int> xdims =
dims(x), ydims =
dims(y);
66 "dimension of y", ydims);
67 for (
size_t i = 1; i < xdims.size(); ++i) {
73 z.reserve(x.size() + y.size());
74 z.insert(z.end(), x.begin(), x.end());
75 z.insert(z.end(), y.begin(), y.end());
void dims(const T_x &x, std::vector< int > &result)
matrix_cl overload of the dims helper function in prim/fun/dims.hpp.
void assign(T_lhs &x, const T_rhs &y)
Copy the right-hand side's value to the left-hand side variable.
void check_matching_sizes(const char *function, const char *name1, const T_y1 &y1, const char *name2, const T_y2 &y2)
Check if two structures at the same size.
auto append_array(T_x &&x, T_y &&y)
Return the concatenation of two specified vectors in the order of the arguments.
void resize(T &x, std::vector< int > dims)
Recursively resize the specified vector of vectors, which must bottom out at scalar values,...
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.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
This template metaprogram is used to compute the return type for append_array.