| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

container_view.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_ARR_META_CONTAINER_VIEW_HPP
2 #define STAN_MATH_PRIM_ARR_META_CONTAINER_VIEW_HPP
3
4 #include <stan/math/prim/scal/meta/container_view.hpp>
5 #include <vector>
6
7 namespace stan {
8 namespace math {
9
18 template <typename T1, typename T2>
19 class container_view<std::vector<T1>, T2> {
20 public:
27 container_view(const std::vector<T1>& x, T2* y)
28 : y_(y) { }
29
36 T2& operator[](int i) {
37 return y_[i];
38 }
39 private:
40 T2* y_;
41 };
42 }
43 }
44
45 #endif
stan::math::container_view< std::vector< T1 >, T2 >::container_view
container_view(const std::vector< T1 > &x, T2 *y)
Constructor.
Definition: container_view.hpp:27
stan
Definition: log_sum_exp.hpp:8
std
Definition: std_numeric_limits.hpp:7
stan::math::container_view< std::vector< T1 >, T2 >::operator[]
T2 & operator[](int i)
operator[](int i) returns reference to scalar view indexed at i
Definition: container_view.hpp:36
stan::math::container_view
Primary template class for container view of array y with same structure as T1 and size as x...
Definition: container_view.hpp:19
container_view.hpp

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