1 #ifndef STAN_MATH_PRIM_MAT_FUN_PROMOTER_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_PROMOTER_HPP
13 template <
typename F,
typename T>
15 inline static void promote(
const F& u, T& t) {
25 inline static void promote(
const T& u, T& t) {
34 template <
typename F,
typename T>
35 struct promoter<std::vector<F>, std::vector<T> > {
36 inline static void promote(
const std::vector<F>& u,
39 for (
size_t i = 0; i < u.size(); ++i)
42 inline static std::vector<T>
51 struct promoter<std::vector<T>, std::vector<T> > {
52 inline static void promote(
const std::vector<T>& u,
56 inline static std::vector<T>
promote_to(
const std::vector<T>& u) {
62 template <
typename F,
typename T,
int R,
int C>
63 struct promoter<Eigen::Matrix<F, R, C>, Eigen::Matrix<T, R, C> > {
64 inline static void promote(
const Eigen::Matrix<F, R, C>& u,
65 Eigen::Matrix<T, R, C>& t) {
66 t.resize(u.rows(), u.cols());
67 for (
int i = 0; i < u.size(); ++i)
70 inline static Eigen::Matrix<T, R, C>
72 Eigen::Matrix<T, R, C> t;
79 template <
typename T,
int R,
int C>
80 struct promoter<Eigen::Matrix<T, R, C>, Eigen::Matrix<T, R, C> > {
81 inline static void promote(
const Eigen::Matrix<T, R, C>& u,
82 Eigen::Matrix<T, R, C>& t) {
85 inline static Eigen::Matrix<T, R, C>