Changeset 2892 for trunk/test_more


Ignore:
Timestamp:
Aug 13, 2013 1:30:55 PM (6 years ago)
Author:
bradbell
Message:
  1. Add ADFun::check_for_nan option to allow supression of checking for nans.
  2. Remove need to re-map nans in checkpoint functions.

checkpoint.hpp: optimize checkpoint function.
fun_construct.hpp: fix typos in documentation.
reverse.hpp: add checking for nan in reverse mode results.
cond_exp.cpp: expect a nan in this example, so use check_for_nan.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test_more/optimize.cpp

    r2891 r2892  
    2222                const CppAD::vector< CppAD::AD<double> >& ax ,
    2323                      CppAD::vector< CppAD::AD<double> >& ay )
    24         {       CppAD::AD<double> zero(0.);
    25 
    26                 // Arguments that are not used are mapped to nan
    27                 // but zero order forward mode does not like this.
    28                 for(size_t i = 0; i < ax.size(); i++)
    29                 {       // convert nan to zero in a way that get stored in op sequence
    30                         ay[i] = CondExpEq(ax[i], ax[i], ax[i], zero);
    31                 }
    32         }
     24        {       ay = ax; }
     25
    3326        bool atomic_arguments(void)
    3427        {       bool ok = true;
Note: See TracChangeset for help on using the changeset viewer.