| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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.