| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

lub_free.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_LUB_FREE_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_LUB_FREE_HPP
3
4 #include <stan/math/prim/scal/err/check_bounded.hpp>
5 #include <stan/math/prim/scal/fun/logit.hpp>
6 #include <stan/math/prim/scal/fun/lb_free.hpp>
7 #include <stan/math/prim/scal/fun/ub_free.hpp>
8 #include <limits>
9
10 namespace stan {
11 namespace math {
12
43 template <typename T, typename TL, typename TU>
44 inline
45 typename boost::math::tools::promote_args<T, TL, TU>::type
46 lub_free(const T y, TL lb, TU ub) {
47 check_bounded<T, TL, TU>
48 ("lub_free",
49 "Bounded variable",
50 y, lb, ub);
51 if (lb == -std::numeric_limits<double>::infinity())
52 return ub_free(y, ub);
53 if (ub == std::numeric_limits<double>::infinity())
54 return lb_free(y, lb);
55 return logit((y - lb) / (ub - lb));
56 }
57
58 }
59 }
60 #endif
stan
Definition: log_sum_exp.hpp:8
lb_free.hpp
stan::math::lub_free
boost::math::tools::promote_args< T, TL, TU >::type lub_free(const T y, TL lb, TU ub)
Return the unconstrained scalar that transforms to the specified lower- and upper-bounded scalar give...
Definition: lub_free.hpp:46
stan::math::ub_free
boost::math::tools::promote_args< T, TU >::type ub_free(const T y, const TU ub)
Return the free scalar that corresponds to the specified upper-bounded value with respect to the spec...
Definition: ub_free.hpp:38
stan::math::lb_free
boost::math::tools::promote_args< T, TL >::type lb_free(const T y, const TL lb)
Return the unconstrained value that produces the specified lower-bound constrained value...
Definition: lb_free.hpp:31
check_bounded.hpp
ub_free.hpp
stan::math::logit
fvar< T > logit(const fvar< T > &x)
Definition: logit.hpp:16
logit.hpp

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