Stan Math Library: stan/math/prim/arr/meta/container_view.hpp Source File

| Stan Math Library 2.10.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
9 namespace math {
10
19 template <typename T1, typename T2>
20 class container_view<std::vector<T1>, T2> {
21 public:
28 container_view(const std::vector<T1>& x, T2* y)
29 : y_(y) { }
30
37 T2& operator[](int i) {
38 return y_[i];
39 }
40 private:
41 T2* y_;
42 };
43 }
44 }
45
46 #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:28
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:37
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:22
container_view.hpp

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