All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
primitive_value.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_SCAL_FUN_PRIMITIVE_VALUE_HPP
#define STAN_MATH_PRIM_SCAL_FUN_PRIMITIVE_VALUE_HPP
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_arithmetic.hpp>
#include <stan/math/prim/scal/fun/value_of.hpp>
namespace stan {
namespace math {
template <typename T>
inline
typename boost::enable_if<boost::is_arithmetic<T>, T>::type
primitive_value(T x) {
return x;
}
template <typename T>
inline
typename boost::disable_if<boost::is_arithmetic<T>, double>::type
primitive_value(const T& x) {
using stan::math::value_of;
return value_of(x);
}
}
}
#endif
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:22
value_of.hpp

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