Stan Math Library
2.15.0
reverse mode automatic differentiation
stan
math
prim
scal
fun
positive_constrain.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_SCAL_FUN_POSITIVE_CONSTRAIN_HPP
2
#define STAN_MATH_PRIM_SCAL_FUN_POSITIVE_CONSTRAIN_HPP
3
4
#include <cmath>
5
6
namespace
stan
{
7
namespace
math {
8
19
template
<
typename
T>
20
inline
T
positive_constrain
(
const
T x) {
21
using
std::exp
;
22
return
exp
(x);
23
}
24
41
template
<
typename
T>
42
inline
T
positive_constrain
(
const
T x, T& lp) {
43
using
std::exp
;
44
lp += x;
45
return
exp
(x);
46
}
47
48
}
49
50
}
51
52
#endif
stan::math::positive_constrain
T positive_constrain(const T x)
Return the positive value for the specified unconstrained input.
Definition:
positive_constrain.hpp:20
stan
Definition:
log_sum_exp.hpp:8
stan::math::exp
fvar< T > exp(const fvar< T > &x)
Definition:
exp.hpp:10
[
Stan Home Page
]
© 2011–2016, Stan Development Team.