Stan Math Library  2.8.0
reverse mode automatic differentiation
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
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 
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
void print_stack(std::ostream &o)
Prints the auto-dif variable stack.
Definition: print_stack.hpp:22
static std::vector< ChainableT * > var_stack_

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