| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

primitive_value.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_PRIMITIVE_VALUE_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_PRIMITIVE_VALUE_HPP
3
4 #include <boost/utility/enable_if.hpp>
5 #include <boost/type_traits/is_arithmetic.hpp>
6 #include <stan/math/prim/scal/fun/value_of.hpp>
7
8 namespace stan {
9 namespace math {
10
26 template <typename T>
27 inline
28 typename boost::enable_if<boost::is_arithmetic<T>, T>::type
29 primitive_value(T x) {
30 return x;
31 }
32
43 template <typename T>
44 inline
45 typename boost::disable_if<boost::is_arithmetic<T>, double>::type
46 primitive_value(const T& x) {
47 return value_of(x);
48 }
49
50 }
51 }
52 #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
stan::math::primitive_value
double primitive_value(const fvar< T > &v)
Return the primitive value of the specified forward-mode autodiff variable.
Definition: primitive_value.hpp:20
value_of.hpp

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