Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs 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

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