if_else.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_SCAL_FUN_IF_ELSE_HPP
#define STAN_MATH_PRIM_SCAL_FUN_IF_ELSE_HPP
#include <boost/math/tools/promotion.hpp>
namespace stan {
namespace math {
template <typename T_true, typename T_false>
inline typename 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 c ? y_true : y_false;
}
}
}
#endif
stan
Definition: log_sum_exp.hpp:8
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–2016, Stan Development Team.