Loading [MathJax]/extensions/TeX/AMSsymbols.js
Stan Math Library
5.0.0
Automatic Differentiation
▼
Stan Math Library
Overview
▼
Contributor Guides
Developer Guide
Adding New Functions
Adding New Distributions
Common Pitfalls
Using requires for general overloads
Reverse Mode Types
Testing Automatic Differentiation Functions
Testing New Distributions
Add New Functions With Known Gradients
Adding New OpenCL Functions
Windows Development Tips
▼
Internal Docs
►
Probability Distributions
►
OpenCL
►
Compressed Sparse Row matrix format.
►
Type Traits
►
Available requires<> for overloading.
►
Eigen expressions
►
arena_matrix <br>
►
real <br>
►
Parallelism
(External Link) Stan Language Docs
(External Link) Stan Discourse
►
Stan Math Library Docs
►
Class List
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
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.