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

◆ select() [6/6]

template<typename T_bool , typename T_true , typename T_false , require_eigen_array_vt< std::is_integral, T_bool > * = nullptr, require_all_stan_scalar_t< T_true, T_false > * = nullptr>
auto stan::math::select ( const T_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 with an Eigen object of booleans, and two scalars.

The chosen scalar is returned as an Eigen object of the same dimension as the input Eigen argument

Template Parameters
T_booltype of Eigen boolean object
T_trueA stan Scalar type
T_falseA stan Scalar type
Parameters
cEigen object of boolean condition values.
y_trueValue to return if condition is true.
y_falseValue to return if condition is false.

Overload for use with an Eigen array of booleans, one Eigen array and a scalar as input.

Template Parameters
T_booltype of Eigen boolean object
T_trueA stan Scalar type or Eigen Array type
T_falseA stan Scalar type or Eigen Array type
Parameters
cEigen object of boolean condition values.
y_trueValue to return if condition is true.
y_falseValue to return if condition is false.

Definition at line 149 of file select.hpp.