lines 6-877 of file: appendix/whats_new/05.xrst {xrst_begin whats_new_05 app} {xrst_spell callable colons dlib dsp dsw dussault gz kutta linux macros maxabs pkzip postfix reoccurs romberg scur segmentation sln temporaries typedef valarray vcproj yy } Changes and Additions to CppAD During 2005 ########################################## mm-dd ***** 12-24 ===== Fix a memory leak that could occur during the :ref:`ForSparseJac-name` calculations. 12-23 ===== The buffers that are used to do :ref:`RevSparseJac-name` and :ref:`RevSparseHes-name` calculations are now freed directly after use. The TrackNewDel.cpp example was missing from the Windows install examples and testing project file. This has been fixed. 12-22 ===== The buffer that is are used to do :ref:`Reverse-name` mode calculations is now freed directly after use. This reduces the memory requirements attached to an :ref:`ADFun-name` object. 12-20 ===== Buffers that are used to store the tape information corresponding to the ``AD`` < *Base* > type are now freed when the corresponding :ref:`ADFun-name` object is constructed. This reduces memory requirements and actually had better results with the :ref:`speed_cppad-name` tests. The :ref:`speed_cppad-name` test program now outputs the version of CppAD at the top (to help when comparing output between different versions). 12-19 ===== The :ref:`track_new_del-name` routines were added for track memory allocation and deletion with ``new[]`` and ``delete[]`` . This is in preparation for making CppAD more efficient in it's use of memory. The bug mentioned on :ref:`whats_new_05@mm-dd@12-01` resurfaced and the corresponding routine was changed as follows: :: static local::ADTape *Tape(void) { // If we return &tape, instead of creating and returning ptr, // there seems to be a bug in g++ with -O2 option. static local::ADTape tape; static local::ADTape *ptr = &tape; return ptr; } 12-16 ===== The :ref:`NearEqual-name` function documentation for the relative error case was changed to | *x* ``-`` *y* | <= *r* * ( | *x* | + | *y* | ) so that there is no problem with division by zero when *x* and *y* are zero (the code was changed to that form also). The ``std::abs`` function replaced the direct computation of the complex norms (for the complex case in ``NearEqual`` ). In addition, more extensive testing was done in :ref:`near_equal.cpp-name` . 12-15 ===== Extend :ref:`NearEqual-name` and :ref:`near_equal_ext-name` to cover more cases while converting them from, a library function in ``lib/CppADlib.a`` and an utility in ``example/NearEqualExt.h`` , to a template functions in ``cppad/near_equal.hpp`` and ``cppad/local/NearEqualExt.h`` . This is another step along the way of removing the entire ``CppADlib.a`` library. The change on :ref:`whats_new_05@mm-dd@12-14` broke the Microsoft project files ``example/Example.sln`` and ``TestMore/TestMore.sln`` used during CppAD installation on Windows. This has been fixed. Move ``lib/SpeedTest.cpp`` to ``cppad/speed_test.hpp`` . This was the last change necessary in order to remove the CppAD library, so remove all commands related to building and linking ``CppADlib.a`` . The corresponding entry has been removed from the :ref:`wish_list-name` . One of the entries in the :ref:`wish_list-name` corresponded to the :ref:`Integer-name` function. It has also been removed (because it is already implemented). 12-14 ===== Extend :ref:`erf-name` to cover more cases while converting it from a function in ``lib/CppADlib.a`` to a template function in ``cppad/local/Erf.h`` . This is one step along the way of removing the entire ``CppADlib.a`` library. 12-11 ===== Group routines that extend the domain for which an :ref:`ADFun-name` object is useful into the ExtendDomain section. Add an example of a C callable routine that computes derivatives using CppAD (see :ref:`interface2c.cpp-name` ). 12-08 ===== Split out :ref:`LuFactor-name` with the *ratio* argument to a separate function called :ref:`LuRatio-name` . This needed to be done because :ref:`LuRatio-name` is more restrictive and should not be part of the general template :ref:`utilities` . 12-07 ===== Improve :ref:`CheckSimpleVector-name` so that it tests element assignment. Change :ref:`check_simple_vector.cpp-name` so that it provides and example and test of a case where a simple vector returns a type different from the element type and the element assignment returns ``void`` . 12-06 ===== The specifications for a :ref:`SimpleVector-name` template class were extended so that the return type of an element access is not necessarily the same as the type of the elements. This enables us to include ``std::vector`` which packs multiple elements into a single storage location and returns a special type on element access (not the same as ``bool`` ). To be more specific, if *x* is a ``std::vector`` object and *i* has type ``size_t`` , *x* [ *i* ] does not have type ``bool`` . Add a Home icon, that links to the `CppAD home page `_, to the top left of the navigation frame (left frame) for each documentation section. 12-05 ===== The :ref:`RevSparseHes-name` reverse mode Hessian sparsity calculation has been added. The definition of a :ref:`glossary@Sparsity Pattern` has been corrected to properly correspond to the more efficient form mentioned under :ref:`whats_new_05` below. The dates in this file used to correspond to local time for when the change was checked into the `subversion repository `_. From now on the dates in this file will correspond to the first version of CppAD where the change appears; i.e., the date in the unix and windows download file names ``CppAD-`` *yy* ``-`` *mm* ``-`` *dd* . 12-03 ===== There was a bug in the :ref:`RevSparseJac-name` reverse mode sparsity patterns when used with :ref:`VecAD-name` calculations. This bug was fixed and the calculations were made more efficient (fewer true entries). 12-02 ===== There was a bug in the :ref:`ForSparseJac-name` forward mode sparsity patterns when used with :ref:`VecAD-name` calculations. This bug was fixed and the calculations were made more efficient (fewer true entries). 12-01 ===== The speed test of :ref:`lu_vec_ad.cpp-name` has been reinstated. It appears that there is some sort of bug in the gcc compiler with the -O2 option whereby the following member function :: static local::ADTape *Tape(void) { static local::ADTape tape; return &tape; } (in ``cppad/local/AD.h`` ) would sometimes return a null value (during :ref:`VecAD-name` operations). A speed improvement in ``cppad/local/ExtendBuffer.h`` seems to prevent this problem. This fix is not well understood; i.e., we should watch to see if this problem reoccurs. The source code for :ref:`lu_vec_ad_ok.cpp-name` was mistakenly used for ``speed_cppad/LuSolveSpeed.cpp`` . This has been fixed. 11-23 ===== The speed test of :ref:`lu_vec_ad.cpp-name` has been commented out because it sometimes generates a segmentation fault. Here is an explanation: If *X* is a ``AD`` < *Base* > object, *y* is a *Base* object, *X* [ *y* ] uses pointer from the element back to the original vector. Optimizing compilers might reorder operations so that the vector is destroyed before the object is used. This can be avoided by changing the syntax for :ref:`VecAD-name` objects to use ``set`` and ``get`` member functions. 11-22 ===== A much better :ref:`example` for using :ref:`VecAD-name` vectors has been provided. In addition, a bug in the computation of derivatives using ``VecAD`` vectors has been fixed. CppAD now checks that the domain dimension during :ref:`Independent-name` and the range dimension during :ref:`ADFun-name` (provided that ``-DNDEBUG`` is not defined). If either of these is zero, the ``CppADUsageError`` macro is invoked. 11-20 ===== The sparsity pattern routines :ref:`ForSparseJac-name` and :ref:`RevSparseJac-name` have been modified so that they are relative to the Jacobian at a single argument value. This enables us to return more efficient :ref:`sparsity patterns` . An extra :ref:`exception::reference@Exceptions>` has been added to the use of :ref:`VecAD-name` elements. This makes ``VecAD`` some what more efficient. 11-19 ===== Improve the output messages generated during execution of the :ref:`configure@Configure` command. Put a try and catch block around all of the uses of ``new`` so that if a memory allocation error occurs, it will generate a ``CppADUsageError/`` message. The :ref:`get_started.cpp-name` example has been simplified so that it is easier to understand. 11-15 ===== Fix a memory leak in both the :ref:`ForSparseJac-name` and :ref:`RevSparseJac-name` calculations. 11-12 ===== Add reverse mode :ref:`Jacobian sparsity` calculation. 11-09 ===== Add prototype documentation for :ref:`LuSolve@logdet` in the :ref:`LuSolve-name` function. Add the optional *ratio* argument to the :ref:`LuFactor-name` routine. (This has since been moved to a separate routine called :ref:`LuRatio-name` .) 11-07 ===== Remove some blank lines from the example files listed directly below (under 11-06). Comments for computing the entire Jacobian :ref:`ForSparseJac@Entire Sparsity Pattern` was added. 11-06 ===== The cases of ``std::vector`` , ``std::valarray`` , and ``CppAD::vector`` were folded into the standard example and tests format for the following cases: :ref:`rev_two.cpp-name` , :ref:`rev_one.cpp-name` , ``Reverse.cpp`` , :ref:`hessian.cpp-name` , :ref:`jacobian.cpp-name` , :ref:`forward.cpp-name` , :ref:`for_two.cpp-name` , :ref:`for_one.cpp-name` , ``Fun.cpp`` (``Fun.cpp`` has since been replaced by :ref:`independent.cpp-name` , ``Reverse.cpp`` has since been replaced by :ref:`reverse_one.cpp-name` and ``rev_checkpoint.cpp`` ). 11-01 ===== Add forward mode :ref:`Jacobian sparsity` calculation. 10-20 ===== Add :ref:`sparsity patterns` to the whish list. 10-18 ===== The Unix install :ref:`configure@Configure` command was missing the ``--`` before of the ``prefix`` command line argument. 10-14 ===== The template class :ref:`CppAD_vector-name` uses a try/catch block during the allocation of memory (for error reporting). This may be slow down memory allocation and hence it is now replaced by simple memory allocation when the preprocessor variable ``NDEBUG`` is defined. The specialization of ``CppAD::vector`` was moved to :ref:`CppAD_vector@vectorBool` so that ``CppAD::vector`` does not pack one bit per value (which can be slow to access). 10-12 ===== Change the :ref:`configure@Configure` script so that compilation of the :ref:`get_started.cpp-name` and :ref:`print_for_cout.cpp-name` examples are optional. One of the dates in the Unix installation extraction discussion was out of date. This has been fixed. 10-06 ===== Change the Unix install ``configure`` script so that is reports information using the same order and notation as its :ref:`documentation` . Some compiler errors in the :ref:`ode_gear_control.cpp-name` and :ref:`ode_stiff.cpp-name` examples were fixed. 09-29 ===== Add a specialization to :ref:`CppAD_vector-name` for the ``CppAD::vector`` case. A test for the ``push_back`` member function as well as a :ref:`CheckSimpleVector-name` test has been added to :ref:`cppad_vector.cpp-name` . The source code for this template vector class, ``cppad/vector.hpp`` , has been removed from the documentation. 09-27 ===== Add the :ref:`configure@prefix_dir` and *postfix_dir* ( *postfix_dir* has since been removed) options to the ``configure`` command line. This gives the user more control over the location where CppAD is installed. 09-24 ===== The stiff Ode routines, :ref:`OdeGear-name` and :ref:`OdeGearControl-name` , were added to the :ref:`utilities` . A comparison various Ode solvers on a stiff problem :ref:`ode_stiff.cpp-name` was added. In addition, ``OdeGear`` and ``OdeGearControl`` were added to the :ref:`utilities` and the library was reorganized. 09-20 ===== The Microsoft compiler project files ``example/Example.vcproj`` and ``TestMore/TestMore.vcproj`` were not up to date. This has been fixed. In addition, the example :ref:`numeric_type.cpp-name` has been added. Make the building of the ``Example`` , ``TestMore`` , and ``Speed`` , directories optional during the :ref:`configure@Configure` command. The :ref:`Unix installation instructions` were overhauled to make the larger set of options easy to understand. 09-14 ===== Added the :ref:`NumericType-name` concept and made the following library routines require this concept for their floating point template parameter type: :ref:`LuSolve-name` , :ref:`LuFactor-name` , :ref:`RombergOne-name` , :ref:`RombergMul-name` , :ref:`Runge45-name` , :ref:`Rosen34-name` , and :ref:`OdeErrControl-name` . This is more restrictive than the previous requirements for these routines but it enables future changes to the implementation of these routines (for optimization purposes) with out affecting their specifications. 09-09 ===== Add the :ref:`unary_plus-name` operator and move the ``Neg`` examples and tests to :ref:`unary_minus-name` . 09-07 ===== Change name of distribution files from ``CppAD.unix.tar.gz`` and ``CppAD.dos.tar.gz`` to ``CppAD-`` *yy* ``-`` *mm* ``-`` *dd* . ``tar.gz`` and ``CppAD-`` *yy* ``-`` *mm* ``-`` *dd* . ``zip`` (the * . ``zip`` file uses pkzip compression). 08-30 ===== The *maxabs* argument has been added to the :ref:`OdeErrControl-name` function so that it can be used with relative errors where components of the ODE solution may be zero (some of the time). In addition, some of the rest of the OdeErrControl documentation has been improved. The documentation for replacing defaults in CppAD error macros has been improved. 08-24 ===== Changed ``Romberg`` to :ref:`RombergOne-name` and added :ref:`RombergMul-name` . In addition, added missing entries to :ref:`list_all_examples-name` and reorganized :ref:`utilities` . 08-20 ===== Backed out addition of ``Romberg`` integration routine (at this point uncertain of the interface that is most useful in the context of AD.) 08-19 ===== Added a ``Romberg`` integration routine for where the argument types are template parameters (for use with AD types). 08-15 ===== The Microsoft project files ``example/Example.vcproj`` and ``TestMore/TestMore.vcproj`` were missing some necessary routines. In addition, ``Speed/Speed.vcproj`` was generating a warning. This has been fixed. 08-14 ===== An :ref:`Integer-name` conversion function as been added. The :ref:`value.cpp-name` example has been improved and the old example has been moved into the ``TestMore`` directory. 08-13 ===== The :ref:`unary_standard_math-name` functions ``sinh`` , and ``cosh`` have been added. In addition, more correctness testing has been added for the ``sin`` and ``cos`` functions. The :ref:`OdeErrControl-name` routine could lock in an infinite loop. This has been fixed and a test case has been added to check for this problem. 08-07 ===== The :ref:`conditional expression` function has been changed from just ``CondExp`` to ``CondExpLt`` , ``CondExpLe`` , ``CondExpEq`` , ``CondExpGe`` , ``CondExpGt`` . This should make code with conditional expressions easier to understand. In addition, it should reduce the number of tape operations because one need not create as many temporaries to do comparisons with. The old ``CondExp`` function has been deprecated. 07-21 ===== Remove unnecessary no-op that was left in tape for the :ref:`unary_standard_math-name` functions ``acos`` , ``asin`` , ``atan`` , ``cos`` . Improve the index entries in the documentation that corresponds to the ``cppad/local`` directory source code. 07-19 ===== The :ref:`wish_list-name` and ``Bugs`` information were moved out of this section and into their own separate sections (the Bugs section has been removed; see the ``bug`` subdirectory instead). A discussion of :ref:`VecAD speed and memory` was added as well as an entry in the :ref:`wish_list-name` to make it more efficient. 07-15 ===== The ``BOOST_DIR`` and ``CPP_ERROR_WARN`` :ref:`configure@Configure` options were not properly implemented for compiling the ``lib`` sub-directory. This has been fixed. Some compiler warnings in the file ``lib/ErrFun.cpp`` , which computes the :ref:`erf-name` function, have been fixed. 07-11 ===== The :ref:`CppAD_vector@push_back` function has been added to the ``CppAD::vector`` template class. It appears that the ``TestMore/Runge45.cpp`` file was missing an include of ``example/NearEqualExt.h`` . This has been fixed. 07-08 ===== The documentation for :ref:`Forward-name` and :ref:`Reverse-name` has been improved. 07-05 ===== The :ref:`rosen_34.cpp-name` example mixed the :ref:`CppAD::vector` and ``CppADvector`` vector types. This caused the compilation of the examples to fail when ``CppADvector`` was defined as something other than ``CppAD::vector`` (found by Jon Pearce). This has been fixed. The :ref:`CheckSimpleVector-name` run time code has been improved so that it is only run once per case that is being checked. Simple Vector concept checking (:ref:`CheckSimpleVector-name` ) was added to the routines: :ref:`ForOne-name` , :ref:`ForTwo-name` , :ref:`Forward-name` , :ref:`ADFun-name` , :ref:`Hessian-name` , :ref:`Independent-name` , :ref:`Jacobian-name` , :ref:`RevOne-name` , :ref:`RevTwo-name` , and :ref:`Reverse-name` . 07-04 ===== Simple Vector concept checking (:ref:`CheckSimpleVector-name` ) was added to the routines: :ref:`LuFactor-name` , :ref:`LuSolve-name` , :ref:`LuInvert-name` , :ref:`OdeErrControl-name` , :ref:`Runge45-name` , and :ref:`Rosen34-name` . The previous version of the routine :ref:`OdeErrControl-name` was mistakenly in the global namespace. It has been moved to the ``CppAD`` namespace (where all the other :ref:`utilities` routines are). The previous distribution (version 05-07-02) was missing the file ``cppad/local/Default.h`` . This has been fixed. 07-03 ===== Added :ref:`CheckSimpleVector-name` , a C++ concept checking utility that checks if a vector type has all the necessary conditions to be a :ref:`SimpleVector-name` class with a specific element type. 07-02 ===== Version 7 of Microsoft's C++ compiler supports the standard declaration for a friend template function. Version 6 did not and CppAD used macros to substitute the empty string for ```` , ``< AD >`` , and ``< VecAD >`` in these declarations. These macro substitutions have been removed because Version 6 of Microsoft's C++ compiler is no longer supported by CppAD. The copy base section was split into the default constructor and the construction for the base type. The construction from base type has been extended to include any type that is convertible to the base type. As a special case, this provides the previous wish list item of a constructor from an arbitrary *Base* to a ``AD< AD<`` *Base* > > , ``AD< AD< AD<`` *Base* > > > etc. 07-01 ===== The permissions were set as executable for many of the no-executable files in the distribution; for example, the ``README`` , file. This has been fixed. 06-25 ===== Some improvements were made to the README, AUTHORS, COPYING, and INSTALL files. In addition, the file ``UWCopy040507.html`` which contains the University of Washington's copyright policy (see Section 2) was added to the distribution. 06-24 ===== The ``List2Vector`` :ref:`example utility` is no longer used and has been removed. 06-18 ===== CppAD is now supported by Microsoft Visual C++ version 7 or higher. The version 6 project files * . ``dsw`` and * . ``dsp`` have been replaced by the version 7 project files * . ``sln`` and * . ``vcproj`` . 06-14 ===== A new :ref:`CondExp example` has been added and the old :ref:`CondExp-name` example has been moved to the ``TestMore`` directory (it is now only a test). 06-13 ===== The changes made on 06-06 do not run under Microsoft Visual C++ version 6.0 (even though they are within the C++ standard). Preliminary testing under version 7 indicates that Microsoft has fixed this problem in later versions of their C++ compiler. 06-06 ===== Converted the routines :ref:`Forward-name` and :ref:`Reverse-name` to allow for any :ref:`SimpleVector-name` instead of just ``CppADvector`` . In addition, separated the syntax of the function call from the prototype for each of the arguments. This was also done for all the easy to use :ref:`Drivers-name` as well as the :ref:`Independent-name` function and the :ref:`ADFun-name` constructor. Add a section containing a list of :ref:`all the examples` . 05-19 ===== A significant improvement in speed was obtained by moving the buffer extension to a separate function and then inline the rest of putting operators in the tape. For example, here is part of the speed test output before this change: :: Tape of Expansion by Minors Determinant: Length = 350, Memory = 6792 size = 5 rate = 230 size = 4 rate = 1,055 size = 3 rate = 3,408 size = 2 rate = 7,571 size = 1 rate = 13,642 and here is the same output after this change: :: Tape of Expansion by Minors Determinant: Length = 350, Memory = 6792 size = 5 rate = 448 size = 4 rate = 2,004 size = 3 rate = 5,761 size = 2 rate = 10,221 size = 1 rate = 14,734 Note that your results will vary depending on operating system and machine. 05-18 ===== Change name of ``OdeControl`` to :ref:`OdeErrControl-name` and improve its documentation. Correct the syntax for the :ref:`con_dyn_var@Parameter` and :ref:`con_dyn_var@Variable` functions. 05-16 ===== Change :ref:`OdeErrControl-name` to have method return its order instead of having a separate argument to ``OdeErrControl`` . Add the argument *scur* to ``OdeErrControl`` , improve ``OdeErrControl`` choice of step size and documentation. 05-12 ===== Using profiling, the :ref:`multiplication operator` was show to take a significant amount of time. It was reorganized in order to make it faster. The profiling indicated an improvement so that same change was made to the :ref:`ad_binary-name` and :ref:`compound_assign-name` operators. 05-06 ===== The documentation for :ref:`SimpleVector-name` and :ref:`NearEqual-name` were changed to use more syntax (what the user enters) and simpler prototypes (the compiler oriented description of the arguments). In addition, exercises were added at the end of the :ref:`SimpleVector-name` , :ref:`CppAD_vector-name` , and :ref:`NearEqual-name` documentation. There was a undesired divide by zero case in the file ``TestMore/VecUnary.cpp`` that just happened to work in corresponding :ref:`NearEqual-name` check. The ``NearEqual`` routine has been changed to return false if either of the values being compared is infinite or not a number. In addition, the divide by zero has been removed from the ``TestMore/VecUnary.cpp`` test. 05-01 ===== The doubly linked list was also removed from the :ref:`VecAD-name` internal data structure because this method of coding is simpler and it makes it more like the rest of CppAD. 04-21 ===== The profiling indicated that the destructor for an AD object was using a significant amount of time. The internal data structure of an AD object had a doubly linked list that pointed to the current variables and this was modified when an AD object was destroyed. In order to speed AD operations in general, the internal data structure of an AD object has been changed so that this list is no longer necessary (a tape id number is used in its place) During the process above, the function :ref:`con_dyn_var@Variable` was added. 04-20 ===== Add profiling to the speed tests. 04-19 ===== Remove an extra (not necessary) semi-colon from the file ``cppad/local/Operator.h`` . 03-26 ===== The new routine :ref:`OdeErrControl-name` does automatic step size control for the ODE solvers. 03-23 ===== The routine :ref:`Rosen34-name` is an improved stiff integration method that has an optional error estimate in the calling sequence. You must change all your calls to ``OdeImplicit`` to use ``Rosen34`` (but do not need to change other arguments because error estimate is optional). 03-22 ===== The routine :ref:`Runge45-name` is an improved Runge-Kutta method that has an optional error estimate in the calling sequence. You must change all your calls to ``OdeRunge`` to use ``Runge45`` (but do not need to change other arguments because error estimate is optional). 03-09 ===== Some extra semi-colons (empty statements) were generating warnings on some compilers. The ones that occurred after the macros ``CppADStandardMathBinaryFun`` , ``CppADCompareMember`` , ``CppADBinaryMember`` , and ``CppADFoldBinaryOperator`` have been removed. 03-04 ===== An new multiple level of AD example :ref:`mul_level-name` was added. 03-01 ===== An option that specifies error and warning :ref:`flags` for all the C++ compile commands, was added to the :ref:`Unix installation instructions` . 02-24 ===== The routine :ref:`LuSolve-name` was split into :ref:`LuFactor-name` and :ref:`LuInvert-name` . This enables one to efficiently solve equations where the matrix does not change and the right hand side for one equation depends on the left hand side for a previous equation. An extra requirement was added to the :ref:`SimpleVector-name` template class. There must be a typedef for ``value_type`` which is the type of elements in the vector Under Mandrake Linux 10.1, some template friend declarations were failing because the corresponding operations were not declared before being indicated as friends (found by `Jean-Pierre Dussault `_). This has been fixed. 01-08 ===== The :ref:`erf-name` function was added. The implementation of this function used conditional expressions (:ref:`CondExp-name` ) and some times the expression that was not valid in a region caused division by zero. For this reason, the check and abort on division by zero has been removed. {xrst_end whats_new_05}