1 #ifndef STAN_MATH_PRIM_MAT_META_CONTAINER_VIEW_HPP
2 #define STAN_MATH_PRIM_MAT_META_CONTAINER_VIEW_HPP
22 template <
typename T1,
typename T2,
int R,
int C>
40 Eigen::Map<Eigen::Matrix<T2, R, C> >&
operator[](
int i) {
44 Eigen::Map<Eigen::Matrix<T2, R, C> > y_;
57 template <
typename T1,
typename T2,
int R,
int C>
90 template <
typename T1,
typename T2,
int R,
int C>
92 Eigen::Matrix<T2, R, C> > {
105 : y_view(y, 1, 1), y_(y) {
121 new (&y_view) Eigen::Map<Eigen::Matrix<T2, R, C> >
122 (y_ + offset,
rows, cols);
126 Eigen::Map<Eigen::Matrix<T2, R, C> > y_view;
int rows(const Eigen::Matrix< T, R, C > &m)
Return the number of rows in the specified matrix, vector, or row vector.
Eigen::Map< Eigen::Matrix< T2, R, C > > & operator[](int i)
operator[](int i) returns matrix view of scalartype T2 at appropriate index i in array y ...
(Expert) Numerical traits for algorithmic differentiation variables.
container_view(const Eigen::Matrix< T1, R, C > &x, T2 *y)
Constructor.
Eigen::Map< Eigen::Matrix< T2, R, C > > & operator[](int i)
operator[](int i) returns Eigen::Map y
int cols(const Eigen::Matrix< T, R, C > &m)
Return the number of columns in the specified matrix, vector, or row vector.
T2 & operator[](int i)
operator[](int i) returns reference to scalar of type T2 at appropriate index i in array y ...
Primary template class for container view of array y with same structure as T1 and size as x...
container_view(const Eigen::Matrix< T1, R, C > &x, T2 *y)
Initialize Map dimensions with input matrix dimensions.
container_view(const std::vector< Eigen::Matrix< T1, R, C > > &x, T2 *y)
Constructor assumes all matrix elements in std::vector are of same dimension.