$Id: wish_list.omh 3697 2015-06-09 13:59:27Z bradbell $ /* -------------------------------------------------------------------------- CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell CppAD is distributed under multiple licenses. This distribution is under the terms of the Eclipse Public License Version 1.0. A copy of this license is included in the COPYING file of this distribution. Please visit http://www.coin-or.org/CppAD/ for information on other licenses. -------------------------------------------------------------------------- */ $begin WishList$$ $spell op Recomputation jacobian nz RevSparseJac optimizer Rel Gt Eq CondExpLt Checkpointing grep recomputed afun iterator std cos Adolc xml hpp CppAD Atan cppad mul div instantiate instantiation $$ $section The CppAD Wish List$$ $head abort_op_index$$ When a known error is detected during $cref forward$$ or $cref reverse$$ mode, include the operator index in the output error message. (For example, when taking the derivative of the square root function at zero.) The syntax $codei% Independent(%x%, %abort_op_index%) %$$ could then be used to find the corresponding user source code; see $cref/abort_op_index/Independent/abort_op_index/$$. $head Absolute Zero$$ Currently, one must use the $cref zdouble$$ class for $cref mul_level$$ AD that uses $cref/conditional expressions/CondExp/$$ and $cref reverse$$ mode. Perhaps it would be better to use special functions; e.g., $code abs_zero_mul$$ and $code abs_zero_div$$, so that not all multiplies and divides would need to check for zero (in the multiple level AD with conditional expressions and reverse mode case). $head Numeric Limits$$ Define a specialization for $codei% std::numeric_limits< CppAD::AD<%Base%> > %$$ This seems to be OK according to the following paragraph from Section 17.6.4.2.1 of the C++11 standard (Document number N3336) `A program may explicitly instantiate a template defined in the standard library only if the declaration depends on the name of a user-defined type and the instantiation meets the standard library requirements for the original template.' $head Machine Epsilon in Examples$$ Use a multiple of $code std::numeric_limits::epsilon()$$ instead $code 1e-10$$ for a small number in correctness checks; e.g., see $cref sqrt.cpp$$. $head atan2$$ The $cref/atan2/Atan2/$$ function could be made faster by adding a special operator for it. $head Adolc$$ Create a documentation page that shows how to convert Adolc commands to CppAD commands. $head BenderQuad$$ See the $cref/problem/BenderQuad/Problem/$$ with the current $code BenderQuad$$ specifications. $head Checkpointing$$ It would be more flexible to also have a $cref/checkpoint constructor/checkpoint/constructor/$$ that passed in an $cref ADFun$$ object instead of a algorithm. Perhaps the syntax would be $codei% checkpoint %afun%(%name%, %ad_fun%, %copy%) %$$ where $icode copy$$ would determine if a separate copy of $icode ad_fun$$ was made or if a pointer was used. Note that if a pointer is used, it becomes invalid when the destructor for $icode ad_fun$$ is called. $head Conditional Expressions$$ $subhead Nesting$$ If one $cref/optimizes/optimize/$$ the code $codep x = CondExpLt(left_x, right_x, true_x, false_x) y = CondExpGt(left_y, right_y, true_y, false_y) z = CondExpEq(left_z, right_z, x, y) $$ only two of the expressions $code true_x$$, $code false_x$$, $code true_y$$, $code false_y$$ will be evaluated (two will be skipped depending on the result of $code left_z == right_z$$). Not all of the expressions corresponding to $code left_x$$, $code right_x$$, $code left_y$$, $code right_y$$ need to be evaluate, but they are. The optimizer could be improved to skip two more expressions (depending on the result of $code left_z == right_z$$). $subhead Sparsity$$ The $cref/optimizer/optimize/$$ uses $cref/atomic reverse jacobian sparsity/atomic_rev_sparse_jac/$$ to determine which arguments affect the value of the results for the atomic functions (which include $cref checkpoint$$ functions). While the partials of $codei% %z% = CondExp%Rel%( %left%, %right%, %if_true%, %if_false% ) %$$ with respect to $icode left$$ and $icode right$$ always evaluates to zero, the value of $icode z$$ does depend on the value of $icode left$$ and $icode right$$. The $cref checkpoint$$ functions use the value true for $cref/nz_compare/RevSparseJac/nz_compare/$$ when computing reverse jacobian sparsity patterns. This enables the optimizer to properly track the dependencies. An $cref atomic_option$$ should be added so this is only done when the optimizer is using the sparsity pattern for this purpose. $head Forward Mode Recomputation$$ If the results of $cref forward_order$$ have already been computed and are still stored in the $cref ADFun$$ object (see $cref size_order$$), then they do not need to be recomputed and the results can just be returned. $head Iterator Interface$$ All of the CppAD simple vector interfaces should also have an iterator version for the following reasons: $list number$$ It would not be necessary to copy information to simple vectors when it was originally stored in a different type of container. $lnext 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). $lend $head Library$$ $index compile, speed AD$$ $index speed, compile AD$$ $index AD, compile speed$$ One could build a CppAD library for use with the type $code AD$$. This would speed up compilation for the most common usage where the $icode Base$$ type is $code double$$. $head Operation Sequence$$ It is possible to detect if the AD of $icode Base$$ $cref/operation sequence/glossary/Operation/Sequence/$$ does not depend on any of the $cref/independent variable/glossary/Tape/Independent Variable/$$ values. This could be returned as an extra $cref seq_property$$. $head Optimization$$ $subhead Comparison Changes$$ The comparison operators used to not be taped when $cref/NDEBUG/Faq/Speed/NDEBUG/$$ was defined. They are now taped so that the $cref compare_change$$ interface works even for compiler optimize code. This caused a significant slow down in the $cref cppad_det_lu.cpp$$ speed test (with no options specified). Perhaps there should be an option to skip the comparison taping. $subhead Expression Hashing$$ During expression sequence $cref/optimization/optimize/$$, hash codes are used to detect expressions that have already been computed. Perhaps this should be done during the original forward mode recording. $subhead Variable Pairs$$ Suppose that $icode x$$ is a variable and $codei%sin(%x%)%$$ is used in an expression. The extra expression $codei%cos(%x%)%$$ is also computed during a $cref Forward$$ calculation. This is because the derivative of the original expression is expressed in terms of the values of the other expression. In general, the representation of the derivative of an expression to order $icode p$$ may include the derivative of another expression to order $icode%p%-1%$$. In our example, if only the value $codei%sin(%x%)%$$ is requested, it is not necessary to compute $codei%cos(%x%)%$$. We should remove the computation of extra expressions derivatives that are not need to compute the requested derivative of the original expression. $head Preprocessor Symbols$$ $index preprocessor$$ Make sure all the user API preprocessor symbols are listed in the $cref preprocessor$$ section. $head Software Guidelines$$ $subhead Boost$$ The following is a list of some software guidelines taken from $href%http://www.boost.org/development/requirements.html#Guidelines%boost%$$. These guidelines are not followed by the current CppAD source code, but perhaps they should be: $list number$$ Names (except as noted below) should be all lowercase, with words separated by underscores. For example, acronyms should be treated as ordinary names (xml_parser instead of XML_parser). $lnext Template parameter names should begin with an uppercase letter. $lnext Use spaces rather than tabs. Currently, CppAD uses a tabs stops at column multiples of 5. Five columns were chosen to avoid high levels of indenting and to allow for $codep if( expression ) statement else statement $$ with a tab after the else. Automatic conversion to actual spaces should be easy. $lend $head Tracing$$ $index operation, sequence tracing$$ $index sequence, operation tracing$$ $index tracing, operation sequence$$ 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 $codep grep '^# *define *CPPAD_.*_TRACE' cppad/local/*.hpp $$ to find all the possible tracing flags. $end