Stan Math Library  2.15.0
reverse mode automatic differentiation
value_of_rec.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_ARR_FUN_VALUE_OF_REC_HPP
2 #define STAN_MATH_PRIM_ARR_FUN_VALUE_OF_REC_HPP
3 
5 #include <vector>
6 #include <cstddef>
7 
8 namespace stan {
9  namespace math {
10 
21  template <typename T>
22  inline std::vector<double>
23  value_of_rec(const std::vector<T>& x) {
24  size_t size = x.size();
25  std::vector<double> result(size);
26  for (size_t i=0; i < size; i++)
27  result[i] = value_of_rec(x[i]);
28  return result;
29  }
30 
42  template <>
43  inline std::vector<double> value_of_rec(const std::vector<double>& x) {
44  return x;
45  }
46 
47  }
48 }
49 
50 #endif
double value_of_rec(const fvar< T > &v)
Return the value of the specified variable.
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.