Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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>
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
std::vector< chainable * > var_stack_
Definition: var_stack.cpp:13
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.