1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
|
# 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 glossary app}
{xrst_spell
is is
}
Glossary
########
AD Function
***********
Given an :ref:`ADFun-name` object *f*
there is a corresponding
AD of *Base* :ref:`operation sequence<glossary@Operation@Sequence>` .
This operation sequence
defines a function
:math:`F : \B{R}^n \rightarrow \B{R}^m`
where :math:`\B{R}` is the space corresponding to objects of type
*Base* (usually the real numbers),
*n* is the size of the :ref:`fun_property@Domain` space, and
*m* is the size of the :ref:`fun_property@Range` space.
We refer to :math:`F` as the AD function corresponding to
the operation sequence stored in the object *f* .
(See the :ref:`FunCheck discussion<FunCheck@Discussion>` for
possible differences between :math:`F(x)` and the algorithm that defined
the operation sequence.)
AD of Base
**********
An object is called an AD of *Base* object its type is
either ``AD`` < *Base* >
(see the default and copy :ref:`constructors<ad_ctor-name>`
or ``VecAD`` < *Base* >:: ``reference`` (see :ref:`VecAD-name` )
for some *Base* type.
AD Type Above Base
******************
If *Base* is a type,
an AD type above *Base*
is the following sequence of types:
``AD`` < *Base* > , ``AD< AD<`` *Base* > > , ``AD< AD< AD<`` *Base* > > > , ...
Base Function
*************
A function :math:`f : \B{R} \rightarrow \B{R}`
is referred to as a *Base* function,
if *Base* is a C++ type that represent elements of
the domain and range space of *f* .
Base Type
*********
If *x* is an ``AD`` < *Base* > object,
*Base* is referred to as the base type for *x* .
Elementary Vector
*****************
The *j*-th elementary vector :math:`e^j \in \B{R}^m` is defined by
.. math::
e_i^j = \left\{ \begin{array}{ll}
1 & {\rm if} \; i = j \\
0 & {\rm otherwise}
\end{array} \right.
Operation
*********
Atomic
======
An atomic *Type* operation is an operation that
has a *Type* result and is not made up of other
more basic operations.
Sequence
========
A sequence of atomic *Type* operations
is called a *Type* operation sequence.
A sequence of atomic :ref:`glossary@AD of Base` operations
is referred to as an AD of *Base* operation sequence.
The abbreviated notation operation sequence is often used
when it is not necessary to specify the type.
Dependent
=========
Suppose that *x* and *y* are *Type* objects and
the result of
*x* < *y*
has type ``bool`` (where *Type* is not the same as ``bool`` ).
If one executes the following code
| |tab| ``if`` ( *x* < *y* )
| |tab| |tab| *y* = ``cos`` ( *x* );
| |tab| ``else``
| |tab| |tab| *y* = ``sin`` ( *x* );
the choice above depends on the value of *x* and *y*
and the two choices result in a different *Type* operation sequence.
In this case, we say that the *Type* operation sequence depends
on *x* and *y* .
Independent
===========
Suppose that *i* and *n* are ``size_t`` objects,
and *x* [ *i* ] , *y* are *Type* objects,
where *Type* is different from ``size_t`` .
The *Type* sequence of operations corresponding to
| |tab| *y* = *Type* (0);
| |tab| ``for`` ( *i* = 0; *i* < *n* ; *i* ++)
| |tab| |tab| *y* += *x* [ *i* ];
does not depend on the value of *x* or *y* .
In this case, we say that the *Type* operation sequence
is independent of *y* and the elements of *x* .
Parameter
*********
Constant
========
An ``AD`` < *Base* > object *u* is a constant parameter if
its value does not depend on the value of
the :ref:`Independent-name` variable vector
or the :ref:`Independent@dynamic` parameter vector
for an :ref:`active tape<glossary@Tape@Active>` .
If *u* is a constant parameter,
:ref:`Constant(u)<con_dyn_var@Constant>` returns true,
:ref:`Parameter(u)<con_dyn_var@Parameter>` returns true,
:ref:`Dynamic(u)<con_dyn_var@Dynamic>` returns false, and
:ref:`Variable(u)<con_dyn_var@Variable>` returns false.
Dynamic
=======
An ``AD`` < *Base* > object *u* is a dynamic parameter if
its value does not depend on the value of
the :ref:`Independent-name` variable vector, but its value does depend
on the :ref:`Independent@dynamic` parameter vector,
for an :ref:`active tape<glossary@Tape@Active>` .
If *u* is a dynamic parameter, the function
:ref:`Dynamic(u)<con_dyn_var@Dynamic>` returns true
:ref:`Parameter(u)<con_dyn_var@Parameter>` returns true,
:ref:`Constant(u)<con_dyn_var@Constant>` returns false, and
:ref:`Variable(u)<con_dyn_var@Variable>` returns false.
Row-major Representation
************************
A :ref:`SimpleVector-name` *v* is a row-major representation of a matrix
:math:`M \in \B{R}^{m \times n}` if *v* . ``size`` () == *m* * *n* and
for :math:`i = 0 , \ldots , m-1`, :math:`j = 0 , \ldots , n-1`
.. math::
M_{i,j} = v[ i \times n + j ]
Sparsity Pattern
****************
Suppose that :math:`A \in \B{R}^{m \times n}` is a sparse matrix.
CppAD has several ways to specify the elements of :math:`A`
that are possible non-zero.
Row and Column Index Vectors
============================
A pair of non-negative integer vectors :math:`r`, :math:`c`
are a sparsity pattern for :math:`A`
if for every non-zero element :math:`A_{i,j}`,
there is a :math:`k` such that :math:`i = r_k` and :math:`j = c_k`.
Furthermore, for every :math:`\ell \neq k`,
either :math:`r_\ell \neq r_k` or :math:`c_\ell \neq c_k`.
Boolean Vector
==============
A boolean vector :math:`b`, of length :math:`m \times n`,
is a sparsity pattern for :math:`A`
if for every non-zero element :math:`A_{i,j}`,
:math:`b_{i \times n + j}` is true.
Vector of Sets
==============
A vector of sets :math:`s` of positive integers, of length :math:`m`,
is a sparsity pattern for :math:`A`
if for every non-zero element :math:`A_{i,j}`, :math:`j \in s_i`.
Tape
****
Active
======
A new tape is created and becomes active
after each call of the form (see :ref:`Independent-name` )
``Independent`` ( *x* )
All operations that depend on the elements of *x* are
recorded on this active tape.
Inactive
========
The :ref:`operation sequence<glossary@Operation@Sequence>`
stored in a tape can be transferred to a function object using the syntax
| |tab| ``ADFun`` < *Base* > *f* ( *x* , *y* )
| |tab| *f* . ``Dependent`` ( *x* , *y* )
see :ref:`fun_construct-name` .
After such a transfer, the tape becomes inactive.
The tape becomes inactive, without storing the operation sequence,
after a call to :ref:`abort_recording-name` .
Independent Variable
====================
While the tape is active, we refer to the elements of *x*
as the independent variables for the tape.
When the tape becomes inactive,
the corresponding objects become
:ref:`constants<glossary@Parameter@Constant>` .
Variables
=========
While the tape is active, we use the term variables for any scalar
whose value depends on the independent variables for the tape.
When the tape becomes inactive,
the corresponding objects become
:ref:`constants<glossary@Parameter@Constant>` .
Taylor Coefficient
******************
Suppose :math:`X : \B{R} \rightarrow \B{R}^n` is a
is :math:`p` times continuously differentiable function
in some neighborhood of zero.
For :math:`k = 0 , \ldots , p`,
we use the column vector :math:`x^{(k)} \in \B{R}^n` for the *k*-th order
Taylor coefficient corresponding to :math:`X`
which is defined by
.. math::
x^{(k)} = \frac{1}{k !} \Dpow{k}{t} X(0)
It follows that
.. math::
X(t) = x^{(0)} + x^{(1)} t + \cdots + x^{(p)} t^p + R(t)
where the remainder :math:`R(t)` divided by :math:`t^p`
converges to zero and :math:`t` goes to zero.
Variable
********
An ``AD`` < *Base* > object *u* is a variable if
its value depends on an independent variable vector for
a currently :ref:`active tape<glossary@Tape@Active>` .
If *u* is a variable,
:ref:`Variable(u)<con_dyn_var@Variable>` returns true,
:ref:`Constant(u)<con_dyn_var@Constant>` returns false,
:ref:`Dynamic(u)<con_dyn_var@Dynamic>` returns false, and
:ref:`Parameter(u)<con_dyn_var@Parameter>` returns false.
For example,
directly after the code sequence
| |tab| ``Independent`` ( *x* );
| |tab| ``AD<double>`` *u* = *x* [0];
the ``AD<double>`` object *u* is currently a variable.
Directly after the code sequence
| |tab| ``Independent`` ( *x* );
| |tab| ``AD<double>`` *u* = *x* [0];
| |tab| *u* = 5;
*u* is currently a
:ref:`glossary@Parameter@Constant` parameter,
not a dynamic parameter or a variable.
Note that we often drop the word currently and
just refer to an ``AD`` < *Base* > object as a variable
or parameter.
{xrst_end glossary}
|