Stan Math Library  2.20.0
reverse mode automatic differentiation
build_vari_array.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_CORE_BUILD_VARI_ARRAY_HPP
2 #define STAN_MATH_REV_CORE_BUILD_VARI_ARRAY_HPP
3 
7 
8 namespace stan {
9 namespace math {
10 
20 template <int R, int C>
21 vari** build_vari_array(const Eigen::Matrix<var, R, C>& x) {
22  vari** x_vi_
24  for (int i = 0; i < x.size(); ++i) {
25  x_vi_[i] = x(i).vi_;
26  }
27  return x_vi_;
28 }
29 
30 } // namespace math
31 } // namespace stan
32 #endif
The variable implementation base class.
Definition: vari.hpp:30
static STAN_THREADS_DEF AutodiffStackStorage * instance_
T * alloc_array(size_t n)
Allocate an array on the arena of the specified size to hold values of the specified template paramet...
vari ** build_vari_array(const Eigen::Matrix< var, R, C > &x)
Allocates and populates a flat array of vari pointers in the autodiff arena with the varis pointed to...

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