All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
precomp_v_vari.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_REV_CORE_PRECOMP_V_VARI_HPP
#define STAN_MATH_REV_CORE_PRECOMP_V_VARI_HPP
#include <stan/math/rev/core/vari.hpp>
#include <stan/math/rev/core/v_vari.hpp>
namespace stan {
namespace math {
// use for single precomputed partials
class precomp_v_vari : public op_v_vari {
protected:
double da_;
public:
precomp_v_vari(double val, vari* avi, double da)
: op_v_vari(val, avi),
da_(da) {
}
void chain() {
avi_->adj_ += adj_ * da_;
}
};
}
}
#endif
vari.hpp
stan::math::vari
The variable implementation base class.
Definition: vari.hpp:28
stan::math::op_v_vari::avi_
vari * avi_
Definition: v_vari.hpp:11
stan::math::op_v_vari
Definition: v_vari.hpp:9
v_vari.hpp
stan::math::precomp_v_vari::da_
double da_
Definition: precomp_v_vari.hpp:13
stan::math::precomp_v_vari
Definition: precomp_v_vari.hpp:11
stan::math::vari::adj_
double adj_
The adjoint of this variable, which is the partial derivative of this variable with respect to the ro...
Definition: vari.hpp:42
stan::math::precomp_v_vari::chain
void chain()
Apply the chain rule to this variable based on the variables on which it depends. ...
Definition: precomp_v_vari.hpp:19
stan::math::precomp_v_vari::precomp_v_vari
precomp_v_vari(double val, vari *avi, double da)
Definition: precomp_v_vari.hpp:15

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