Prev Next

@(@\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}} }@)@This is cppad-20221105 documentation. Here is a link to its current documentation .
Checkpoint Functions: Second Generation

Syntax

Constructor
chkpoint_two<Basechk_funfunname,
    
internal_booluse_hes_sparsityuse_base2aduse_in_parallel
)


Use Checkpoint Function
 chk_fun(axay)

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
chkpoint_two_ctorCheckpoint Function Constructor
chkpoint_two_chk_funUsing Checkpoint Functions
chkpoint_two_dynamicDynamic Parameters in Checkpoint Functions
chkpoint_two_get_started.cppGet Started Checkpointing: Example and Test
chkpoint_two_compare.cppCompare With and Without Checkpointing: Example and Test
chkpoint_two_base2ad.cppCheckpointing With base2ad: Example and Test
chkpoint_two_dynamic.cppCheckpoint Functions with Dynamic Parameters: Example and Test
chkpoint_two_ode.cppCheckpointing an ODE Solver: Example and Test

Input File: include/cppad/core/chkpoint_two/chkpoint_two.hpp