Stan Math Library  2.20.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 
6 #include <vector>
7 #include <cstddef>
8 
9 namespace stan {
10 namespace math {
11 
22 template <typename T>
23 inline std::vector<double> 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 inline const std::vector<double>& value_of_rec(const std::vector<double>& x) {
43  return x;
44 }
45 
46 } // namespace math
47 } // namespace stan
48 
49 #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–2018, Stan Development Team.