| Stan Math Library 2.6.3 probability, sampling & optimization

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
value_of.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_VALUE_OF_HPP
2 #define STAN_MATH_PRIM_MAT_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 <stan/math/prim/mat/fun/Eigen.hpp>
7
8 namespace stan {
9 namespace math {
10
23 template <typename T, int R, int C>
24 inline Eigen::Matrix<typename child_type<T>::type, R, C>
25 value_of(const Eigen::Matrix<T, R, C>& M) {
26 using stan::math::value_of;
27 Eigen::Matrix<typename child_type<T>::type, R, C> Md(M.rows(), M.cols());
28 for (int j = 0; j < M.cols(); j++)
29 for (int i = 0; i < M.rows(); i++)
30 Md(i, j) = value_of(M(i, j));
31 return Md;
32 }
33 }
34 }
35
36 #endif
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
Eigen.hpp
value_of.hpp

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