Stan Math Library
2.8.0
reverse mode automatic differentiation
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerator
Friends
Macros
Groups
stan
math
rev
core
print_stack.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_REV_CORE_PRINT_STACK_HPP
2
#define STAN_MATH_REV_CORE_PRINT_STACK_HPP
3
4
#include <
stan/math/rev/core/chainable.hpp
>
5
#include <
stan/math/rev/core/chainable_alloc.hpp
>
6
#include <
stan/math/rev/core/chainablestack.hpp
>
7
#include <
stan/math/rev/core/vari.hpp
>
8
#include <ostream>
9
10
namespace
stan {
11
namespace
math {
12
22
inline
void
print_stack
(std::ostream& o) {
23
o <<
"STACK, size="
<<
ChainableStack::var_stack_
.size() << std::endl;
24
for
(
size_t
i = 0; i <
ChainableStack::var_stack_
.size(); ++i)
25
o << i
26
<<
" "
<<
ChainableStack::var_stack_
[i]
27
<<
" "
<< (static_cast<vari*>(
ChainableStack::var_stack_
[i]))->val_
28
<<
" : "
<< (static_cast<vari*>(
ChainableStack::var_stack_
[i]))->adj_
29
<< std::endl;
30
}
31
32
}
33
}
34
#endif
vari.hpp
chainable.hpp
chainable_alloc.hpp
stan::math::print_stack
void print_stack(std::ostream &o)
Prints the auto-dif variable stack.
Definition:
print_stack.hpp:22
chainablestack.hpp
stan::math::AutodiffStackStorage::var_stack_
static std::vector< ChainableT * > var_stack_
Definition:
autodiffstackstorage.hpp:13
[
Stan Home Page
]
© 2011–2015, Stan Development Team.