| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 namespace math {
10
11 template <typename T1, typename T2>
12 struct common_type {
13 typedef typename boost::math::tools::promote_args<T1, T2>::type type;
14 };
15
16 template <typename T1, typename T2>
17 struct common_type<std::vector<T1>, std::vector<T2> > {
18 typedef std::vector<typename common_type<T1, T2>::type> type;
19 };
20
21 template <typename T1, typename T2, int R, int C>
22 struct common_type<Eigen::Matrix<T1, R, C>, Eigen::Matrix<T2, R, C> > {
23 typedef Eigen::Matrix<typename common_type<T1, T2>::type, R, C> type;
24 };
25
26 }
27 }
28
29 #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:18
stan
Definition: log_sum_exp.hpp:8
stan::math::common_type
Definition: common_type.hpp:12
std
Definition: std_numeric_limits.hpp:7
Eigen
(Expert) Numerical traits for algorithmic differentiation variables.
Definition: Eigen_NumTraits.hpp:9
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:23
Eigen.hpp
stan::math::common_type::type
boost::math::tools::promote_args< T1, T2 >::type type
Definition: common_type.hpp:13

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