Stan Math Library  2.8.0
reverse mode automatic differentiation
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
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 
5 #include <cmath>
6 
7 namespace stan {
8 
9  namespace math {
10 
27  template <typename T>
28  inline
29  T positive_free(const T y) {
30  stan::math::check_positive("stan::math::positive_free",
31  "Positive variable", y);
32  return log(y);
33  }
34 
35  }
36 
37 }
38 
39 #endif
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15
T positive_free(const T y)
Return the unconstrained value corresponding to the specified positive-constrained value...
bool check_positive(const char *function, const char *name, const T_y &y)
Return true if y is positive.

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