1 #ifndef STAN__MATH__MATRIX__APPEND__ROW_HPP
2 #define STAN__MATH__MATRIX__APPEND__ROW_HPP
21 template <
typename T1,
typename T2,
int R1,
int C1,
int R2,
int C2>
22 inline Matrix<typename return_type<T1, T2>::type, Dynamic, Dynamic>
24 const Matrix<T2, R2, C2> & B) {
30 Acols,
"columns of A",
31 Bcols,
"columns of B",
34 Matrix<typename return_type<T1, T2>::type, Dynamic, Dynamic>
35 result(Arows + Brows, Acols);
36 for (
int j = 0; j < Acols; j++) {
37 for (
int i = 0; i < Arows; i++)
38 result(i, j) = A(i, j);
39 for (
int i = Arows, k = 0; k < Brows; i++, k++)
40 result(i, j) = B(k, j);
47 template <
typename T1,
typename T2,
int R1,
int R2>
48 inline Matrix<typename return_type<T1, T2>::type, Dynamic, 1>
50 const Matrix<T2, R1, 1> & B) {
53 Matrix<typename return_type<T1, T2>::type, 1, Dynamic>
54 result(Asize + Bsize);
55 for (
int i = 0; i < Asize; i++)
57 for (
int i = 0, j = Asize; i < Bsize; i++, j++)
66 template <
typename T,
int R1,
int C1,
int R2,
int C2>
67 inline Matrix<T, Dynamic, Dynamic>
69 const Matrix<T, R2, C2> & B) {
71 A.cols(),
"columns of A",
72 B.cols(),
"columns of B",
75 Matrix<T, Dynamic, Dynamic>
76 result(A.rows() + B.rows(), A.cols());
82 template <
typename T,
int R1,
int R2>
83 inline Matrix<T, Dynamic, 1>
85 const Matrix<T, R1, 1> & B) {
87 result(A.size()+B.size());
bool check_size_match(const char *function, T_size1 i, const char *name_i, T_size2 j, const char *name_j, T_result *result)
Matrix< typename return_type< T1, T2 >::type, Dynamic, Dynamic > append_row(const Matrix< T1, R1, C1 > &A, const Matrix< T2, R2, C2 > &B)