Automatic Differentiation
 
Loading...
Searching...
No Matches
if_else.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_IF_ELSE_HPP
2#define STAN_MATH_PRIM_FUN_IF_ELSE_HPP
3
5
6namespace stan {
7namespace math {
8
25template <typename T_true, typename T_false>
26inline return_type_t<T_true, T_false> if_else(const bool c, const T_true y_true,
27 const T_false y_false) {
28 return c ? y_true : y_false;
29}
30
31} // namespace math
32} // namespace stan
33
34#endif
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
return_type_t< T_true, T_false > if_else(const bool c, const T_true y_true, const T_false y_false)
Return the second argument if the first argument is true and otherwise return the second argument.
Definition if_else.hpp:26
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...