Loading [MathJax]/extensions/TeX/AMSsymbols.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
arena_type.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_REV_META_ARENA_TYPE_HPP
2#define STAN_MATH_REV_META_ARENA_TYPE_HPP
3
11
12namespace stan {
13
14namespace internal {
15template <typename T, typename = void, typename = void>
17
18template <typename T>
20 T, require_t<std::is_base_of<stan::math::chainable_alloc, T>>> {
21 using type = T;
22};
23
24template <typename T>
25struct arena_type_impl<T, require_all_t<std::is_trivially_destructible<T>,
26 bool_constant<!is_eigen<T>::value>>> {
27 using type = T;
28};
29
30template <typename T, typename Alloc>
31struct arena_type_impl<std::vector<T, Alloc>> {
32 using T_ad = typename arena_type_impl<std::decay_t<T>>::type;
33 using type = std::vector<T_ad, math::arena_allocator<T_ad>>;
34};
35
36template <typename T>
38 T, require_eigen_t<T>,
39 std::enable_if_t<T::RowsAtCompileTime == Eigen::Dynamic
40 || T::ColsAtCompileTime == Eigen::Dynamic>> {
42};
43
44template <typename T>
46 T, require_eigen_t<T>,
47 std::enable_if_t<T::RowsAtCompileTime != Eigen::Dynamic
48 && T::ColsAtCompileTime != Eigen::Dynamic>> {
50};
51
52} // namespace internal
53
59template <typename T>
61
62} // namespace stan
63
64#endif
Equivalent to Eigen::Matrix, except that the data is stored on AD stack.
require_t< is_eigen< std::decay_t< T > > > require_eigen_t
Require type satisfies is_eigen.
Definition is_eigen.hpp:113
std::integral_constant< bool, B > bool_constant
Alias for structs used for wraps a static constant of bool.
typename plain_type< std::decay_t< T > >::type plain_type_t
typename internal::arena_type_impl< std::decay_t< T > >::type arena_t
Determines a type that can be used in place of T that does any dynamic allocations on the AD stack.
std::enable_if_t< Check::value > require_t
If condition is true, template is enabled.
std::enable_if_t< math::conjunction< Checks... >::value > require_all_t
If all conditions are true, template is enabled Returns a type void if all conditions are true and ot...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
STL namespace.
typename arena_type_impl< std::decay_t< T > >::type T_ad
std::vector< T_ad, math::arena_allocator< T_ad > > type