Automatic Differentiation
 
Loading...
Searching...
No Matches
primitive_value.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_PRIMITIVE_VALUE_HPP
2#define STAN_MATH_PRIM_FUN_PRIMITIVE_VALUE_HPP
3
6#include <type_traits>
7
8namespace stan {
9namespace math {
10
26template <typename T>
27inline typename std::enable_if<std::is_arithmetic<T>::value, T>::type
29 return x;
30}
31
42template <typename T>
43inline typename std::enable_if<!std::is_arithmetic<T>::value, double>::type
44primitive_value(const T& x) {
45 return value_of(x);
46}
47
48} // namespace math
49} // namespace stan
50#endif
double primitive_value(const fvar< T > &v)
Return the primitive value of the specified forward-mode autodiff variable.
T value_of(const fvar< T > &v)
Return the value of the specified variable.
Definition value_of.hpp:18
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...