1 #ifndef STAN_MATH_PRIM_MAT_FUN_PROMOTE_SCALAR_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_PROMOTE_SCALAR_HPP
20 template <
typename T,
typename S>
30 static Eigen::Matrix<typename promote_scalar_type<T, S>::type, -1, -1>
31 apply(
const Eigen::Matrix<S, -1, -1>& x) {
32 Eigen::Matrix<typename promote_scalar_type<T, S>::type, -1, -1>
33 y(x.rows(), x.cols());
34 for (
int i = 0; i < x.size(); ++i)
49 template <
typename T,
typename S>
59 static Eigen::Matrix<typename promote_scalar_type<T, S>::type, 1, -1>
60 apply(
const Eigen::Matrix<S, 1, -1>& x) {
61 Eigen::Matrix<typename promote_scalar_type<T, S>::type, 1, -1>
62 y(x.rows(), x.cols());
63 for (
int i = 0; i < x.size(); ++i)
78 template <
typename T,
typename S>
88 static Eigen::Matrix<typename promote_scalar_type<T, S>::type, -1, 1>
89 apply(
const Eigen::Matrix<S, -1, 1>& x) {
90 Eigen::Matrix<typename promote_scalar_type<T, S>::type, -1, 1>
91 y(x.rows(), x.cols());
92 for (
int i = 0; i < x.size(); ++i)