# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
# SPDX-FileCopyrightText: Bradley M. Bell <bradbell@seanet.com>
# SPDX-FileContributor: 2003-24 Bradley M. Bell
# ----------------------------------------------------------------------------
{xrst_begin chkpoint_two_chk_fun}

Using Checkpoint Functions
##########################

Syntax
******
| *chk_fun* ( *ax* , *ay* )

Purpose
*******
Given *ax* ,
this call computes the corresponding value of *ay* .
If ``AD`` < *Base* > operations are being recorded,
it enters the computation as an :ref:`atomic_three-name`
operation in the recording;
see :ref:`Independent@Start Recording` .

chk_fun
*******
This object must have been created using the
:ref:`chkpoint_two<chkpoint_two_ctor@chk_fun>` constructor.

ADVector
********
The type *ADVector* must be a
:ref:`simple vector class<SimpleVector-name>` with elements of type
``AD`` < *Base* > .

ax
**
This argument has prototype

   ``const`` *ADVector* & ``ax``

and its size equal to *n* = *fun* . ``Domain`` ()
where :ref:`chkpoint_two_ctor@fun` is the ``ADFun`` < *Base* >
function in used the constructor for *chk_fun* .
It specifies vector :math:`x \in \B{R}^n`
at which we are computing an ``AD`` < *Base* > version of
:math:`y = g(x)`.

ay
**
This argument has prototype

   *ADVector* & ``ay``

and its size must be equal to *m* = *fun* . ``Range`` () .
The input values of its elements do not matter.
Upon return, it is an ``AD`` < *Base* > version of
:math:`y = g(x)`.

{xrst_end chkpoint_two_chk_fun}
