All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
print_stack.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_REV_CORE_PRINT_STACK_HPP
#define STAN_MATH_REV_CORE_PRINT_STACK_HPP
#include <stan/math/rev/core/chainable.hpp>
#include <stan/math/rev/core/chainable_alloc.hpp>
#include <stan/math/rev/core/chainablestack.hpp>
#include <stan/math/rev/core/vari.hpp>
#include <ostream>
namespace stan {
namespace math {
inline void print_stack(std::ostream& o) {
o << "STACK, size=" << ChainableStack::var_stack_.size() << std::endl;
for (size_t i = 0; i < ChainableStack::var_stack_.size(); ++i)
o << i
<< " " << ChainableStack::var_stack_[i]
<< " " << (static_cast<vari*>(ChainableStack::var_stack_[i]))->val_
<< " : " << (static_cast<vari*>(ChainableStack::var_stack_[i]))->adj_
<< std::endl;
}
}
}
#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.