File: wish_list.xrst

package info (click to toggle)
cppad 2026.00.00.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,588 kB
  • sloc: cpp: 112,960; sh: 6,146; ansic: 179; python: 71; sed: 12; makefile: 10
file content (295 lines) | stat: -rw-r--r-- 9,676 bytes parent folder | download
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
288
289
290
291
292
293
294
295
# 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 wish_list app}
{xrst_spell
   adolc
   grep
   tapeless
}

The CppAD Wish List
###################

See Also
********
:ref:`research-name`

Purpose
*******
The items on this list are improvements and extensions to CppAD
that are currently being considered.

base2ad
*******
It would be nice if :ref:`base2ad-name` functioned as expected with
:ref:`VecAD-name` operations; see :ref:`base2vec_ad.cpp-name` .

Dynamic Parameters
******************

Comparison Operators
====================
The comparisons for dynamic parameters are not being included
in the :ref:`Independent@record_compare` is true.
This should be fixed and included in the
:ref:`compare_change@number` returned by
*f* . ``compare_change`` .
In addition, we will need a way to know if
:ref:`compare_change@op_index` corresponds to a
variable or dynamic parameter operator.

VecAD Vectors
=============
Currently, when a :ref:`VecAD-name` vector only depends on dynamic parameters
it becomes a variable; see :ref:`VecAD@Efficiency` .
This is a simple solution to the problem of having to pass the state of
a vector, when it becomes a variable,
from a dynamic sweep to a zero order forward mode sweep.

Graph Operators
***************
The :ref:`graph_op_enum@Missing Operators` should be
implemented so that they can be include in conversion between :ref:`ADFun-name`
objects and the AD graphs; see :ref:`cpp_ad_graph-name` , :ref:`json_ad_graph-name` .

Reverse Mode
************
Reverse mode calculation of the function
:math:`f : \B{R} \rightarrow \B{R}`  defined by :math:`y = f(x)` where

   *ay* [0] = ``pow`` ( *ax* [0], 0.5) * ``pow`` ( *ax* [0], 0.5)

yields the result zero when :math:`x_0 = 0`;
see the file ``bug/pow.sh`` .
This is a feature of using :ref:`azmul-name` to select which components of
a function are differentiated.
This enables one component to yield :ref:`nan-name` for a partial derivative
while another might not.
If a separate flag was used for which variables are selected,
reverse mode multiplications would not need to be converted to ``azmul``
and the function above would return ``nan`` for the derivative value.
This may also be faster that using ``azmul`` .

Atomic Examples
***************
Convert the remaining
:ref:`atomic_two_examples<atomic_two_example-name>` , and
:ref:`atomic_three_examples<atomic_three_example-name>`
to use the :ref:`atomic_four-name` interface.

{xrst_comment -------------------------------------------------------------- }
Abs-normal
**********

Atomic Functions
================
The :ref:`abs_normal_fun-name` conversion does not handle
atomic functions. This should be fixed.

Return Functions
================
Change the :ref:`abs_normal_fun-name` to return the functions
:ref:`abs_normal_fun@g@z(x, u)` and
:ref:`abs_normal_fun@g@y(x, u)` instead of
:math:`g(x, u)` and :math:`a(x)`.
We can add a utility that computes :math:`a(x)` using
:math:`z(x, u)`, :math:`a_i (x) = | z_i (x, a(x) ) |`
and :math:`z_i` does not depends on :math:`u_j` for :math:`j \geq i`.

Cancellation
============
Avoid cancellation when computing the difference in the absolute value
function at the current point :math:`\hat{x}` the displaced point
:math:`x = \hat{x} + \Delta x`; i.e.,

.. math::

   |z_i (x, \tilde{a}(x) ) | - |z_i (\hat{x}, a(\hat{x}) ) |

{xrst_comment -------------------------------------------------------------- }
cppad_lib
*********

Requirement
===========
Currently ``cppad_lib`` library is only needed if one uses
:ref:`colpack<colpack_prefix-name>` ,
:ref:`json_ad_graph-name` ,
:ref:`cpp_ad_graph-name` , or
:ref:`code_gen_fun-name` ..

inline
======
The C++ ``inline`` specifier is used to avoid multiple copies
of functions (that are not templates) during the link process.
Perhaps some of these functions should be regular functions and part
in the :ref:`colpack_prefix@cppad_lib` library.

Compilation Speed
=================
Perhaps complication speed when using ``AD<double>``
could significantly be increased by including some of it's member functions
in the cppad_lib library.

{xrst_comment ------------------------------------------------------------- }
checkpoint
**********

Tapeless AD
===========
Perhaps there should be a version of the
:ref:`chkpoint_two-name`
class that uses a tapeless AD package to compute
the derivative values.
This would allow for algorithms where the operations sequence
depends on the independent variable values.
There is a question as to how sparsity patterns would be determined
in this case.
Perhaps they would be passed into the constructor.
If it was known to be constant,
the user could compute the pattern using CppAD.
Otherwise, the user could input
a conservative estimate of the pattern that would be correct.

Re-taping
=========
Perhaps the ``checkpoint`` class should allow for re-taping
derivative values.
This would also allow for algorithms where the operations sequence
depends on the independent variable values.
Perhaps (as for tapeless entry above)
the sparsity pattern should be passed into the constructor.

Testing
=======
There should be some examples and tests for both speed and memory use
that demonstrate that checkpointing is useful.

{xrst_comment -------------------------------------------------------------- }
Subgraph
********

Forward Mode
============
The :ref:`subgraph_jac_rev-name` routine computes sparsity patterns
of Jacobians using reverse mode.
It is possible that a forward mode version of this method would be
better for some cases.

Sparsity
========
The :ref:`subgraph_sparsity-name` calculation treats
each atomic function call as if
all of its outputs depend on all of its inputs;
see :ref:`subgraph_sparsity@Atomic Function` .
These sparsity patterns could be made more efficient
(could have fewer possibly non-zeros entries)
by using the sparsity patterns for the atomic functions.

{xrst_comment -------------------------------------------------------------- }

check_finite
************

#. Sometimes one only gets infinite value during zero order forward
   and nan when computing corresponding derivatives.
   Change :ref:`check_for_nan-name` to ``check_finite``
   (not infinite or nan) so that error detection happens during zero
   order forward instead of later.
#. In addition, the current :ref:`check_for_nan-name` writes the corresponding
   zero order values to a temporary file.
   It would be nice if the ``check_finite`` routine made writing
   the zero order values optional.

test_boolofvoid
***************
For general purpose use, the :ref:`test_boolofvoid-name` should be usable
without including a memory check at the end.

Example
*******
Split the :ref:`example list<list_all_examples-name>`
into separate groups by the corresponding example subdirectory.

{xrst_comment ------------------------------------------------------------ }
Optimization
************

Atomic Functions
================
There is some confusion as to the value of the Taylor coefficients
for atomic function arguments and results that have been optimized out.
See :ref:`optimize@Atomic Functions` in optimize,
:ref:`2021@mm-dd@02-16` in whats new for 2021,
:ref:`atomic_three_rev_depend@depend_x@Optimize`
in atomic_three, and
:ref:`atomic_four_rev_depend@depend_x@Optimize` in atomic_four.

Taping
======
Perhaps some of the optimization done while taping forward mode
should be delayed to the ``optimization`` step.

Special Operators
=================
Add special operators that can be implemented more efficiently, e.g.,

   ``square`` ( *x* ) = *x* * *x*

and have the optimizer recognize when they should be used.
(They could also be in the user API, but it would not be expected
that the user would use them.)

{xrst_comment --------------------------------------------------------------}

Base Requirements
*****************
Change the :ref:`Base requirements<base_require-name>` to use template
specialization instead of functions so that there is a default value
for each function. The default would result in a
:ref:`cppad_assert@Known` assert when the operation is used and not
defined by the base class.
An example of this type of template specialization can be found in
the implementation of :ref:`to_string-name` .

Adolc
*****
Create a documentation page that shows how to convert Adolc commands to
CppAD commands.

Forward Mode Recomputation
**************************
If the results of :ref:`forward_order-name` have already been computed and are still
stored in the :ref:`ADFun-name` object (see :ref:`size_order-name` ),
then they do not need to be recomputed and the results can just be returned.

Iterator Interface
******************
All of the CppAD simple vector interfaces should also have an
iterator version for the following reasons:

#. It would not be necessary to copy information to simple vectors
   when it was originally stored in a different type of container.
#. It would not be necessary to reallocate memory for a result that is
   repeatedly calculated
   (because an iterator for the result container would be passed in).

Tracing
*******
Add tracing the operation sequence to the user API and documentation.
Tracing the operation sequence is currently done by changing the CppAD
source code. Use the command
::

   grep '^# *define *CPPAD_.*_TRACE' cppad/local/sweep\*.hpp

to find all the possible tracing flags.

atan2
*****
The :ref:`Atan2-name` function could be made faster by adding
a special operator for it.

{xrst_end wish_list}