Stan Math Library  2.12.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) {
32  return T(x);
33  }
34  };
35 
43  template <typename T>
44  struct promote_scalar_struct<T, T> {
51  static T apply(const T& x) {
52  return x;
53  }
54  };
55 
65  template <typename T, typename S>
66  typename promote_scalar_type<T, S>::type
67  promote_scalar(const S& x) {
69  }
70 
71  }
72 }
73 #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–2016, Stan Development Team.