Stan Math Library
4.9.0
Automatic Differentiation
|
|
inline |
Return the second argument if the first argument is true and otherwise return the second argument.
This is just a convenience method to provide a function with the same behavior as the built-in ternary operator. In general, this function behaves as if defined by
if_else(c, y1, y0) = c ? y1 : y0
.
T_true | type of the true argument |
T_false | type of the false argument |
c | Boolean condition value. |
y_true | Value to return if condition is true. |
y_false | Value to return if condition is false. |
Definition at line 26 of file if_else.hpp.