Stan Math Library  2.20.0
reverse mode automatic differentiation
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 
5 namespace stan {
6 namespace math {
7 
16 template <typename T, typename S>
24  inline static T promote(const S& u) { return u; }
25 };
26 
34 template <typename T>
35 struct promote_elements<T, T> {
42  inline static const T& promote(const T& u) { return u; }
43 };
44 
45 } // namespace math
46 } // namespace stan
47 
48 #endif
Struct with static function for elementwise type promotion.
static const T & promote(const T &u)
Return input element.
static T promote(const S &u)
Return input element.

     [ Stan Home Page ] © 2011–2018, Stan Development Team.