Stan Math Library  2.11.0
reverse mode automatic differentiation
array_builder.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_ARRAY_BUILDER_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_ARRAY_BUILDER_HPP
3 
5 #include <vector>
6 
7 namespace stan {
8  namespace math {
9 
15  template <typename T>
16  struct array_builder {
17  std::vector<T> x_;
18  array_builder() : x_() { }
19  template <typename F>
20  array_builder& add(const F& u) {
21  T t;
23  x_.push_back(t);
24  return *this;
25  }
26  std::vector<T> array() {
27  return x_;
28  }
29  };
30 
31  }
32 }
33 #endif
std::vector< T > array()
array_builder & add(const F &u)
Structure for building up arrays in an expression (rather than in statements) using an argumentchaini...
static void promote(const F &u, T &t)
Definition: promoter.hpp:15

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