| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <stan/math/prim/scal/fun/value_of_rec.hpp>
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
stan
Definition: log_sum_exp.hpp:8
stan::math::value_of_rec
double value_of_rec(const fvar< T > &v)
Return the value of the specified variable.
Definition: value_of_rec.hpp:21
value_of_rec.hpp
stan::math::size
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.