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

◆ select() [4/6]

template<typename T_true , typename T_false , typename ReturnT = promote_scalar_t<return_type_t<T_true, T_false>, plain_type_t<T_true>>, require_container_t< T_true > * = nullptr, require_stan_scalar_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 container and the 'false' return is a scalar

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 container of stan Scalar types
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 83 of file select.hpp.