Stan Math Library
2.15.0
reverse mode automatic differentiation
stan
math
prim
scal
fun
promote_elements.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_SCAL_FUN_PROMOTE_ELEMENTS_HPP
2
#define STAN_MATH_PRIM_SCAL_FUN_PROMOTE_ELEMENTS_HPP
3
4
namespace
stan
{
5
namespace
math {
6
15
template
<
typename
T,
typename
S>
16
struct
promote_elements
{
23
inline
static
T
promote
(
const
S& u) {
24
return
u;
25
}
26
};
27
35
template
<
typename
T>
36
struct
promote_elements
<T, T> {
43
inline
static
const
T&
promote
(
const
T& u) {
44
return
u;
45
}
46
};
47
48
}
49
}
50
51
#endif
stan::math::promote_elements
Struct with static function for elementwise type promotion.
Definition:
promote_elements.hpp:16
stan
Definition:
log_sum_exp.hpp:8
stan::math::promote_elements< T, T >::promote
static const T & promote(const T &u)
Return input element.
Definition:
promote_elements.hpp:43
stan::math::promote_elements::promote
static T promote(const S &u)
Return input element.
Definition:
promote_elements.hpp:23
[
Stan Home Page
]
© 2011–2016, Stan Development Team.