Stan Math Library  2.14.0
reverse mode automatic differentiation
promote_scalar.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_ARR_FUN_PROMOTE_SCALAR_HPP
2 #define STAN_MATH_PRIM_ARR_FUN_PROMOTE_SCALAR_HPP
3 
7 #include <vector>
8 
9 namespace stan {
10  namespace math {
11 
21  template <typename T, typename S>
22  struct promote_scalar_struct<T, std::vector<S> > {
31  static std::vector<typename promote_scalar_type<T, S>::type>
32  apply(const std::vector<S>& x) {
33  typedef std::vector<typename promote_scalar_type<T, S>::type> return_t;
34  typedef typename index_type<return_t>::type idx_t;
35  return_t y(x.size());
36  for (idx_t i = 0; i < x.size(); ++i)
38  return y;
39  }
40  };
41 
42  }
43 }
44 #endif
static std::vector< typename promote_scalar_type< T, S >::type > apply(const std::vector< S > &x)
Return the standard vector consisting of the recursive promotion of the elements of the input standar...
Primary template class for the metaprogram to compute the index type of a container.
Definition: index_type.hpp:18
General struct to hold static function for promoting underlying scalar types.

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