Stan Math Library  2.6.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
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 
10  namespace math {
11 
27  template <typename T>
28  inline
29  typename boost::enable_if<boost::is_arithmetic<T>, T>::type
31  return x;
32  }
33 
44  template <typename T>
45  inline
46  typename boost::disable_if<boost::is_arithmetic<T>, double>::type
47  primitive_value(const T& x) {
49  return value_of(x);
50  }
51 
52  }
53 
54 }
55 
56 #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–2015, Stan Development Team.