1 #ifndef STAN__MATH__MATRIX__PROMOTER_HPP
2 #define STAN__MATH__MATRIX__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;
78 template <
typename T,
int R,
int C>
79 struct promoter<Eigen::Matrix<T,R,C>, Eigen::Matrix<T,R,C> > {
80 inline static void promote(
const Eigen::Matrix<T,R,C>& u,
81 Eigen::Matrix<T,R,C>& t) {
84 inline static Eigen::Matrix<T,R,C>
promote_to(
const Eigen::Matrix<T,R,C>& u) {