Automatic Differentiation
 
Loading...
Searching...
No Matches
index_type.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_META_INDEX_TYPE_HPP
2#define STAN_MATH_PRIM_META_INDEX_TYPE_HPP
3
8#include <type_traits>
9#include <vector>
10
11namespace stan {
12namespace math {
13
24template <typename T, typename = void>
25struct index_type {};
26
32template <typename T>
33struct index_type<T, std::enable_if_t<std::is_pointer<T>::value>> {
34 using type = int;
35};
36
37template <typename T>
39
46template <typename T>
48 using type = typename std::decay_t<T>::size_type;
49};
50
57template <typename T>
59 using type = typename std::decay_t<T>::Index;
60};
61
62} // namespace math
63
64} // namespace stan
65
66#endif
require_t< is_eigen< std::decay_t< T > > > require_eigen_t
Require type satisfies is_eigen.
Definition is_eigen.hpp:55
require_t< is_std_vector< std::decay_t< T > > > require_std_vector_t
Require type satisfies is_std_vector.
typename index_type< T >::type index_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
STL namespace.
typename std::decay_t< T >::Index type
typename std::decay_t< T >::size_type type
Primary template class for the metaprogram to compute the index type of a container.