Stan Math Library  2.6.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
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
T positive_constrain(const T x)
Return the positive value for the specified unconstrained input.
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:10

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