Stan Math Library  2.14.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  public:
18  explicit VectorBuilderHelper(size_t n) : x_(n) { }
19 
20  typedef std::vector<T1> type;
21 
22  T1& operator[](size_t i) {
23  return x_[i];
24  }
25 
26  inline type& data() {
27  return x_;
28  }
29  };
30 }
31 #endif
VectorBuilder allocates type T1 values to be used as intermediate values.

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