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

◆ select() [2/6]

template<typename T_true , typename T_false , typename ReturnT = return_type_t<T_true, T_false>, require_all_stan_scalar_t< T_true, T_false > * = nullptr>
ReturnT stan::math::select ( const bool  c,
const T_true  y_true,
const T_false  y_false 
)
inline

If first argument is true return the second argument, else return the third argument.

select(c, y1, y0) = c ? y1 : y0.

Template Parameters
T_trueA stan Scalar type
T_falseA stan Scalar type
Parameters
cBoolean condition value.
y_trueValue to return if condition is true.
y_falseValue to return if condition is false.

Definition at line 26 of file select.hpp.