Stan
2.5.0
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
stan
agrad
rev
print_stack.hpp
Go to the documentation of this file.
1
#ifndef STAN__AGRAD__PRINT_STACK_HPP
2
#define STAN__AGRAD__PRINT_STACK_HPP
3
4
#include <ostream>
5
#include <
stan/agrad/rev/var_stack.hpp
>
6
#include <
stan/agrad/rev/vari.hpp
>
7
8
namespace
stan {
9
namespace
agrad {
10
20
inline
void
print_stack
(std::ostream& o) {
21
o <<
"STACK, size="
<<
var_stack_
.size() << std::endl;
22
for
(
size_t
i = 0; i <
var_stack_
.size(); ++i)
23
o << i
24
<<
" "
<<
var_stack_
[i]
25
<<
" "
<< (static_cast<vari*>(
var_stack_
[i]))->val_
26
<<
" : "
<< (static_cast<vari*>(
var_stack_
[i]))->adj_
27
<< std::endl;
28
}
29
30
}
31
}
32
#endif
var_stack.hpp
vari.hpp
stan::agrad::var_stack_
std::vector< chainable * > var_stack_
Definition:
var_stack.cpp:13
stan::agrad::print_stack
void print_stack(std::ostream &o)
Prints the auto-dif variable stack.
Definition:
print_stack.hpp:20
[
Stan Home Page
]
© 2011–2014, Stan Development Team.