1 #ifndef STAN_MATH_PRIM_MAT_FUN_PROMOTE_SCALAR_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_PROMOTE_SCALAR_HPP
19 template <
typename T,
typename S>
29 static Eigen::Matrix<typename promote_scalar_type<T, S>::type, -1, -1>
30 apply(
const Eigen::Matrix<S, -1, -1>& x) {
31 Eigen::Matrix<typename promote_scalar_type<T, S>::type, -1, -1>
32 y(x.rows(), x.cols());
33 for (
int i = 0; i < x.size(); ++i)
47 template <
typename T,
typename S>
57 static Eigen::Matrix<typename promote_scalar_type<T, S>::type, 1, -1>
58 apply(
const Eigen::Matrix<S, 1, -1>& x) {
59 Eigen::Matrix<typename promote_scalar_type<T, S>::type, 1, -1>
60 y(x.rows(), x.cols());
61 for (
int i = 0; i < x.size(); ++i)
75 template <
typename T,
typename S>
85 static Eigen::Matrix<typename promote_scalar_type<T, S>::type, -1, 1>
86 apply(
const Eigen::Matrix<S, -1, 1>& x) {
87 Eigen::Matrix<typename promote_scalar_type<T, S>::type, -1, 1>
88 y(x.rows(), x.cols());
89 for (
int i = 0; i < x.size(); ++i)
(Expert) Numerical traits for algorithmic differentiation variables.