| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <stan/math/prim/scal/fun/value_of.hpp>
5 #include <stan/math/prim/scal/meta/child_type.hpp>
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
stan
Definition: log_sum_exp.hpp:8
stan::math::value_of
T value_of(const fvar< T > &v)
Return the value of the specified variable.
Definition: value_of.hpp:16
child_type.hpp
stan::math::size
int size(const std::vector< T > &x)
Return the size of the specified standard vector.
Definition: size.hpp:17
value_of.hpp

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