Stan Math Library  2.15.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 
4 namespace stan {
5  namespace math {
6 
15  template <typename T, typename S>
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
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–2016, Stan Development Team.