| Stan Math Library 2.12.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 namespace math {
9
26 template <typename T>
27 inline
28 T positive_free(const T y) {
29 using std::log;
30 check_positive("positive_free",
31 "Positive variable", y);
32 return log(y);
33 }
34
35 }
36 }
37 #endif
check_positive.hpp
stan
Definition: log_sum_exp.hpp:8
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:14
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:28
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:66

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