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

◆ select() [5/6]

template<typename T_true , typename T_false , typename ReturnT = promote_scalar_t<return_type_t<T_true, T_false>, plain_type_t<T_false>>, require_stan_scalar_t< T_true > * = nullptr, require_container_t< 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.

Overload for use when the 'true' return is a scalar and the 'false' return is a container

If chosen, the scalar is returned as a container of the same size and plain type as the provided argument. Consequently, any Eigen expressions are evaluated.

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

Definition at line 118 of file select.hpp.