1 #ifndef STAN_MATH_PRIM_SCAL_META_VECTORVIEW_HPP
2 #define STAN_MATH_PRIM_SCAL_META_VECTORVIEW_HPP
40 bool throw_if_accessed =
false>
47 explicit VectorView(std::vector<scalar_t>& v) : x_(&v[0]) { }
49 template <
int R,
int C>
50 explicit VectorView(Eigen::Matrix<scalar_t, R, C>& m) : x_(&m(0)) { }
55 if (throw_if_accessed)
71 template <
typename T,
bool is_array,
bool throw_if_accessed>
80 explicit VectorView(
const std::vector<scalar_t>& v) : x_(&v[0]) { }
82 template <
int R,
int C>
83 explicit VectorView(
const Eigen::Matrix<scalar_t, R, C>& m) : x_(&m(0)) { }
86 if (throw_if_accessed)
scalar_t & operator[](int i)
scalar_type< T >::type scalar_t
scalar_type_helper< is_vector< T >::value, T >::type type
VectorView(std::vector< scalar_t > &v)
VectorView(const scalar_t *x)
scalar_type< T >::type scalar_t
VectorView(const std::vector< scalar_t > &v)
VectorView(Eigen::Matrix< scalar_t, R, C > &m)
void out_of_range(const char *function, const int max, const int index, const char *msg1="", const char *msg2="")
Throw an out_of_range exception with a consistently formatted message.
const scalar_t & operator[](int i) const
double operator[](int) const
VectorView(const scalar_t &c)
VectorView is a template metaprogram that takes its argument and allows it to be used like a vector...
VectorView(const Eigen::Matrix< scalar_t, R, C > &m)