Stan
2.5.0
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
stan
math
functions
if_else.hpp
Go to the documentation of this file.
1
#ifndef STAN__MATH__FUNCTIONS__IF_ELSE_HPP
2
#define STAN__MATH__FUNCTIONS__IF_ELSE_HPP
3
4
#include <boost/math/tools/promotion.hpp>
5
6
namespace
stan {
7
namespace
math {
8
23
template
<
typename
T_true,
typename
T_false>
24
inline
typename
boost::math::tools::promote_args<T_true,T_false>::type
25
if_else
(
const
bool
c,
const
T_true y_true,
const
T_false y_false) {
26
return
c ? y_true : y_false;
27
}
28
29
}
30
}
31
32
#endif
stan::math::if_else
boost::math::tools::promote_args< T_true, T_false >::type 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:25
[
Stan Home Page
]
© 2011–2014, Stan Development Team.