Automatic Differentiation
 
Loading...
Searching...
No Matches
positive_free.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_POSITIVE_FREE_HPP
2#define STAN_MATH_PRIM_FUN_POSITIVE_FREE_HPP
3
7#include <cmath>
8
9namespace stan {
10namespace math {
11
28template <typename T>
29inline T positive_free(const T& y) {
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:15
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
T positive_free(const T &y)
Return the unconstrained value corresponding to the specified positive-constrained value.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9