Stan
2.5.0
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
stan
agrad
rev
functions
log1p.hpp
Go to the documentation of this file.
1
#ifndef STAN__AGRAD__REV__FUNCTIONS__LOG1P_HPP
2
#define STAN__AGRAD__REV__FUNCTIONS__LOG1P_HPP
3
4
#include <valarray>
5
#include <
stan/agrad/rev/var.hpp
>
6
#include <
stan/agrad/rev/internal/v_vari.hpp
>
7
#include <
stan/math/constants.hpp
>
8
#include <
stan/math/functions/log1p.hpp
>
9
10
namespace
stan {
11
namespace
agrad {
12
13
namespace
{
14
class
log1p_vari :
public
op_v_vari {
15
public
:
16
log1p_vari(vari* avi) :
17
op_v_vari(stan::math::
log1p
(avi->val_),avi) {
18
}
19
void
chain() {
20
avi_->adj_ += adj_ / (1 + avi_->val_);
21
}
22
};
23
}
24
35
inline
var
log1p
(
const
stan::agrad::var
& a) {
36
return
var
(
new
log1p_vari(a.
vi_
));
37
}
38
39
}
40
}
41
#endif
stan::agrad::var::vi_
vari * vi_
Pointer to the implementation of this variable.
Definition:
var.hpp:40
v_vari.hpp
var.hpp
log1p.hpp
stan::agrad::var
Independent (input) and dependent (output) variables for gradients.
Definition:
var.hpp:27
constants.hpp
stan::agrad::log1p
fvar< T > log1p(const fvar< T > &x)
Definition:
log1p.hpp:16
[
Stan Home Page
]
© 2011–2014, Stan Development Team.