Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ lub_constrain() [9/19]

template<typename T , typename L , typename U , require_all_eigen_t< T, L, U > * = nullptr, require_not_var_t< return_type_t< T, L, U > > * = nullptr>
auto stan::math::lub_constrain ( const T &  x,
const L &  lb,
const U &  ub 
)
inline

Overload for Eigen matrix and matrix bounds.

Specialization for Eigen matrix and matrix bounds.

Return the lower and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds.

The transform is the transformed and scaled inverse logit,

\(f(x) = L + (U - L) \mbox{logit}^{-1}(x)\)

Template Parameters
TScalar.
LScalar.
UScalar.
Parameters
[in]xFree scalar to transform.
[in]lbLower bound.
[in]ubUpper bound.
Returns
Lower- and upper-bounded scalar derived from transforming the free scalar.
Exceptions
std::domain_errorif ub <= lb

Definition at line 203 of file lub_constrain.hpp.