All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
precomp_vv_vari.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_REV_CORE_PRECOMP_VV_VARI_HPP
#define STAN_MATH_REV_CORE_PRECOMP_VV_VARI_HPP
#include <stan/math/rev/core/vari.hpp>
#include <stan/math/rev/core/vv_vari.hpp>
namespace stan {
namespace math {
// use for single precomputed partials
class precomp_vv_vari : public op_vv_vari {
protected:
double da_;
double db_;
public:
precomp_vv_vari(double val,
vari* avi, vari* bvi,
double da, double db)
: op_vv_vari(val, avi, bvi),
da_(da),
db_(db) {
}
void chain() {
avi_->adj_ += adj_ * da_;
bvi_->adj_ += adj_ * db_;
}
};
}
}
#endif
vari.hpp
stan::math::vari
The variable implementation base class.
Definition: vari.hpp:28
stan::math::precomp_vv_vari::chain
void chain()
Apply the chain rule to this variable based on the variables on which it depends. ...
Definition: precomp_vv_vari.hpp:23
stan::math::precomp_vv_vari
Definition: precomp_vv_vari.hpp:11
stan::math::precomp_vv_vari::da_
double da_
Definition: precomp_vv_vari.hpp:13
stan::math::precomp_vv_vari::db_
double db_
Definition: precomp_vv_vari.hpp:14
stan::math::op_vv_vari::bvi_
vari * bvi_
Definition: vv_vari.hpp:12
stan::math::precomp_vv_vari::precomp_vv_vari
precomp_vv_vari(double val, vari *avi, vari *bvi, double da, double db)
Definition: precomp_vv_vari.hpp:16
vv_vari.hpp
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::op_vv_vari::avi_
vari * avi_
Definition: vv_vari.hpp:11
stan::math::op_vv_vari
Definition: vv_vari.hpp:9

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