Stan Math Library  2.20.0
reverse mode automatic differentiation
VectorBuilderHelper.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_ARR_META_VECTORBUILDER_HELPER_HPP
2 #define STAN_MATH_PRIM_ARR_META_VECTORBUILDER_HELPER_HPP
3 
5 #include <stdexcept>
6 #include <vector>
7 
8 namespace stan {
9 
13 template <typename T1>
14 class VectorBuilderHelper<T1, true, true> {
15  private:
16  std::vector<T1> x_;
17 
18  public:
19  explicit VectorBuilderHelper(size_t n) : x_(n) {}
20 
21  typedef std::vector<T1> type;
22 
23  T1& operator[](size_t i) { return x_[i]; }
24 
25  inline type& data() { return x_; }
26 };
27 } // namespace stan
28 #endif
VectorBuilder allocates type T1 values to be used as intermediate values.

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