1#ifndef STAN_MATH_PRIM_FUN_PROMOTE_ELEMENTS_HPP
2#define STAN_MATH_PRIM_FUN_PROMOTE_ELEMENTS_HPP
20template <
typename T,
typename S>
28 inline static T
promote(
const S& u) {
return u; }
46 inline static const T&
promote(
const T& u) {
return u; }
58template <
typename T,
typename S>
66 inline static std::vector<T>
promote(
const std::vector<S>& u) {
69 for (
size_t i = 0; i < u.size(); ++i) {
91 inline static const std::vector<T>&
promote(
const std::vector<T>& u) {
107template <
typename T,
typename S,
int R,
int C>
116 const Eigen::Matrix<S, R, C>& u) {
117 Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> t(u.rows(), u.cols());
118 for (
int i = 0; i < u.size(); ++i) {
134template <
typename T,
int R,
int C>
142 inline static const Eigen::Matrix<T, R, C>&
promote(
143 const Eigen::Matrix<T, R, C>& u) {
(Expert) Numerical traits for algorithmic differentiation variables.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...