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

◆ ub_constrain() [1/14]

template<typename T , typename U , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< U > * = nullptr>
auto stan::math::ub_constrain ( T &&  x,
U &&  ub 
)
inline

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

The transform is

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

where \(U\) is the upper bound.

Template Parameters
Ttype of Matrix
Utype of upper bound
Parameters
[in]xfree Matrix.
[in]ubupper bound
Returns
matrix constrained to have upper bound

Definition at line 32 of file ub_constrain.hpp.