| Stan Math Library 2.11.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

autodiffstackstorage.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_CORE_AUTODIFFSTACKSTORAGE_HPP
2 #define STAN_MATH_REV_CORE_AUTODIFFSTACKSTORAGE_HPP
3
4 #include <stan/math/memory/stack_alloc.hpp>
5 #include <vector>
6
7 namespace stan {
8 namespace math {
9
10 template<typename ChainableT,
11 typename ChainableAllocT>
12 struct AutodiffStackStorage {
13 static std::vector<ChainableT*> var_stack_;
14 static std::vector<ChainableT*> var_nochain_stack_;
15 static std::vector<ChainableAllocT*> var_alloc_stack_;
16 static stack_alloc memalloc_;
17
18 // nested positions
19 static std::vector<size_t> nested_var_stack_sizes_;
20 static std::vector<size_t> nested_var_nochain_stack_sizes_;
21 static std::vector<size_t> nested_var_alloc_stack_starts_;
22 };
23
24 template<typename ChainableT, typename ChainableAllocT>
25 std::vector<ChainableT*>
26 AutodiffStackStorage<ChainableT, ChainableAllocT>::var_stack_;
27
28 template<typename ChainableT, typename ChainableAllocT>
29 std::vector<ChainableT*>
30 AutodiffStackStorage<ChainableT, ChainableAllocT>::var_nochain_stack_;
31
32 template<typename ChainableT, typename ChainableAllocT>
33 std::vector<ChainableAllocT*>
34 AutodiffStackStorage<ChainableT, ChainableAllocT>::var_alloc_stack_;
35
36 template<typename ChainableT, typename ChainableAllocT>
37 stack_alloc
38 AutodiffStackStorage<ChainableT, ChainableAllocT>::memalloc_;
39
40 template<typename ChainableT, typename ChainableAllocT>
41 std::vector<size_t>
42 AutodiffStackStorage<ChainableT, ChainableAllocT>::nested_var_stack_sizes_;
43
44 template<typename ChainableT, typename ChainableAllocT>
45 std::vector<size_t>
46 AutodiffStackStorage<ChainableT, ChainableAllocT>
47 ::nested_var_nochain_stack_sizes_;
48
49 template<typename ChainableT, typename ChainableAllocT>
50 std::vector<size_t>
51 AutodiffStackStorage<ChainableT, ChainableAllocT>
52 ::nested_var_alloc_stack_starts_;
53
54 }
55 }
56 #endif
stan
Definition: log_sum_exp.hpp:8
stan::math::AutodiffStackStorage::memalloc_
static stack_alloc memalloc_
Definition: autodiffstackstorage.hpp:16
stan::math::AutodiffStackStorage::var_alloc_stack_
static std::vector< ChainableAllocT * > var_alloc_stack_
Definition: autodiffstackstorage.hpp:15
stan::math::AutodiffStackStorage::var_nochain_stack_
static std::vector< ChainableT * > var_nochain_stack_
Definition: autodiffstackstorage.hpp:14
stan::math::AutodiffStackStorage::nested_var_nochain_stack_sizes_
static std::vector< size_t > nested_var_nochain_stack_sizes_
Definition: autodiffstackstorage.hpp:20
stan::math::AutodiffStackStorage::nested_var_stack_sizes_
static std::vector< size_t > nested_var_stack_sizes_
Definition: autodiffstackstorage.hpp:19
stack_alloc.hpp
stan::math::AutodiffStackStorage
Definition: autodiffstackstorage.hpp:12
stan::math::AutodiffStackStorage::var_stack_
static std::vector< ChainableT * > var_stack_
Definition: autodiffstackstorage.hpp:13
stan::math::stack_alloc
An instance of this class provides a memory pool through which blocks of raw memory may be allocated ...
Definition: stack_alloc.hpp:74
stan::math::AutodiffStackStorage::nested_var_alloc_stack_starts_
static std::vector< size_t > nested_var_alloc_stack_starts_
Definition: autodiffstackstorage.hpp:21

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