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

◆ ub_constrain() [13/14]

template<bool Jacobian, typename T , typename U >
auto stan::math::ub_constrain ( const T &  x,
const U &  ub,
return_type_t< T, U > &  lp 
)
inline

Specialization of ub_constrain to apply a container of upper bounds elementwise to each input element.

If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.

Template Parameters
Jacobianif true, increment log density accumulator with log absolute Jacobian determinant of constraining transform
TA type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar
UA type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar
Parameters
[in]xunconstrained input
[in]ubupper bound on output
[in,out]lplog density accumulator
Returns
lower-bound constrained value corresponding to inputs

Definition at line 253 of file ub_constrain.hpp.