Changeset 1326


Ignore:
Timestamp:
Jan 21, 2009 1:38:42 AM (12 years ago)
Author:
bradbell
Message:

trunk: Add AD<Base>::abort for aborting a tape recording.

abort.cpp: test of aborting a tape recording.
abort_recording.hpp: implementation of aborting a tape recording.

Add aborting_recording to following files:
example/makefile.am, example/makefile.in, example.cpp, makefile.in, ad.hpp,

Add <adolc/taping.h> to include list (change in Adolc API):
mul_level_adolc.cpp, ode_taylor_adolc.cpp, makefile.am, makefile.in,
example_list.omh, ad_fun.cpp, det_minor.cpp, poly.cpp, sparse_hessian.cpp,
det_lu.cpp

base_adolc.cpp: change value() to getValue() (change in Adolc API).
whats_new_09.omh: user's view of the changes.
reverse.omh: fix minor documentation error.
jacobian.hpp: add discussion of forward and reverse in documentation.

svn_commit.sed: update year from 08 to 09.

Location:
trunk
Files:
2 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/cppad/local/ad.hpp

    r1213 r1326  
    184184        // ----------------------------------------------------------
    185185        // static public member functions
     186       
     187        // abort current AD<Base> recording
     188        static void        abort_recording(void);   
     189
     190        // set the maximum number of OpenMP threads that will be active
    186191        static size_t      omp_max_thread(size_t number);
    187192
  • trunk/cppad/local/ad_fun.hpp

    r1224 r1326  
    4545        cppad/local/fun_construct.hpp%
    4646        cppad/local/dependent.hpp%
     47        cppad/local/abort_recording.hpp%
    4748        omh/seq_property.omh%
    4849        cppad/local/fun_eval.hpp%
     
    279280# include <cppad/local/dependent.hpp>
    280281# include <cppad/local/fun_construct.hpp>
     282# include <cppad/local/abort_recording.hpp>
    281283# include <cppad/local/fun_eval.hpp>
    282284# include <cppad/local/drivers.hpp>
  • trunk/cppad/local/jacobian.hpp

    r980 r1326  
    33
    44/* --------------------------------------------------------------------------
    5 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-06 Bradley M. Bell
     5CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-09 Bradley M. Bell
    66
    77CppAD is distributed under multiple licenses. This distribution is under
     
    4949%$$
    5050Note that the $xref/ADFun/$$ object $italic f$$ is not $code const$$
    51 (see $xref/Jacobian/Jacobian Uses Forward/Jacobian uses Forward/$$ below).
     51(see $cref/Forward or Reverse/Jacobian/Forward or Reverse/$$ below).
    5252
    5353$head x$$
     
    8888if this is not the case.
    8989
    90 $head Jacobian Uses Forward$$
     90$head Forward or Reverse$$
     91This will use order zero Forward mode and either
     92order one Forward or order one Reverse to compute the Jacobian
     93(depending on which it estimates will require less work).
    9194After each call to $xref/Forward/$$,
    9295the object $italic f$$ contains the corresponding
    9396$xref/glossary/Taylor Coefficient/Taylor coefficients/$$.
    94 After $code Jacobian$$,
    95 the previous calls to $xref/Forward/$$ are undefined.
     97After each call to $code Jacobian$$,
     98the previous calls to $xref/Forward/$$ are unspecified.
    9699
    97100$head Example$$
  • trunk/example/base_adolc.hpp

    r1311 r1326  
    206206$codep */
    207207        inline int Integer(const adouble &x)
    208         {    return static_cast<int>( x.value() ); }
     208        {    return static_cast<int>( x.getValue() ); }
    209209/* $$
    210210$end
  • trunk/example/example.cpp

    r1315 r1326  
    3737
    3838// external complied tests
     39extern bool abort_recording(void);
    3940extern bool Abs(void);
    4041extern bool Acos(void);
     
    169170
    170171        // external compiled tests
     172        ok &= Run( abort_recording,   "abort_recording"  );
    171173        ok &= Run( Abs,               "Abs"              );
    172174        ok &= Run( Acos,              "Acos"             );
  • trunk/example/makefile.am

    r1315 r1326  
    5757         \
    5858        example.cpp \
     59        abort_recording.cpp \
    5960        abs.cpp \
    6061        acos.cpp \
  • trunk/example/makefile.in

    r1315 r1326  
    4444PROGRAMS = $(noinst_PROGRAMS)
    4545am__example_SOURCES_DIST = mul_level_adolc.cpp ode_taylor_adolc.cpp \
    46         example.cpp abs.cpp acos.cpp add.cpp add_eq.cpp asin.cpp \
    47         atan.cpp atan_2.cpp base_adolc.hpp bender_quad.cpp \
    48         bool_fun.cpp vector_bool.cpp check_numeric_type.cpp \
    49         check_simple_vector.cpp compare.cpp compare_change.cpp \
    50         complex_poly.cpp cond_exp.cpp copy_ad.cpp copy_base.cpp \
    51         cos.cpp cosh.cpp cppad_vector.cpp default.cpp div.cpp \
    52         div_eq.cpp eq.cpp equal_op_seq.cpp erf.cpp error_handler.cpp \
    53         exp.cpp for_one.cpp for_two.cpp forward.cpp for_sparse_jac.cpp \
    54         fun_check.cpp hes_lagrangian.cpp hes_lu_det.cpp \
    55         hes_minor_det.cpp hessian.cpp hes_times_dir.cpp \
     46        example.cpp abort_recording.cpp abs.cpp acos.cpp add.cpp \
     47        add_eq.cpp asin.cpp atan.cpp atan_2.cpp base_adolc.hpp \
     48        bender_quad.cpp bool_fun.cpp vector_bool.cpp \
     49        check_numeric_type.cpp check_simple_vector.cpp compare.cpp \
     50        compare_change.cpp complex_poly.cpp cond_exp.cpp copy_ad.cpp \
     51        copy_base.cpp cos.cpp cosh.cpp cppad_vector.cpp default.cpp \
     52        div.cpp div_eq.cpp eq.cpp equal_op_seq.cpp erf.cpp \
     53        error_handler.cpp exp.cpp for_one.cpp for_two.cpp forward.cpp \
     54        for_sparse_jac.cpp fun_check.cpp hes_lagrangian.cpp \
     55        hes_lu_det.cpp hes_minor_det.cpp hessian.cpp hes_times_dir.cpp \
    5656        independent.cpp integer.cpp interface_2c.cpp \
    5757        interp_onetape.cpp interp_retape.cpp jac_lu_det.cpp \
     
    7373@CppAD_ADOLC_TRUE@am__objects_1 = mul_level_adolc.$(OBJEXT) \
    7474@CppAD_ADOLC_TRUE@      ode_taylor_adolc.$(OBJEXT)
    75 am_example_OBJECTS = $(am__objects_1) example.$(OBJEXT) abs.$(OBJEXT) \
    76         acos.$(OBJEXT) add.$(OBJEXT) add_eq.$(OBJEXT) asin.$(OBJEXT) \
    77         atan.$(OBJEXT) atan_2.$(OBJEXT) bender_quad.$(OBJEXT) \
    78         bool_fun.$(OBJEXT) vector_bool.$(OBJEXT) \
    79         check_numeric_type.$(OBJEXT) check_simple_vector.$(OBJEXT) \
    80         compare.$(OBJEXT) compare_change.$(OBJEXT) \
    81         complex_poly.$(OBJEXT) cond_exp.$(OBJEXT) copy_ad.$(OBJEXT) \
    82         copy_base.$(OBJEXT) cos.$(OBJEXT) cosh.$(OBJEXT) \
    83         cppad_vector.$(OBJEXT) default.$(OBJEXT) div.$(OBJEXT) \
    84         div_eq.$(OBJEXT) eq.$(OBJEXT) equal_op_seq.$(OBJEXT) \
    85         erf.$(OBJEXT) error_handler.$(OBJEXT) exp.$(OBJEXT) \
    86         for_one.$(OBJEXT) for_two.$(OBJEXT) forward.$(OBJEXT) \
    87         for_sparse_jac.$(OBJEXT) fun_check.$(OBJEXT) \
     75am_example_OBJECTS = $(am__objects_1) example.$(OBJEXT) \
     76        abort_recording.$(OBJEXT) abs.$(OBJEXT) acos.$(OBJEXT) \
     77        add.$(OBJEXT) add_eq.$(OBJEXT) asin.$(OBJEXT) atan.$(OBJEXT) \
     78        atan_2.$(OBJEXT) bender_quad.$(OBJEXT) bool_fun.$(OBJEXT) \
     79        vector_bool.$(OBJEXT) check_numeric_type.$(OBJEXT) \
     80        check_simple_vector.$(OBJEXT) compare.$(OBJEXT) \
     81        compare_change.$(OBJEXT) complex_poly.$(OBJEXT) \
     82        cond_exp.$(OBJEXT) copy_ad.$(OBJEXT) copy_base.$(OBJEXT) \
     83        cos.$(OBJEXT) cosh.$(OBJEXT) cppad_vector.$(OBJEXT) \
     84        default.$(OBJEXT) div.$(OBJEXT) div_eq.$(OBJEXT) eq.$(OBJEXT) \
     85        equal_op_seq.$(OBJEXT) erf.$(OBJEXT) error_handler.$(OBJEXT) \
     86        exp.$(OBJEXT) for_one.$(OBJEXT) for_two.$(OBJEXT) \
     87        forward.$(OBJEXT) for_sparse_jac.$(OBJEXT) fun_check.$(OBJEXT) \
    8888        hes_lagrangian.$(OBJEXT) hes_lu_det.$(OBJEXT) \
    8989        hes_minor_det.$(OBJEXT) hessian.$(OBJEXT) \
     
    288288         \
    289289        example.cpp \
     290        abort_recording.cpp \
    290291        abs.cpp \
    291292        acos.cpp \
     
    443444        -rm -f *.tab.c
    444445
     446@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abort_recording.Po@am__quote@
    445447@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs.Po@am__quote@
    446448@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acos.Po@am__quote@
  • trunk/example/mul_level_adolc.cpp

    r1226 r1326  
    7171// BEGIN PROGRAM
    7272# include <adolc/adouble.h>
     73# include <adolc/taping.h>
    7374# include <adolc/interfaces.h>
    7475
  • trunk/example/ode_taylor_adolc.cpp

    r1226 r1326  
    180180// BEGIN PROGRAM
    181181# include <adolc/adouble.h>
     182# include <adolc/taping.h>
    182183# include <adolc/drivers/drivers.h>
    183184
  • trunk/makefile.am

    r1318 r1326  
    7272        cppad/local/ad_tape.hpp \
    7373        cppad/local/ad_valued.hpp \
     74        cppad/local/abort_recording.hpp \
    7475        cppad/local/abs.hpp \
    7576        cppad/local/abs_op.hpp \
  • trunk/makefile.in

    r1318 r1326  
    258258        cppad/local/ad_tape.hpp \
    259259        cppad/local/ad_valued.hpp \
     260        cppad/local/abort_recording.hpp \
    260261        cppad/local/abs.hpp \
    261262        cppad/local/abs_op.hpp \
  • trunk/omh/example_list.omh

    r1322 r1326  
    7373
    7474$table
     75$rref abort_recording.cpp$$
    7576$rref Abs.cpp$$
    7677$rref Acos.cpp$$
  • trunk/omh/reverse.omh

    r932 r1326  
    11/* --------------------------------------------------------------------------
    2 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-07 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-09 Bradley M. Bell
    33
    44CppAD is distributed under multiple licenses. This distribution is under
     
    363363\] $$
    364364where
    365 $latex o ( t^{p-1} ) * t^{1-p} \rightarrow 0$$ as $latex t \rightarrow 0$$.
     365$latex o ( t^{p-1} ) / t^{1-p} \rightarrow 0$$ as $latex t \rightarrow 0$$.
    366366
    367367
  • trunk/omh/whats_new_09.omh

    r1325 r1326  
    1313$spell
    1414        CppAD
     15        Adolc
    1516$$
    1617
     
    2829$cref/FunConstruct/$$.
    2930
     31$head 01-18$$
     32Sometimes an error occurs while taping AD operations.
     33The $cref/abort_recording/$$ function has been added
     34to make it easier to recover in such cases.
     35$pre
     36
     37$$
     38Previously, CppAD speed and comparison tests used Adolc-1.10.2.
     39The version used in the tests has been upgraded to
     40$href%
     41        http://www.math.tu-dresden.de/~adol-c/%
     42        Adolc-2.0.0.
     43%$$
     44$pre
     45
     46$$
     47A discussion has been added to the documentation for $cref/Jacobian/$$
     48about its use of
     49$cref/forward or reverse/Jacobian/Forward or Reverse/$$
     50mode depending on which it estimates is more efficient.
     51$pre
     52
     53$$
     54A minor typo has been fixed in the description of
     55$cref/W(t, u)/reverse_any/W(t, u)/$$ in $cref/reverse_any/$$.
     56To be specific,
     57$latex o ( t^{p-1} ) * t^{1-p} \rightarrow 0$$
     58has been replaced by
     59$latex o ( t^{p-1} ) / t^{1-p} \rightarrow 0$$.
     60
    3061$end
  • trunk/speed/adolc/det_lu.cpp

    r1243 r1326  
    4444
    4545# include <adolc/adouble.h>
     46# include <adolc/taping.h>
    4647# include <adolc/interfaces.h>
    4748
  • trunk/speed/adolc/det_minor.cpp

    r1243 r1326  
    4444
    4545# include <adolc/adouble.h>
     46# include <adolc/taping.h>
    4647# include <adolc/interfaces.h>
    4748
  • trunk/speed/adolc/poly.cpp

    r1243 r1326  
    5050
    5151# include <adolc/adouble.h>
     52# include <adolc/taping.h>
    5253# include <adolc/interfaces.h>
    5354
  • trunk/speed/adolc/sparse_hessian.cpp

    r1243 r1326  
    4949
    5050# include <adolc/adouble.h>
     51# include <adolc/taping.h>
    5152# include <adolc/drivers/drivers.h>
    5253
  • trunk/svn_commit.sed

    r1119 r1326  
    1717#
    1818# Change copyright second year to current year
    19 s/Copyright (C) \([0-9]*\)-0[0-7] Bradley M. Bell/Copyright (C) \1-08 Bradley M. Bell/
    20 s/Copyright (C) \([0-9]*\)-200[0-7] Bradley M. Bell/Copyright (C) \1-2008 Bradley M. Bell/
     19s/Copyright (C) \([0-9]*\)-0[0-7] Bradley M. Bell/Copyright (C) \1-09 Bradley M. Bell/
     20s/Copyright (C) \([0-9]*\)-200[0-7] Bradley M. Bell/Copyright (C) \1-2009 Bradley M. Bell/
  • trunk/test_more/base_adolc.cpp

    r1077 r1326  
    11/* --------------------------------------------------------------------------
    2 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-07 Bradley M. Bell
     2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-09 Bradley M. Bell
    33
    44CppAD is distributed under multiple licenses. This distribution is under
     
    1010-------------------------------------------------------------------------- */
    1111# include <adolc/adouble.h>
     12# include <adolc/taping.h>
    1213# include <adolc/interfaces.h>
    1314
Note: See TracChangeset for help on using the changeset viewer.