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

◆ select() [3/6]

template<typename T_true , typename T_false , typename T_return = return_type_t<T_true, T_false>, typename T_true_plain = promote_scalar_t<T_return, plain_type_t<T_true>>, typename T_false_plain = promote_scalar_t<T_return, plain_type_t<T_false>>, require_all_container_t< T_true, T_false > * = nullptr, require_all_same_t< T_true_plain, T_false_plain > * = nullptr>
T_true_plain stan::math::select ( const bool  c,
T_true &&  y_true,
T_false &&  y_false 
)
inline

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

Eigen expressions are evaluated so that the return type is the same for both branches.

Both containers must have the same plain type. The scalar type of the return is determined by the return_type_t<> type trait.

Overload for use with two containers.

Template Parameters
T_trueA container of stan Scalar types
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 54 of file select.hpp.