| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

promote_scalar_type.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_PROMOTE_SCALAR_TYPE_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_PROMOTE_SCALAR_TYPE_HPP
3
4 #include <stan/math/prim/scal/fun/promote_scalar_type.hpp>
5 #include <stan/math/prim/mat/fun/Eigen.hpp>
6 #include <vector>
7
8 namespace stan {
9 namespace math {
10
21 template <typename T, typename S>
22 struct promote_scalar_type<T, Eigen::Matrix<S, Eigen::Dynamic,
23 Eigen::Dynamic> > {
27 typedef Eigen::Matrix<typename promote_scalar_type<T, S>::type,
28 Eigen::Dynamic, Eigen::Dynamic>
29 type;
30 };
31
40 template <typename T, typename S>
41 struct promote_scalar_type<T, Eigen::Matrix<S, Eigen::Dynamic, 1> > {
45 typedef Eigen::Matrix<typename promote_scalar_type<T, S>::type,
46 Eigen::Dynamic, 1>
47 type;
48 };
49
58 template <typename T, typename S>
59 struct promote_scalar_type<T, Eigen::Matrix<S, 1, Eigen::Dynamic> > {
63 typedef Eigen::Matrix<typename promote_scalar_type<T, S>::type,
64 1, Eigen::Dynamic>
65 type;
66 };
67
68 }
69
70 }
71
72 #endif
stan
Definition: log_sum_exp.hpp:8
Eigen
(Expert) Numerical traits for algorithmic differentiation variables.
Definition: Eigen_NumTraits.hpp:9
stan::math::promote_scalar_type< T, Eigen::Matrix< S, Eigen::Dynamic, 1 > >::type
Eigen::Matrix< typename promote_scalar_type< T, S >::type, Eigen::Dynamic, 1 > type
The promoted type.
Definition: promote_scalar_type.hpp:47
stan::math::promote_scalar_type
Template metaprogram to calculate a type for converting a convertible type.
Definition: promote_scalar_type.hpp:15
stan::math::promote_scalar_type< T, Eigen::Matrix< S, Eigen::Dynamic, Eigen::Dynamic > >::type
Eigen::Matrix< typename promote_scalar_type< T, S >::type, Eigen::Dynamic, Eigen::Dynamic > type
The promoted type.
Definition: promote_scalar_type.hpp:29
stan::math::promote_scalar_type< T, Eigen::Matrix< S, 1, Eigen::Dynamic > >::type
Eigen::Matrix< typename promote_scalar_type< T, S >::type, 1, Eigen::Dynamic > type
The promoted type.
Definition: promote_scalar_type.hpp:65
promote_scalar_type.hpp
Eigen.hpp

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