| Stan Math Library 2.6.3 probability, sampling & optimization

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
common_type.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_COMMON_TYPE_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_COMMON_TYPE_HPP
3
4 #include <stan/math/prim/mat/fun/Eigen.hpp>
5 #include <boost/math/tools/promotion.hpp>
6 #include <vector>
7
8 namespace stan {
9
10 namespace math {
11
12 template <typename T1, typename T2>
13 struct common_type {
14 typedef typename boost::math::tools::promote_args<T1, T2>::type type;
15 };
16
17 template <typename T1, typename T2>
18 struct common_type<std::vector<T1>, std::vector<T2> > {
19 typedef std::vector<typename common_type<T1, T2>::type> type;
20 };
21
22 template <typename T1, typename T2, int R, int C>
23 struct common_type<Eigen::Matrix<T1, R, C>, Eigen::Matrix<T2, R, C> > {
24 typedef Eigen::Matrix<typename common_type<T1, T2>::type, R, C> type;
25 };
26
27 }
28 }
29
30
31 #endif
stan::math::common_type< std::vector< T1 >, std::vector< T2 > >::type
std::vector< typename common_type< T1, T2 >::type > type
Definition: common_type.hpp:19
stan::math::common_type
Definition: common_type.hpp:13
stan::math::common_type< Eigen::Matrix< T1, R, C >, Eigen::Matrix< T2, R, C > >::type
Eigen::Matrix< typename common_type< T1, T2 >::type, R, C > type
Definition: common_type.hpp:24
Eigen.hpp
stan::math::common_type::type
boost::math::tools::promote_args< T1, T2 >::type type
Definition: common_type.hpp:14

[ Stan Home Page ] © 2011–2015, Stan Development Team.