Stan Math Library  2.14.0
reverse mode automatic differentiation
Public Types | Public Member Functions | List of all members
stan::VectorViewMvt< T, is_array, throw_if_accessed > Class Template Reference

VectorViewMvt is a template expression that wraps either an Eigen::Matrix or a std::vector<Eigen::Matrix> and allows the template expression to be used as an array using operator[]. More...

#include <VectorViewMvt.hpp>

Public Types

typedef scalar_type_pre< T >::type matrix_t
 

Public Member Functions

 VectorViewMvt (matrix_t &m)
 Constructor. More...
 
 VectorViewMvt (std::vector< matrix_t > &vm)
 Constructor. More...
 
matrix_toperator[] (int i)
 Allows the structure to be accessed like an array. More...
 

Detailed Description

template<typename T, bool is_array = stan::is_vector_like <typename stan::math::value_type<T>::type>::value, bool throw_if_accessed = false>
class stan::VectorViewMvt< T, is_array, throw_if_accessed >

VectorViewMvt is a template expression that wraps either an Eigen::Matrix or a std::vector<Eigen::Matrix> and allows the template expression to be used as an array using operator[].

Template Parameters
TType of scalar of the matrix being wrapped.
is_arrayTrue if underlying type T can be indexed with operator[].
throw_if_accessedTrue if the behavior is to throw an exception whenever operator[] is called.

Definition at line 29 of file VectorViewMvt.hpp.

Member Typedef Documentation

§ matrix_t

template<typename T, bool is_array = stan::is_vector_like <typename stan::math::value_type<T>::type>::value, bool throw_if_accessed = false>
typedef scalar_type_pre<T>::type stan::VectorViewMvt< T, is_array, throw_if_accessed >::matrix_t

Definition at line 31 of file VectorViewMvt.hpp.

Constructor & Destructor Documentation

§ VectorViewMvt() [1/2]

template<typename T, bool is_array = stan::is_vector_like <typename stan::math::value_type<T>::type>::value, bool throw_if_accessed = false>
stan::VectorViewMvt< T, is_array, throw_if_accessed >::VectorViewMvt ( matrix_t m)
inlineexplicit

Constructor.

Definition at line 36 of file VectorViewMvt.hpp.

§ VectorViewMvt() [2/2]

template<typename T, bool is_array = stan::is_vector_like <typename stan::math::value_type<T>::type>::value, bool throw_if_accessed = false>
stan::VectorViewMvt< T, is_array, throw_if_accessed >::VectorViewMvt ( std::vector< matrix_t > &  vm)
inlineexplicit

Constructor.

Definition at line 41 of file VectorViewMvt.hpp.

Member Function Documentation

§ operator[]()

template<typename T, bool is_array = stan::is_vector_like <typename stan::math::value_type<T>::type>::value, bool throw_if_accessed = false>
matrix_t& stan::VectorViewMvt< T, is_array, throw_if_accessed >::operator[] ( int  i)
inline

Allows the structure to be accessed like an array.

If is_array is false, this will return the matrix it was constructed with. If is_array is true, This does not check bounds and will likely segfault if the index is out of range.

Parameters
iindex. Only used if access is true.
Returns
Reference to a matrix.
Exceptions
std::out_of_rangeif the template parameter, throw_if_accessed, is true.

Definition at line 54 of file VectorViewMvt.hpp.


The documentation for this class was generated from the following file:

     [ Stan Home Page ] © 2011–2016, Stan Development Team.