\(\newcommand{\W}[1]{ \; #1 \; }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }\) \(\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }\) \(\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} }\) \(\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }\)
chkpoint_two¶
View page sourceCheckpoint Functions: Second Generation¶
Syntax¶
Constructor¶
chkpoint_two
< Base > chk_fun ( fun , name ,Use Checkpoint Function¶
chk_fun ( ax , ay )
new_dynamic¶
chk_fun . new_dynamic
( dynamic )
Reduce Memory¶
You can reduce the size of the tape and memory required for AD using a checkpoint representation of a function \(g : \B{R}^n \rightarrow \B{R}^m\).
Faster Recording¶
It may also reduce the time to make a recording if the same \(g(x)\)
is used many times (with different values) during the
recording of an ADFun
< Base > object.
Repeating Forward¶
Normally, CppAD stores Forward mode results,
until they freed using capacity_order ,
or the corresponding ADFun object is deleted.
This is not true for chkpoint_two
functions
because the same checkpoint function may be used repeatedly
with different arguments during a single forward mode operation.
Thus, forward mode results are computed for each use of chk_fun
in a forward mode sweep.
Operation Sequence¶
The operation sequence representing \(g(x)\) is fixed; i.e., it cannot depend on the value of \(x\).
atomic_three¶
The chkpoint_two
class is derived from atomic_three
,
hence some of its error message will refer to atomic operations.
The chkpoint_two
class implements all the
Virtual Functions
and hence its source code,
include/cppad/core/chkpoint_two/chkpoint_two.hpp
provides an example for atomic_three operations.
The difference is that chkpoint_two.hpp
uses AD
instead of user provided derivatives.
Base¶
The type Base specifies the base type for AD operations;
i.e., chk_fun can be used during the recording of
AD
< Base > operations.
Contents¶
Name |
Title |
---|---|
chkpoint_two_ctor |
|
chkpoint_two_chk_fun |
|
chkpoint_two_dynamic |
|
chkpoint_two_get_started.cpp |
|
chkpoint_two_compare.cpp |
|
chkpoint_two_base2ad.cpp |
|
chkpoint_two_dynamic.cpp |
Checkpoint Functions with Dynamic Parameters: Example and Test |
chkpoint_two_ode.cpp |