Stan Math Library  2.15.0
reverse mode automatic differentiation
value_of.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_ARR_FUN_VALUE_OF_HPP
2 #define STAN_MATH_PRIM_ARR_FUN_VALUE_OF_HPP
3 
6 #include <vector>
7 #include <cstddef>
8 
9 namespace stan {
10  namespace math {
11 
20  template <typename T>
21  inline std::vector<typename child_type<T>::type>
22  value_of(const std::vector<T>& x) {
23  size_t size = x.size();
24  std::vector<typename child_type<T>::type> result(size);
25  for (size_t i=0; i < size; i++)
26  result[i] = value_of(x[i]);
27  return result;
28  }
29 
41  template <>
42  inline std::vector<double> value_of(const std::vector<double>& x) {
43  return x;
44  }
45 
46  }
47 }
48 
49 #endif
T value_of(const fvar< T > &v)
Return the value of the specified variable.
Definition: value_of.hpp:16
int size(const std::vector< T > &x)
Return the size of the specified standard vector.
Definition: size.hpp:17

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