| 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
scalar_type_pre.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_META_SCALAR_TYPE_PRE_HPP
2 #define STAN_MATH_PRIM_SCAL_META_SCALAR_TYPE_PRE_HPP
3
4 #include <stan/math/prim/scal/meta/is_vector.hpp>
5 #include <stan/math/prim/mat/meta/is_vector.hpp>
6 #include <stan/math/prim/arr/meta/is_vector.hpp>
7 #include <stan/math/prim/mat/meta/value_type.hpp>
8 #include <stan/math/prim/scal/meta/value_type.hpp>
9
10 namespace stan {
11
12 namespace {
13 template <bool is_vec, typename T, typename T_container>
14 struct scalar_type_helper_pre {
15 typedef T_container type;
16 };
17
18 template <typename T, typename T_container>
19 struct scalar_type_helper_pre<true, T, T_container> {
20 typedef typename
21 scalar_type_helper_pre<is_vector<typename stan::math::value_type<T>::type>
22 ::value,
23 typename stan::math::value_type<T>::type,
24 typename
25 stan::math::value_type<T_container>::type>::type
26 type;
27 };
28 }
29
36 template <typename T>
37 struct scalar_type_pre {
38 typedef typename
39 scalar_type_helper_pre<is_vector
40 <typename stan::math::value_type<T>::type>::value,
41 typename stan::math::value_type<T>::type, T>::type
42 type;
43 };
44
45
46 }
47 #endif
48
stan::scalar_type_pre::type
scalar_type_helper_pre< is_vector< typename stan::math::value_type< T >::type >::value, typename stan::math::value_type< T >::type, T >::type type
Definition: scalar_type_pre.hpp:42
is_vector.hpp
is_vector.hpp
stan::is_vector
Definition: is_vector.hpp:10
value_type.hpp
value_type.hpp
stan::scalar_type_pre
Metaprogram structure to determine the type of first container of the base scalar type of a template ...
Definition: scalar_type_pre.hpp:37
is_vector.hpp
stan::math::value_type
Primary template class for metaprogram to compute the type of values stored in a container.
Definition: value_type.hpp:21

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