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

◆ ub_constrain() [4/14]

template<typename T_x , typename T_ub , require_all_prim_or_rev_kernel_expression_t< T_x, T_ub > * = nullptr, require_any_var_t< T_x, T_ub > * = nullptr, require_any_not_stan_scalar_t< T_x, T_ub > * = nullptr>
var_value< matrix_cl< double > > stan::math::ub_constrain ( T_x &&  x,
T_ub &&  ub,
var lp 
)
inline

Return the upper-bounded value for the specified unconstrained input and specified upper bound.

The transform applied is

\(f(x) = U - \exp(x)\)

where \(U\) is the constant upper bound.

Template Parameters
T_xkernel generator expression
T_ubkernel generator expression
Parameters
[in]xunconstrained input
[in]ubupper bound
[in,out]lpreference to log probability to increment
Returns
constrained matrix

Definition at line 75 of file ub_constrain.hpp.