Stan Math Library
2.11.0
reverse mode automatic differentiation
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
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
8
namespace
math {
9
20
template
<
typename
T>
21
inline
22
T
positive_constrain
(
const
T x) {
23
return
exp
(x);
24
}
25
42
template
<
typename
T>
43
inline
44
T
positive_constrain
(
const
T x, T& lp) {
45
lp += x;
46
return
exp
(x);
47
}
48
49
50
}
51
52
}
53
54
#endif
stan::math::positive_constrain
T positive_constrain(const T x)
Return the positive value for the specified unconstrained input.
Definition:
positive_constrain.hpp:22
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.