Stan Math Library
4.9.0
Automatic Differentiation
|
A class following the RAII idiom to start and recover nested autodiff scopes.
This is the preferred way to use nested autodiff. Example:
var a; // allocated normally { nested_rev_autodiff nested; // Starts nested autodiff
var nested_var; //allocated on the nested stack // Do stuff on the nested stack
// Nested stack is automatically recovered at the end of scope where // nested was declared, including exceptions, returns, etc. } var b;
Definition at line 27 of file nested_rev_autodiff.hpp.
#include <nested_rev_autodiff.hpp>
Public Member Functions | |
nested_rev_autodiff () | |
~nested_rev_autodiff () | |
nested_rev_autodiff (const nested_rev_autodiff &)=delete | |
nested_rev_autodiff & | operator= (const nested_rev_autodiff &)=delete |
void * | operator new (std::size_t)=delete |
void | set_zero_all_adjoints () |
Reset all adjoint values in this nested stack to zero. | |