Stan Math Library  2.20.0
reverse mode automatic differentiation
positive_free.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_POSITIVE_FREE_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_POSITIVE_FREE_HPP
3 
6 #include <cmath>
7 
8 namespace stan {
9 namespace math {
10 
27 template <typename T>
28 inline T positive_free(const T& y) {
29  using std::log;
30  check_positive("positive_free", "Positive variable", y);
31  return log(y);
32 }
33 
34 } // namespace math
35 } // namespace stan
36 #endif
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:12
T positive_free(const T &y)
Return the unconstrained value corresponding to the specified positive-constrained value...
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.

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