| Stan Math Library 2.11.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <stan/math/prim/scal/err/check_positive.hpp>
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
check_positive.hpp
stan
Definition: log_sum_exp.hpp:8
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15
stan::math::positive_free
T positive_free(const T y)
Return the unconstrained value corresponding to the specified positive-constrained value...
Definition: positive_free.hpp:29
stan::math::check_positive
bool check_positive(const char *function, const char *name, const T_y &y)
Return true if y is positive.
Definition: check_positive.hpp:68

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