Stan Math Library  2.12.0
reverse mode automatic differentiation
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>
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
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
T value_of(const fvar< T > &v)
Return the value of the specified variable.
Definition: value_of.hpp:16
double primitive_value(const fvar< T > &v)
Return the primitive value of the specified forward-mode autodiff variable.

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