Stan Math Library  2.20.0
reverse mode automatic differentiation
promote_scalar.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_PROMOTE_SCALAR_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_PROMOTE_SCALAR_HPP
3 
6 
7 namespace stan {
8 namespace math {
9 
18 template <typename T, typename S>
31  static T apply(S x) { return T(x); }
32 };
33 
41 template <typename T>
42 struct promote_scalar_struct<T, T> {
49  static T apply(const T& x) { return x; }
50 };
51 
61 template <typename T, typename S>
64 }
65 
66 } // namespace math
67 } // namespace stan
68 #endif
static T apply(const T &x)
Return the unmodified input.
promote_scalar_type< T, S >::type promote_scalar(const S &x)
This is the top-level function to call to promote the scalar types of an input of type S to type T...
General struct to hold static function for promoting underlying scalar types.
static T apply(S x)
Return the value of the input argument promoted to the type specified by the template parameter...

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