Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ to_arena() [3/6]

template<typename T , require_same_t< T, arena_t< T > > * = nullptr, require_not_matrix_cl_t< T > * = nullptr, require_not_std_vector_t< T > * = nullptr>
std::remove_reference_t< T > stan::math::to_arena ( T &&  a)
inline

Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered.

For types that already have this property (including scalars and var_values) this is a no-op.

Passing in a lvalue reference to objects not using AD stack, such as a matrix_cl is inefficient as they need to be copied in this case.

Template Parameters
Ttype of scalar
Parameters
aargument
Returns
argument

Definition at line 49 of file to_arena.hpp.