Stan Math Library
2.20.0
reverse mode automatic differentiation
stan
math
prim
scal
meta
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/scal/meta/value_type.hpp
>
6
7
namespace
stan
{
8
namespace
internal {
9
template
<
bool
is_vec,
typename
T,
typename
T_container>
10
struct
scalar_type_helper_pre
{
11
typedef
T_container
type
;
12
};
13
14
template
<
typename
T,
typename
T_container>
15
struct
scalar_type_helper_pre
<true, T, T_container> {
16
typedef
typename
scalar_type_helper_pre
<
17
is_vector<typename stan::math::value_type<T>::type
>::value,
18
typename
stan::math::value_type<T>::type
,
19
typename
stan::math::value_type<T_container>::type
>
::type
type
;
20
};
21
}
// namespace internal
22
29
template
<
typename
T>
30
struct
scalar_type_pre
{
31
typedef
typename
internal::scalar_type_helper_pre
<
32
is_vector<typename stan::math::value_type<T>::type
>::value,
33
typename
stan::math::value_type<T>::type
, T>
::type
type
;
34
};
35
36
}
// namespace stan
37
#endif
stan
Definition:
log_sum_exp.hpp:8
is_vector.hpp
stan::is_vector
Definition:
is_vector.hpp:10
stan::internal::scalar_type_helper_pre
Definition:
scalar_type_pre.hpp:10
stan::scalar_type_pre::type
internal::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:33
stan::internal::scalar_type_helper_pre< true, T, T_container >::type
scalar_type_helper_pre< is_vector< typename stan::math::value_type< T >::type >::value, typename stan::math::value_type< T >::type, typename stan::math::value_type< T_container >::type >::type type
Definition:
scalar_type_pre.hpp:19
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:30
stan::internal::scalar_type_helper_pre::type
T_container type
Definition:
scalar_type_pre.hpp:11
stan::math::value_type
Primary template class for metaprogram to compute the type of values stored in a container.
Definition:
value_type.hpp:18
[
Stan Home Page
]
© 2011–2018, Stan Development Team.