Automatic Differentiation
 
Loading...
Searching...
No Matches
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
8namespace stan {
9namespace math {
10
20template <int R, int C>
21vari** 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
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...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
static thread_local AutodiffStackStorage * instance_