1#ifndef STAN_MATH_PRIM_FUN_VALUE_OF_REC_HPP
2#define STAN_MATH_PRIM_FUN_VALUE_OF_REC_HPP
28template <
typename T,
typename = require_stan_scalar_t<T>>
30 return static_cast<double>(x);
54inline std::complex<double>
value_of_rec(
const std::complex<T>& x) {
68template <
typename T, require_not_same_t<
double, T>* =
nullptr>
70 size_t x_size = x.size();
71 std::vector<double> result(x_size);
72 for (
size_t i = 0; i < x_size; i++) {
89template <
typename T, require_std_vector_t<T>* =
nullptr,
90 require_vt_same<
double, T>* =
nullptr>
92 return std::forward<T>(x);
105template <
typename T,
typename = require_not_st_same<T,
double>,
106 typename = require_eigen_t<T>>
110 return m.unaryExpr([](
auto x) {
return value_of_rec(x); });
127template <
typename T,
typename = require_st_same<T,
double>,
128 typename = require_eigen_t<T>>
130 return std::forward<T>(x);
double value_of_rec(const fvar< T > &v)
Return the value of the specified variable.
auto make_holder(const F &func, Args &&... args)
Constructs an expression from given arguments using given functor.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...