Automatic Differentiation
 
Loading...
Searching...
No Matches
stan::math::arena_allocator< T > Struct Template Reference

Detailed Description

template<typename T>
struct stan::math::arena_allocator< T >

std library compatible allocator that uses AD stack.

Template Parameters
Ttype of scalar
Warning
The type T needs to be either trivially destructible or the dynamic allocations needs to be managed by the arena_allocator. For example this works:
using my_matrix = std::vector<std::vector<double,
stan::math::arena_allocator<std::vector<double,
std library compatible allocator that uses AD stack.

Definition at line 23 of file arena_allocator.hpp.

#include <arena_allocator.hpp>

Public Types

using value_type = T
 

Public Member Functions

 arena_allocator ()=default
 
 arena_allocator (const arena_allocator &rhs)=default
 
template<class U >
 arena_allocator (const arena_allocator< U > &rhs)
 
T * allocate (std::size_t n)
 Allocates space for n items of type T.
 
void deallocate (T *, std::size_t) noexcept
 No-op.
 
constexpr bool operator== (const arena_allocator &) const noexcept
 Equality comparison operator.
 
constexpr bool operator!= (const arena_allocator &) const noexcept
 Inequality comparison operator.
 

The documentation for this struct was generated from the following file: