Prev Next whats_new_04

@(@\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}} }@)@
Changes and Additions to CppAD During 2004

This section contains a list of the changes plus future plans for CppAD during 2004 (in reverse order by date). The purpose of this section is to assist you in learning about changes between various versions.

The documentation for the CppAD error macros was improved. The package title in cppad was changed. The documentation for CppAD::vector was improved and the corresponding source code cppad/vector.hpp was included.

The LuSolve and OdeRunge source code was modified to make the more in line with the introduction to C++ AD book (OdeRunge has been replaced by Runge45 ). In addition, the examples OdeRunge.cpp and lu_solve.cpp were modified to make the simpler. (The more complex version of OdeRunge.cpp was moved to the TestMore directory.)

The Poly documentation and source code were modified to make them more in line with the introduction to C++ AD book.

Changing to Autoconf and Automake on 08-24 mistakenly forgot the -Wall compiler switch (all warnings). This has been added and the corresponding warnings have been fixed.

The 11-15 Debug version would not compile under Visual C++ version 7.0 because a declaration of LessThanOrZero was missing. This has been fixed.

The ForOne and RevOne easy to use drivers were added.

The notation in the ADFun sections was changed to make the Forward and Reverse routines easier to use.

The Taylor coefficient vector and matrix notation was folded into just Taylor coefficients .

If NDEBUG is not defined during compile time, all AD<Base> comparison operations are checked during zero order forward mode calculations. The CompareChange function returns the number of comparison operations that have changed.

The get_started.cpp example was changed to use the Jacobian driver. In addition, more index entries, that point to the easy to use drivers , were added.

The Microsoft Visual Studio project file example/Example.dsp/ was missing some new examples that needed to be linked in the install windows procedure. This has been fixed.

The unix installation required the user to touch the files to get the dates in proper order. This is no longer necessary.

Some of the dependency directories and files, for example PrintFor/.deps and PrintFor/.deps/PrintFor.Po had an extra ? at the end of their names. This seems to have been fixed by using a newer version of the autoconf and automake tools.

Add the example and test simple_vector.cpp to the SimpleVector documentation.

The specifications for preprocessor symbols state that all the CppAD preprocessor symbols begin with CppAD (so they do not conflict with other packages). Some preprocessor symbols in the file cppad/config.h did began with WITH_. This has been fixed.

The examples hes_lu_det.cpp , hes_minor_det.cpp , jac_lu_det.cpp , and jac_minor_det.cpp used the negative of a size_t value. The value has been changed to an int.

The CppAD::vector template class was converted into a library routine so it can be used separately from the rest of CppAD.

The PrintFor example was moved to its own directory because the conversion from VC 6.0 to VC 7.0 projects did not work when there were multiple executables in one project file. The install instructions were modified to reflect this change.

One declaration (for the Value function) was missing from the file cppad/local/Declare.h. This has been added and CppAD should now compile and run under both Microsoft VC 6.0 and 7.0.

The current version of CppAD has a problem compiling under Microsoft Visual C++ version 7.0 (it compiles and works under version 6.0). The problem appears to be due to a closer agreement between VC 7.0 and the C++ standard for declaring templates functions as friends. Some friend declarations were removed and others were made more specific in order to migrate the a version that will compile and run using VC 7.0.

The example compare.cpp displayed the text from bool_fun.cpp by mistake. This has been fixed.

The Compare operators have been extended to work with int operands.

The test TapeDetLu was added to speed_cppad/DetLuSpeed.cpp and TapeDetMinor was added to speed_cppad/DetMinorSpeed.cpp. These tests just tape the calculations without computing any derivatives. Using this, and the other tests, one can to separate the taping time from the derivative calculation time.

The windows installation steps do not build a config.h file. Hence a default config.h file was added to the distribution for use with Microsoft Visual Studio.

The Distribute section of the developer documentation was brought up to date.

Links to the ADOLC and FADBAD download pages were added to the unix installation instructions.

The include files for the utilities are now included by the root file cppad/cppad.hpp. They can still be included individually with out the rest of the CppAD package.

The routine OdeRunge was modified so that it will now integrate functions of a complex arguments. This was done by removing all uses of greater than and less than comparisons were removed. (OdeRunge has been replaced by Runge45 ).

The changes on 09-21 did not fix all the file date and time problems; i.e., automake was still running in response to the unix installation make command.

There was a reference to B that should have been X in the description of the X argument of LuSolve. This has been fixed.

The CondExp function has been modified so that it works properly for AD< AD<Base> > types; i.e., it now works for multiple levels of taping.

The date of the files aclocal.m4 and were later than the date of top level This caused the make command during the unix installation to try to run autoconf and this did not work on systems with very old versions of autoconf. This has been fixed.

The examples that are specific to an operation were moved to be below that operation in the documentation tree. For example add.cpp is below ad_binary in the documentation tree.

The version released on 04-09-09 did not have the new file PrintFor.h in cppad/local. This has been fixed.

The Base type requirements were simplified.

The Unix installation instructions were modified so just one make command was executed at the top level. This was necessary because the order of the makes is now important (as previously suggested, the makes did not work properly).

The PrintFor function was added so that users can debug the computation of function values at arguments that are different from those used when taping.

In the Unix installation instructions place ./ in front of current directory program names; for example, ./GetStarted instead of GetStarted (because some unix systems do not have the current directory in the default executable path).

A library containing the SpeedTest and NearEqual object files was added to the distribution.

All of the include files of the form <cppad/library/name.h> were moved to <cppad/name.h> .

Some more messages were added to the output of configure during the Unix installation .

The suggested compression program during Windows installation was changed from 7-zip to WinZip .

The error messages printed by the default version of the CppAD error macros had YY-MM-DD in place of the date for the current version. This has been fixed.

All the correctness tests are now compiled with the -g command line option (the speed tests are still compiled with -O2 -DNDEBUG).

The installation instructions for Unix and Windows were split into separate pages.

The installation now automates the replacement of CppAD::vector by either the std::vector or boost::numeric::ublas::vector.

This date marks the first release that uses the Gnu tools Autoconf and Automake. This automates the building of the make files for the installation and is the standard way to distribute open source software. This caused some organizational changes, for example, the GetStarted example now has its own directory and the distribution directory is named
where yy-mm-dd is the year, month and date of the distribution. (Note the distribution directory is different from the directory where CppAD is finally installed.)

Move OdeExplicit into the cppad/library/ directory. In addition, change it so that the vector type was a template argument; i.e., works for any type of vector (not just CppADvector).

Move LuSolve into the cppad/library/ directory. In addition, change it so that the vector type was a template argument; i.e., works for any type of vector (not just CppADvector).

The file cppad/example/NearEqual.h has been moved to cppad/example/NearEqualExt.h because it contains extensions of the NearEqual routine to AD types.

The double and std::complex<double> cases for the NearEqual routine arguments has been moved to the general purpose utilities .

The CppAD error macros names CppADExternalAssert and CppADInternalAssert were changed to CppADUsageError and CppADUnknownError. The SpeedTest routine was changed to use CppADUsageError instead of a C assert.

The SpeedTest output was improved so that the columns of values line up. Previously, this was not the case when the number of digits in the size changed.

Added code to trap and report memory allocation errors during new operations.

A discussion of the order dependence of the assignment operator and the independent function was added to the Faq . In addition, a similar discussion was added to the documentation for the Independent function.

The definition of a parameter and variable were changed to reflect that fact that these are time dependent (current) properties of an AD<Base> object.

All of the arithmetic operators (except for the unary operators) can now accept int arguments. The documentation for these arguments has been changed to reflect this. In addition, the corresponding test cases have been changed to test this and to test high order derivative cases. The old versions of these tests were moved into the cppad/Test directory.

The atan2 function was added.

The asin and acos unary_standard_math functions were added.

There was a bug the reverse mode theory and calculation of derivatives of sqrt for fourth and higher orders. This has been fixed. In addition, the following examples have been changed so that they test derivative up to fifth order: asin , atan , cos , exp , log , sin , sqrt .

There was a bug in the atan function forward mode calculations for Taylor coefficient orders greater than two. This has been fixed.

The sin and cos examples were changed so that they tested higher order derivatives.

The forward mode recursion formulas for each of the standard math functions has been split into separate sections.

A roman (instead of italic) font was used for the name of for the name of each of the standard math functions in the assumption statements below the section for the standard math functions. For example, @(@ \sin(x) @)@ instead of @(@ sin(x) @)@.

In the documentation for Poly , the reference to example/Poly.h was corrected to cppad/library/Poly.h.

In the documentation for SpeedTest , the reference to Lib/SpeedTest.h was corrected to cppad/library/SpeedTest.h. In addition, the example case was corrected.

In Reverse , the definition for @(@ U(t, u) @)@ had @(@ t^p-1 @)@ where it should have had @(@ t^{p-1} @)@. This has been fixed.

The special case where the second argument to the pow function is an int has been added.

Change all of the include syntax
     # include "
to the syntax
     # include <
so that examples and other use better reflect how one would use CppAD after it was installed in a standard include directory; for example /usr/local/include/cppad.

The user documentation was moved from the directory cppad/User to the directory cppad/Doc.

The directory cppad/Lib was moved to cppad/library to reflect that fact that it is not what one expects in a standard lib directory or a standard include directory.

The string YY-MM-DD in the preprocessor symbol CppADVersion was not being replaced by the current date during distribution. This resulted in the CppADExternalAssert macro printing YY-MM-DD where is should have printed the date of distribution. This has been fixed.

All of the include commands of the form
     # include "include/
     # include "lib/
have been changed to the form
     # include "cppad/include/
     # include "cppad/lib/
This will avoid mistakenly loading a file from another package that is in the set of directories being searched by the compiler. It is therefore necessary to specify that the directory above the CppAD directory be searched by the compiler. For example, if CppAD is in /usr/local/cppad, you must specify that /usr/local be searched by the compiler. Note that if /usr/local/cppad/ is no longer searched, you will have to change
     # include "cppad.hpp"
     # include "cppad/cppad.hpp"

The window nmake file Speed/Speed.mak was out of date. This has been fixed.

Move Poly and SpeedTest into the cppad/Lib directory and the CppAD namespace.

The divide operator tests were extended to include a second order derivative calculation using reverse mode.

The Poly routine was modified to be more efficient in the derivative case. In addition, it was changed to use an arbitrary vector for the coefficients (not just a CppADvector).

A reloading of the data base caused the files include/atan.h and include/cos.h to be mistakenly started with lower case letters. These have been moved to include/Atan.h and include/Cos.h respectively.

The Reverse mode calculations for conditional expressions were mistakenly left out. This has been fixed.

The unary functions, such as sin and cos , were not defined for elements of an VecAD vector. This has been fixed.

The operator << was added to the default test_vector template class.

A FADBAD correctness and speed comparison with CppAD was added.

Factor out common sub-expressions in order to make lu_vec_ad.cpp faster.

Convert description from C++ Automatic Differentiation to C++ Algorithmic Differentiation.

The VecAD element class is no longer a derived class of the AD class. This enabled a decrease in tape memory and an increase in the speed for VecAD operations.

The log10 function was added.

Add CondExp and use it to speed up lu_vec_ad.cpp .

Use abs to speed up lu_vec_ad.cpp .

The absolute value function was added.

The value n for OdeExplicit and OdeImplicit is deduced from the argument x0 and is not passed as a separate argument. This documentation has been fixed to this effect.

The += operator did not function correctly when the left hand operand was a parameter and the right hand operand was a variable (found by Mike Dodds ). This has been fixed.

Adding special operators for using parameters to index VecAD objects increased the speed and reduced the memory requirements (by about 20%) for the VecAD case in the speed_cppad/LuSolveSpeed.cpp/ test.

The VecAD objects are not being handled correctly by the Reverse function. The VecAD test was extended to demonstrate the problem and the problem was fixed (it is now part of TestMore/VecAD).

The example lu_vec_ad_ok.cpp uses VecAD to executes different pivoting operations during the solution of linear equations with out having to retape.

The speed test speed_cppad/LuSolveSpeed.cpp/ has been added. It shows that the initial implementation of VecAD is slow (and uses a lot of memory.) In fact, it is faster to use LuSolve and retape for each set of equations than it is to use lu_vec_ad.cpp and not have to retape. This test will help us improve the speed of lu_vec_ad.cpp .

There were bugs in the assignment to VecAD elements during taping that have been fixed. In addition, an example of tapping the pivoting operations in an Lu factorization has been added.

Added size_t indexing to the VecAD class.

Fixed a bug connected to the VecAD class and erasing the tape.

Some memory savings is done with regard to equal parameter values being stored in the tape. There was a bug in this logic when parameter in an AD< AD<Base> > class had values that were variables in the AD<Base> class. This has been fixed.

The name of the class that tapes indexing operations was changed from ADVec to VecAD . This class was extended so that the value of elements in these vectors can be variables (need not be parameters ).

Do some simple searching of the parameter table during taping avoid multiple copies of parameters on tape (use less tape memory).

The version ADVec , a vector class that tapes indexing operations, is now available. It is currently restricted by the fact that all the values in the vector must be parameters .

The internal taping structure has been changed to have variable length instructions. This is to save memory on the tape. In addition, it may help in the implementation of the vector class that tracks indexing. (A now functioning version of this class is described in VecAD .)

A change was made to the way parameter values are stored on the tape. This resulted in a significant savings in the amount of memory required.

Change the return type for SpeedTest from const char * to std::string. The memory required for the largest test cases was added to the speed_cppad tests output.

The comparison between ADOLC and CppAD for the DetLuADOLC.cpp/ example was returning an error (because it was checking for exact equality of calculated derivatives instead of nearly equal). This has been fixed.

The user defined unary functions were removed and the user defined discrete functions were added. These discrete functions add the capability of conditional expressions (alternate calculations) being included in an ADFun object.

The classes det_by_minor and det_by_lu were added and used these to simplify the examples that compute determinants.

The routines Grad and Hess have been removed. You should use Jacobian and Hessian instead.

The driver routines Hessian and RevTwo has been added. These to compute specialized subsets of the second order partials.

Documentation errors in ForTwo and Reverse were fixed. The example documentation was reorganized.

The driver ForTwo has been added. It uses forward mode to compute a subset of the second order partials.

Split all of the "example" and "test" index entries that come from cppad/example/*.cpp into sorted subheadings.

The Grad routine, which only computed first derivatives of scalar valued functions, has been replaced by the Jacobian routine which computes the derivative of vector valued functions.

The bug reported on 02-17 was present in all the operators. These have all been fixed and tests for all the operators have been added to the cppad/Test directory.

The f.Parameter() function was added so that one can count how many components of the range space depend on the value of the domain space components. This helps when deciding whether to use forward or reverse mode.

Special operators were added to distinguish the cases where one of the operands is a parameter . This reduced the amount of branching that is necessary when executing Forward and Reverse calculations.

The Independent and Parameter functions were moved below ADFun in the documentation.

The DetLuADOLC.cpp, DetLu case was added to the ADOLC comparison tests.

Under certain optimization flag values, and on certain systems, an error was reported by the ADOLC correctness comparison. It turned out that CppAD was not initializing a particular index when debugging was turned off. This has been fixed.

A set of routines for comparing CppAD with ADOLC has been added to the distribution. In addition, documentation for compiling and linking the Examples and Speed Tests has been added.

If you use the user defined unary atomic functions there is a restriction on the order of the derivatives that can be calculated. This restriction was documented in the user defined unary function Forward and Reverse . (These unary functions were removed on 03-12 .)

A user interface to arbitrary order reverse mode calculations was implemented. In addition, the ADFun member functions Rev and RevTwo were removed because it is easier to use the uniform syntax below:
Old Syntax Uniform Syntax
r1 = f.Rev(v) r1 = f.Reverse(1, v)
q1 = f.RevTwo(v) r2 = f.Reverse(2, v)
q1[i] == r2[2 * i + 1]

The Theory section has been completely changed so that it corresponds to the arbitrary order calculations. (Some of this change was made when the arbitrary forward mode interface was added on 04-02-15 .

The directory cppad/Test has been added. It contains tests cases that are not intended as examples.

There was a bug in the way CppAD handled the parameters zero and one when they were variables on a lower level tape; i.e. x might be a parameter on an AD< AD<Base> > tape and a its value might be a variable on the AD<Base> tape. This bug in the multiply and divide routines has been fixed.

There was a bug that is some cases reported a divide by zero error when the numerator was zero. This has been fixed.

A bug in Forward prevented the calculation of derivatives with higher order than two. In addition, this checking for user errors in the use of Forward was also faulty. This has been fixed.

The Microsoft project file example\Example.dsp was out of date. This has been fixed.

The example that tapes derivative calculations has been changed to an application of Taylor's method for solving ordinary differential equations.

A user interface to arbitrary order forward mode calculations was implemented. In addition, the ADFun member functions Arg, For and ForTwo were removed because it is easier to use the uniform syntax below:
Old Syntax Uniform Syntax
v0 = f.Arg(u0) v0 = f.Forward(0, u0)
v1 = f.For(u1) v1 = f.Forward(1, u1)
v2 = f.For(u2) v2 = f.Forward(1, u2)

All of the derivative calculations are now done using arbitrary order Taylor arithmetic routines. The Theory section was changed to document this method of calculation.

The definition of a Taylor coefficient was changed to include the factorial factor. This change was also made to the output specifications for the FunForTwo routine.

There were some bugs in the FunArg function that were fixed.
  1. If one of the dependent variables was a parameter FunArg did not set it's value properly. (All its derivatives are zero and this was handled properly.)
  2. The user defined unary functions were not computed correctly.
The specifications for the usage and unknown CppAD error macros were modified so that they could be used with out side effects.

Some corrections and improvements were made to the documentation including: CppADvector was placed before its use, a reference to Ode_ind and Ode_dep was fixed in OdeImplicit.

The specifications for the routine FunForTwo was changed to use Taylor coefficients . This makes the interface to CppAD closer to the interface for ADOLC .
Input File: omh/appendix/whats_new/whats_new_04.omh