Stan Math Library
4.9.0
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
4
#include <
stan/math/prim/meta.hpp
>
5
6
namespace
stan
{
7
namespace
math {
8
25
template
<
typename
T_true,
typename
T_false>
26
inline
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
stan::return_type_t
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
Definition
return_type.hpp:218
stan::math::if_else
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
stan
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition
unit_vector_constrain.hpp:15
meta.hpp
stan
math
prim
fun
if_else.hpp
[
Stan Home Page
]
© 2011–2019, Stan Development Team.