Prev Next whats_new_19

@(@\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}} }@)@ This is cppad-20221105 documentation. Here is a link to its current documentation .
Changes and Additions to CppAD During 2019

  1. Add the print operator to the cpp_ad_graph and json_ad_graph ; see graph_print_op.cpp , json_print_op.cpp .
  2. Improve the error messaging when a Json op_code in the operator definition section does not start with one and increment by one between definitions.

  1. Change pos to notpos in the PrintFor documentation because the text is printed when it is not positive.
  2. Add C++ graph member functions that find the index for an atomic or discrete function.

  1. Add the discrete function operator to the json_ad_graph .
  2. Fix bug when using a dynamic parameter for notpos or value in the PrintFor routine.

Add the discrete function operator to the cpp_ad_graph ; see graph_discrete_op.cpp .

Add an atomic functions item to the wish list for abs-normal functions.

Add a dynamic parameters item and a Graph Operators item to the wish list.

  1. The graph_atom_op.cpp Base type was changed from double to float.
  2. Fix a bug in from_graph , from_json , to_graph , and to_json when the Base type is not double.

Add more description in the comments for the graph_op_enum values .

  1. Added a list of the possible ADFun operators that are missing (not yet implemented) by to_graph and to_json .
  2. Absolute zero multiplication azmul was as added to the json_ad_graph and cpp_ad_graph as pow_graph_op. Functions that contain the this operator can be converted to and from cpp_graph objects; e.g., see graph_azmul_op.cpp . They can also be converted to and from strings containing json_ad_graph representations; e.g., see json_azmul_op.cpp .
  3. Improve the graph_op_enum examples by removing some type definitions and using statements. In addition, use cppad_testvector to demonstrate that any simplevector type can be used.

The power operators was added to the json_ad_graph as pow and to the cpp_ad_graph as pow_graph_op; see enum values . Functions that contain the pow operators can be converted to and from cpp_graph objects; e.g., see graph_pow_op.cpp . They can also be converted to and from strings containing json_ad_graph representations; e.g., see json_pow_op.cpp .

Add switch_var_dyn.cpp , an example that switches between variables and dynamic parameters.

Add a version of the from_graph routine that can convert dynamic parameters to variables and vice versa; see dyn2var and var2dyn in the from_graph documentation.

Add the Independent(xdynamic) syntax to the Independent function and changes some of the new_dynamic example to use this syntax.

Add wish list item for converting dynamic parameters to variables and vice versa. This has since been completed; see 12-12 above.

Fix clang 9.0.0 mistaken uninitialized warning in a11c_openmp.cpp .

Change n_independent to n_variable_ind in json_ad_graph and cpp_ad_graph . In addition, the under construction warning was removed from json_ad_graph and cpp_ad_graph .

The C++ data structure for an AD graph cpp_graph was add the user API for CppAD.

More work on reducing the amount of memory used by the from_json and to_json operations.

More work on reducing the amount of memory used by the from_json and to_json operations.

  1. Working on reducing the amount of memory used by the from_json and to_json operations.
  2. Improve sparse jacobian error messaging when coloring is cppad and subset has elements that are not in the sparsity pattern .

A left (right) bracket was added to the beginning of (end of) the constant_vec , op_usage_vec , dependent_vec values in a Json AD graph (to properly conform to Json format).

Move the Json AD graph discussion of node indices under one heading and include a diagram of all the nodes.

Include conversion from function to graph (to_json ) and back to function (from_json ) in the json operator examples.

The default value for cppad_prefix was changed from /usr to the value of the cmake variable CMAKE_INSTALL_PREFIX .

Use a newer version of the program that generates the documentation omhelp. The _search utility now shows the title and section tag in separate areas and hides the other keywords. Hitting return or double clicking in the title area, in addition to choosing the Goto button, will go to the selected section.

Discussion of a warning about boost as added to cmake command documentation.

The cppad_deprecated option has been completely removed from the cmake command options documentation.

Merge in changes from json branch which implement the compare operators .

The autotools install was installing * instead of the corresponding *.hpp file. This has been fixed.

Fix autotools install so files get installed to prefix/include/cppad instead of prefix/include/include/cppad . Also fix the autotools make test.

Bring autotools build and test up to date (this was deprecated at end of 2012 and support for this will eventually stop).

The old Json unary operator examples were converted to be just tests and a single json_unary_op.cpp example was left in its place.

The Json graph conditional expressions were added.

  1. Extend to_json to handle atomic functions . This should have been included with the atomic function change on 08-17 .
  2. Simplify the json_atom_op.cpp and add a call to to_json to this example.
  3. The string_vec field was removed from the definition of an Json AD graph function . The corresponding operators will have strings in their op_usage .
  4. The vector branch was merged into the master. This brought in the following changes from 08-22 to 08-26 below.

Change cppad_vector.cpp example to use same names as in CppAD_vector documentation.

The CppAD_vector documentation page was edited (improved).

Iterators were added to the CppAD vector class.

The Json graph unary operators were added.

The CppAD vector include discussion was edited. In addition, the class vectorBool is now available as a separate include file.

  1. Add a the Json addition example json_add_op.cpp .
  2. Add the atomic function operator which enables one to call atomic functions as part of a Json AD graph; see the json_atom_op.cpp example.

Add the case where need_y is equal to constant_enum during atomic_three forward mode. This only needs to be implemented when by from_json is used with the atomic function.

Fix a bug in the calculation of Hessian sparsity patterns when using chkpoint_two function.

  1. Fix an assert error for the sum operator in from_json .
  2. Improve the documentation for mixing debug and release versions of CppAD in the same program; see CPPAD_DEBUG_AND_RELEASE .

  1. Remove under construction heading from the examples json_mul_op.cpp , json_sub_op.cpp , json_sum_op.cpp (they have been working for a while now).
  2. Add the Json div operator.

  1. Add function_name to the Json graph representation of a function.
  2. Use the function name for reporting errors in a Json graph.

  1. Move the example include files eigen_cholesky.hpp, eigen_mat_inv.hpp, eigen_mat_mul.hpp from the include/cppad/example directory to the include/cppad/example/atomic_two directory.
  2. Move the example include file mat_mul.hpp from the include/cppad/example directory to the include/cppad/example/atomic_three directory.
  3. Improve the syntax , and parameter_x discussion, in the documentation for the atomic_three functions. Furthermore, add an extra discussion of the parameters to the documentation for taylor_x in the forward and reverse callback functions.
  4. Change Json string_vec from first to second line below:
    n_string, [ first_string...last_string ] ]
    n_string, [ first_string...last_string ]
    ( string_vec was removed on 08-29 ).
  5. Change Json constant_vec from first to second line below:
    n_constant, [ first_constant...last_constant ] ]
    n_constant, [ first_constant...last_constant ]
  6. Change Json op_usage_vec from first to second line below:
    n_op_usage, [ first_op_usage...last_op_usage ] ]
    n_op_usage, [ first_op_usage...last_op_usage ]
  7. Change Json dependent_vec from first to second line below:
    n_dependent, [ first_dependent...last_dependent ] ]
    n_dependent, [ first_dependent...last_dependent ]

  1. Fix a bug in chkpoint_two when use_in_parallel is true.
  2. Add the multi_atomic_three.cpp and multi_chkpoint_two.cpp examples.
  3. Deprecate the multi_atomic_two.cpp and multi_chkpoint_one.cpp examples

Add an example representation of a sparse matrix using the an json_ad_graph ; see json_sparse.cpp .

  1. Add the json subtraction operator sub .
  2. Fix from_json addition and multiply operations where the first argument is a variable and second argument is a parameter.
  3. Add simple examples for the json operators that have been implemented; e.g., json_sum_op.cpp .
  4. Fix to_json when a cumulative summation has subtraction terms in its summation.

Add the json_sum_op.cpp example and fix a bug in from_json that was demonstrated by this example. To be specific, the json sum operator did not work when all its result was a dynamic parameter .

Fix the warning (on some systems) that rev_jac_sparsity shadows a member of CppAD::atomic_three<Base>.

The cppad_lib dynamic link library version number used to be yy.mmdd where the major version number yy was the year minus 2000 and the minor version number mmdd was the month and day. The value mmdd was to large for a Mac system minor version number. See cppad_lib for the new library version number system.

Change some assignment operators to equality operators in a few asserts (= to == in the files optimize_run.hpp and player.hpp). These were not bugs because the corresponding variable was being set to the value it should have been.

  1. The n_usage value generated by to_json was not correct. This has been fixed.
  2. All the operators that were implemented so far were included in the op_define_vec section generated by to_json. Now only operators that are used are included. This makes it easier for humans to understand simple example graphs (especially as the number of implemented operators increases).
  3. There was a bug in from_json when one of the operations was a dynamic parameter and the other was a constant. This has been fixed.
  4. All of the addition and multiplication operators (including cumulative sum operators) have been implemented and tested..

  1. Improve the from_json error messages by including the previous two lines of Json in error message.
  2. Working on a to_json example that outputs graph for the derivative of a function.

The format of a Json computational graph was changed to include a section at the top that defines the mapping between integer codes in the graph and corresponding operators, see the heading op_define_vec . This is now separate from op_usage_vec which is the part of the graph that is expect to be very large and is now less verbose.

It used to be the case that optimized functions with cumulative summation operators could not be optimized. This has been fixed and it is now acceptable to re-optimize an ADFun object.

  1. Some work was done to improve the speed of sparsity calculations when using the internal representation for a boolean vector .
  2. An extra pair of braces was expected in each op_usage of an json_ad_graph . This has been fixed.

There are some problems using as Windows DLL for the cppad_lib library. These problems have been circumvented (for the time being) by using as static library for Windows systems.

A new feature that constructs a ADFun object from a Json representation of a computational graph was added; see json_ad_graph and from_json . This requires linking the cppad_lib library. It is a Minimal Viable Product and is intended for testing. As of yet, only has the addition and multiplication operators are implemented.

Some work was done to improve the speed of sparsity calculations when using the internal representation for a vector of sets . This also reduced the time required by the optimize operation for some cases.

The version number in the title of the top level for the CppAD documentation was not being updated. This started on 20190521 and has been fixed.

Add the swap operation to the CppAD::vector template class and vectorBool class. In addition, change cppad_vector.cpp example so it focuses on operations that are not in SimpleVector .

There was a bug in optimizing conditional expressions; i.e., optimizing without the option no_conditional_skip . This was a rare case that involving sets of conditional expressions and conditionally skipping a specific operator. The bug was reproduced in a regression test and is fixed.

  1. Some speed improvements were made to the for_hes_sparsity algorithm. To be specific the forward Jacobian and Hessian patterns are computed during the same pass and using the same structure. This avoids an extra pass on the operation sequence. In addition, when internal_bool is false, it enables smart points to the forward Jacobian and Hessian to share the same underlying sets of integers (when they are equal).
  2. Some minor improvements and updating was done for the directory and glossary sections.

Simplify the example computation of Hessian using subgraphs subgraph_hes2jac.cpp . This simplification was a change from using multiple levels of AD to using base2ad .

There was a bug in the checking for correctness of the adolc_sparse_hessian.cpp results. This was due to the fact that the sparsity patterns for ADOL-C may have more entires that CppAD knows are zero.

Add the optional repeat_out argument to the time_test function.

Improve the speed of sparse Hessian calculations that colpack.symmetric coloring method by directly accessing the coloring determined by Colpack.

There was a bug in f.Reverse(q, w) when f contained the pow(x,y) function and x == 0 . To be specific, it was not reporting zero instead of nan for the derivative. This has been partially, but not completely fixed. See the reverse mode in the wish list.

Fix a bug in f.subgraph_jac_rev(x, subset) . This bug appeared in a test that only returned the upper triangle of a symmetric matrix (the lower triangle worked).

There was a problem linking the boost multi-threading library on some systems that caused the corresponding check to be skipped. This has been fixed. To be specific,
     make check_example_multi_thread_bthread: available
was not in the cmake command output. This has been fixed.

The return value n_sweep was changed to n_color because it is not the number of sweeps when group_max is not equal to one. This change was also made for the speed tests .

Add row major order specifications to the speed test routines link_sparse_jacobian and link_sparse_hessian . This reduced the overhead (increased the speed) for the adolc_sparse_jacobian.cpp and adolc_sparse_hessian.cpp test cases.

  1. Fix bug below in the new release 20190200.1 .
  2. There was a problem locating the boost multi-threading library. To be specific, the cmake command would report
        Could not find boost multi-threading library
    but it would still try to use the library. This was because a file name with a - in it was also being used for a cmake variable name. This has been fixed.

Improve the discussion of the purpose of for the different subgraph options which computing sparse Jacobians.

  1. A stable release for 2019 is now available on the release page.
  2. The download page was edited to include better discussion of the license and documentation.

The documentation for atomic_three , and its subsections, was improved.

The arguments parameter_x and type_x were included for all the atomic_three virtual functions.

More improvements, and bug fixes, in the optimization of atomic operations. This results in a reduction in the number of parameters size_par and the number of variables size_var .

Fix a bug in the optimization of atomic_three operations with dynamic parameters.

  1. The rev_depend call back function was added to atomic_three class. This enables one to optimize functions that use atomic_three operations; see the rev_depend.cpp example.
  2. The ability to optimize functions was extended to chkpoint_two operations; e.g., a call to optimize was added at the end of the get_started.cpp example.
  3. The chkpoint_one class was deprecated, use chkpoint_two instead.

One of the two atomic matrix multiply examples was converted from using atomic_two to atomic_three_mat_mul.cpp . This conversion made it clear that the type_x argument needed to be included in the jac_sparsity and hes_sparsity functions.

Merge in the atomic branch. This completed wish_list item for the new atomic function API; see atomic_three . This is an improvement over the atomic_two interface, which used the atomic_base class and has been deprecated. In addition the following changes were included:
  1. Move the checkpoint examples below the checkpoint documentation.
  2. A phantom parameter, at index zero, was added; see size_par .
  3. There appears to have been a bug in put_con_par (not tested for) whereby a constant parameter might match a dynamic parameter (and get changed). This has been fixed.
  4. There was a mistake in the check_variable_dag routine whereby the operator LeppOp checked a parameter index as if it were a variable index. This has been fixed.

Merge in the chkpoint branch.
  1. This created the chkpoint_two class as a replacement for the chkpoint_one class. This new checkpoint class takes advantage of dynamic parameters and can be used with base2ad .
  2. While creating the chkpoint_two class, a problem was discovered in the atomic_three class. To be specific, it does not yet work with optimize . A reverse dependency analysis is the proper way to fix this. The atomic_three type member function does a forward dependency analysis and so its name was changed from type to for_type.

Input File: omh/appendix/whats_new/19.omh