Stan Math Library  2.8.0
reverse mode automatic differentiation
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
recover_memory_nested.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_CORE_RECOVER_MEMORY_NESTED_HPP
2 #define STAN_MATH_REV_CORE_RECOVER_MEMORY_NESTED_HPP
3 
8 #include <stdexcept>
9 
10 namespace stan {
11  namespace math {
12 
21  static inline void recover_memory_nested() {
22  if (empty_nested())
23  throw std::logic_error("empty_nested() must be false"
24  " before calling recover_memory_nested()");
25 
29 
33 
36  ++i) {
38  }
42 
44  }
45 
46  }
47 }
48 #endif
static bool empty_nested()
Return true if there is no nested autodiff being executed.
void recover_nested()
recover memory back to the last start_nested call.
static std::vector< ChainableAllocT * > var_alloc_stack_
static std::vector< ChainableT * > var_nochain_stack_
static std::vector< size_t > nested_var_nochain_stack_sizes_
static std::vector< size_t > nested_var_stack_sizes_
static void recover_memory_nested()
Recover only the memory used for the top nested call.
static std::vector< ChainableT * > var_stack_
static std::vector< size_t > nested_var_alloc_stack_starts_

     [ Stan Home Page ] © 2011–2015, Stan Development Team.