Automatic Differentiation
 
Loading...
Searching...
No Matches
matrix_vari.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_REV_CORE_MATRIX_VARI_HPP
2#define STAN_MATH_REV_CORE_MATRIX_VARI_HPP
3
11
12namespace stan {
13namespace math {
14
15class op_matrix_vari : public vari {
16 protected:
17 const size_t size_;
19
20 public:
21 template <typename T, require_eigen_vt<is_var, T>* = nullptr>
22 op_matrix_vari(double f, const T& vs) : vari(f), size_(vs.size()) {
24 Eigen::Map<Eigen::Matrix<vari*, -1, -1>>(vis_, vs.rows(), vs.cols())
25 = vs.vi();
26 }
27 vari* operator[](size_t n) const { return vis_[n]; }
28 size_t size() { return size_; }
29};
30
31} // namespace math
32} // namespace stan
33#endif
op_matrix_vari(double f, const T &vs)
vari * operator[](size_t n) const
T * alloc_array(size_t n)
Allocate an array on the arena of the specified size to hold values of the specified template paramet...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
static thread_local AutodiffStackStorage * instance_