Changeset 2270


Ignore:
Timestamp:
Jan 20, 2012 10:15:06 AM (8 years ago)
Author:
bradbell
Message:
  1. Add change_const.cpp to list of multi-level AD examples.

epsilon.hpp: Document fact that also supports Base types.

Location:
trunk
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/AUTHORS

    r2265 r2270  
    22             ===========================================
    33
    4 To date, 2012-01-15, Bradley M. Bell is the sole author of CppAD.
     4To date, 2012-01-20, Bradley M. Bell is the sole author of CppAD.
    55While Bradley M. Bell worked for the University of Washington during
    66the development of CppAD, the following are also true:
  • trunk/configure

    r2265 r2270  
    11#! /bin/sh
    22# Guess values for system-dependent variables and create Makefiles.
    3 # Generated by GNU Autoconf 2.68 for CppAD 20120115.
     3# Generated by GNU Autoconf 2.68 for CppAD 20120120.
    44#
    55# Report bugs to <cppad@list.coin-or.org>.
     
    561561PACKAGE_NAME='CppAD'
    562562PACKAGE_TARNAME='cppad'
    563 PACKAGE_VERSION='20120115'
    564 PACKAGE_STRING='CppAD 20120115'
     563PACKAGE_VERSION='20120120'
     564PACKAGE_STRING='CppAD 20120120'
    565565PACKAGE_BUGREPORT='cppad@list.coin-or.org'
    566566PACKAGE_URL=''
     
    13351335  # This message is too long to be a string in the A/UX 3.1 sh.
    13361336  cat <<_ACEOF
    1337 \`configure' configures CppAD 20120115 to adapt to many kinds of systems.
     1337\`configure' configures CppAD 20120120 to adapt to many kinds of systems.
    13381338
    13391339Usage: $0 [OPTION]... [VAR=VALUE]...
     
    14011401if test -n "$ac_init_help"; then
    14021402  case $ac_init_help in
    1403      short | recursive ) echo "Configuration of CppAD 20120115:";;
     1403     short | recursive ) echo "Configuration of CppAD 20120120:";;
    14041404   esac
    14051405  cat <<\_ACEOF
     
    15191519if $ac_init_version; then
    15201520  cat <<\_ACEOF
    1521 CppAD configure 20120115
     1521CppAD configure 20120120
    15221522generated by GNU Autoconf 2.68
    15231523
     
    21432143running configure, to aid debugging if configure makes a mistake.
    21442144
    2145 It was created by CppAD $as_me 20120115, which was
     2145It was created by CppAD $as_me 20120120, which was
    21462146generated by GNU Autoconf 2.68.  Invocation command line was
    21472147
     
    47994799# Define the identity of the package.
    48004800 PACKAGE='cppad'
    4801  VERSION='20120115'
     4801 VERSION='20120120'
    48024802
    48034803
     
    71647164# values after options handling.
    71657165ac_log="
    7166 This file was extended by CppAD $as_me 20120115, which was
     7166This file was extended by CppAD $as_me 20120120, which was
    71677167generated by GNU Autoconf 2.68.  Invocation command line was
    71687168
     
    72217221ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
    72227222ac_cs_version="\\
    7223 CppAD config.status 20120115
     7223CppAD config.status 20120120
    72247224configured by $0, generated by GNU Autoconf 2.68,
    72257225  with options \\"\$ac_cs_config\\"
  • trunk/configure.ac

    r2265 r2270  
    1313dnl Process this file with autoconf to produce a configure script.
    1414dnl   package   version              bug-report
    15 AC_INIT(CppAD, 20120115, cppad@list.coin-or.org)
     15AC_INIT(CppAD, 20120120, cppad@list.coin-or.org)
    1616AC_SUBST(PACKAGE_URL, "http://www.coin-or.org/CppAD")
    1717AC_SUBST(PACKAGE_DESCRIPTION, "Differentiation of C++ Algorithms")
  • trunk/cppad/configure.hpp

    r2265 r2270  
    4343cppad-yyyymmdd as a C string where yyyy is year, mm is month, and dd is day.
    4444*/
    45 # define CPPAD_PACKAGE_STRING "cppad-20120115"
     45# define CPPAD_PACKAGE_STRING "cppad-20120120"
    4646
    4747/*!
  • trunk/cppad/local/epsilon.hpp

    r2057 r2270  
    33# define CPPAD_EPSILON_INCLUDED
    44/* --------------------------------------------------------------------------
    5 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-11 Bradley M. Bell
     5CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
    66
    77CppAD is distributed under multiple licenses. This distribution is under
     
    2828
    2929$head Syntax$$
    30 $icode%eps% = epsilon< AD<%Base%> >()%$$
     30$icode%eps% = epsilon<%Float%>()%$$
    3131
    3232$head Purpose$$
    3333Obtain the value of machine epsilon corresponding
    34 to the type $codei%AD<%Base%>%$$.
     34to the type $icode%Float%$$.
     35
     36$head Float$$
     37this type can either be $codei%AD<%Base%>%$$,
     38or it can be $icode Base$$ for any $code%AD<%Base%>%$$ type;
     39see $cref/base_require/base_require/epsilon/$$.
    3540
    3641$head eps$$
    3742The result $icode eps$$ has prototype
    3843$codei%
    39         AD<%Base%> eps
     44        %Float% eps
    4045%$$
    4146
  • trunk/example/example.cpp

    r2240 r2270  
    11/* $Id$ */
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-11 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
     
    6666extern bool BoolFun(void);
    6767extern bool vectorBool(void);
     68extern bool change_const(void);
    6869extern bool CheckNumericType(void);
    6970extern bool checkpoint(void);
     
    220221        ok &= Run( BoolFun,           "BoolFun"          );
    221222        ok &= Run( vectorBool,        "vectorBool"       );
     223        ok &= Run( change_const,      "change_const"     );
    222224        ok &= Run( CheckNumericType,  "CheckNumericType" );
    223225        ok &= Run( checkpoint,        "checkpoint"       );
  • trunk/example/example.vcproj

    r2240 r2270  
    227227                        </File>
    228228                        <File
     229                                RelativePath=".\change_const.cpp"
     230                                >
     231                        </File>
     232                        <File
    229233                                RelativePath=".\check_numeric_type.cpp"
    230234                                >
  • trunk/example/makefile.am

    r2268 r2270  
    7878        bool_fun.cpp \
    7979        vector_bool.cpp \
     80        change_const.cpp \
    8081        check_numeric_type.cpp \
    8182        check_simple_vector.cpp \
  • trunk/example/makefile.in

    r2268 r2270  
    4747        add_eq.cpp ad_fun.cpp ad_in_c.cpp asin.cpp atan.cpp atan_2.cpp \
    4848        base_adolc.hpp bender_quad.cpp bool_fun.cpp vector_bool.cpp \
    49         check_numeric_type.cpp check_simple_vector.cpp checkpoint.cpp \
    50         compare.cpp compare_change.cpp complex_poly.cpp cond_exp.cpp \
    51         conj_grad.cpp copy_ad.cpp copy_base.cpp cos.cpp cosh.cpp \
    52         cppad_vector.cpp default.cpp div.cpp div_eq.cpp epsilon.cpp \
    53         eq.cpp equal_op_seq.cpp erf.cpp error_handler.cpp exp.cpp \
    54         for_one.cpp for_two.cpp forward.cpp for_sparse_jac.cpp \
    55         fun_assign.cpp fun_check.cpp hes_lagrangian.cpp hes_lu_det.cpp \
     49        change_const.cpp check_numeric_type.cpp \
     50        check_simple_vector.cpp checkpoint.cpp compare.cpp \
     51        compare_change.cpp complex_poly.cpp cond_exp.cpp conj_grad.cpp \
     52        copy_ad.cpp copy_base.cpp cos.cpp cosh.cpp cppad_vector.cpp \
     53        default.cpp div.cpp div_eq.cpp epsilon.cpp eq.cpp \
     54        equal_op_seq.cpp erf.cpp error_handler.cpp exp.cpp for_one.cpp \
     55        for_two.cpp forward.cpp for_sparse_jac.cpp fun_assign.cpp \
     56        fun_check.cpp hes_lagrangian.cpp hes_lu_det.cpp \
    5657        hes_minor_det.cpp hessian.cpp hes_times_dir.cpp \
    5758        independent.cpp integer.cpp interface_2c.cpp \
     
    8283        ad_in_c.$(OBJEXT) asin.$(OBJEXT) atan.$(OBJEXT) \
    8384        atan_2.$(OBJEXT) bender_quad.$(OBJEXT) bool_fun.$(OBJEXT) \
    84         vector_bool.$(OBJEXT) check_numeric_type.$(OBJEXT) \
    85         check_simple_vector.$(OBJEXT) checkpoint.$(OBJEXT) \
    86         compare.$(OBJEXT) compare_change.$(OBJEXT) \
    87         complex_poly.$(OBJEXT) cond_exp.$(OBJEXT) conj_grad.$(OBJEXT) \
    88         copy_ad.$(OBJEXT) copy_base.$(OBJEXT) cos.$(OBJEXT) \
    89         cosh.$(OBJEXT) cppad_vector.$(OBJEXT) default.$(OBJEXT) \
    90         div.$(OBJEXT) div_eq.$(OBJEXT) epsilon.$(OBJEXT) eq.$(OBJEXT) \
     85        vector_bool.$(OBJEXT) change_const.$(OBJEXT) \
     86        check_numeric_type.$(OBJEXT) check_simple_vector.$(OBJEXT) \
     87        checkpoint.$(OBJEXT) compare.$(OBJEXT) \
     88        compare_change.$(OBJEXT) complex_poly.$(OBJEXT) \
     89        cond_exp.$(OBJEXT) conj_grad.$(OBJEXT) copy_ad.$(OBJEXT) \
     90        copy_base.$(OBJEXT) cos.$(OBJEXT) cosh.$(OBJEXT) \
     91        cppad_vector.$(OBJEXT) default.$(OBJEXT) div.$(OBJEXT) \
     92        div_eq.$(OBJEXT) epsilon.$(OBJEXT) eq.$(OBJEXT) \
    9193        equal_op_seq.$(OBJEXT) erf.$(OBJEXT) error_handler.$(OBJEXT) \
    9294        exp.$(OBJEXT) for_one.$(OBJEXT) for_two.$(OBJEXT) \
     
    340342        bool_fun.cpp \
    341343        vector_bool.cpp \
     344        change_const.cpp \
    342345        check_numeric_type.cpp \
    343346        check_simple_vector.cpp \
     
    511514@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bender_quad.Po@am__quote@
    512515@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bool_fun.Po@am__quote@
     516@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/change_const.Po@am__quote@
    513517@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_numeric_type.Po@am__quote@
    514518@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_simple_vector.Po@am__quote@
  • trunk/omh/example_list.omh

    r2214 r2270  
    11$Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-11 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
     
    9595$rref BoolFun.cpp$$
    9696$rref team_bthread.cpp$$
     97$rref change_const.cpp$$
    9798$rref CheckNumericType.cpp$$
    9899$rref checkpoint.cpp$$
  • trunk/omh/mul_level.omh

    r1370 r2270  
    11$Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-07 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
     
    2929
    3030$head Background$$
    31 If $italic f$$ is an $syntax%ADFun<%Base%>%$$ object,
     31If $icode f$$ is an $codei%ADFun<%Base%>%$$ object,
    3232the vectors returned by
    33 $xref/Forward//f.Forward/$$,
     33$cref/f.Forward/Forward/$$,
    3434and
    35 $xref/Reverse//f.Reverse/$$,
    36 have values in the base type ($italic Base$$) and not
    37 $syntax%AD<%Base%>%$$.
     35$cref/f.Reverse/Reverse/$$,
     36have values in the base type ($icode Base$$) and not
     37$codei%AD<%Base%>%$$.
    3838This reflects the fact that operations used to calculate
    3939these function values are not recorded by the tape corresponding to
    40 $syntax%AD<%Base%>%$$ operations.
     40$codei%AD<%Base%>%$$ operations.
    4141
    4242$head Motivation$$
     
    4545needed to compute an outer function.
    4646For example,
    47 the derivatives returned by $syntax%%f%.Forward%$$
     47the derivatives returned by $icode%f%.Forward%$$
    4848might be used as part of
    4949Taylor's method for solving ordinary
     
    5757The operations during the calculations of the function defining the
    5858differential equation could be preformed using the a class of the form
    59 $syntax% AD< AD<double> >%$$.
     59$codei% AD< AD<double> >%$$.
    6060
    6161$lnext
    6262The operations during the calculation of Taylor's method
    63 could be preformed using the $syntax% AD<double>%$$ class.
     63could be preformed using the $codei% AD<double>%$$ class.
    6464
    6565$lnext
     
    7171$head General Solution$$
    7272Provided that we are currently recording
    73 $syntax% AD<double>%$$ operations,
    74 and $italic fin$$ is an $syntax%ADFun< AD<double> >%$$ object,
     73$codei% AD<double>%$$ operations,
     74and $icode fin$$ is an $codei%ADFun< AD<double> >%$$ object,
    7575the operations used to compute the vectors
    7676returned by
    77 $syntax%%fin%.Forward%$$,
    78 $syntax%%fin%.Rev%$$,
     77$icode%fin%.Forward%$$,
     78$icode%fin%.Rev%$$,
    7979and
    80 $syntax%%fin%.RevTwo%$$,
     80$icode%fin%.RevTwo%$$,
    8181will be recorded on the tape corresponding to
    82 $syntax%AD<double>%$$ operations.
     82$codei%AD<double>%$$ operations.
    8383
    8484
     
    8787$subhead Start ADBaseTape$$
    8888The first step is to declare the independent variables using
    89 $syntax%
     89$codei%
    9090        Independent(%x%)
    9191%$$
    92 where $italic x$$ is
    93 a $cref/SimpleVector/$$ with elements of type $syntax%AD<double>%$$.
     92where $icode x$$ is
     93a $cref SimpleVector$$ with elements of type $codei%AD<double>%$$.
    9494This will start recording a new tape of
    95 operations performed using $syntax%AD<double>%$$ class objects.
     95operations performed using $codei%AD<double>%$$ class objects.
    9696
    9797$subhead Start ADDBaseTape$$
    9898The next step is to declare the independent variables using
    99 $syntax%
     99$codei%
    100100        Independent(%X%)
    101101%$$
    102 where $italic X$$ is
    103 a $cref/SimpleVector/$$ with elements of type
    104 $syntax%CPPAD_TEST_VECTOR< AD< AD<double> > >%$$.
     102where $icode X$$ is
     103a $cref SimpleVector$$ with elements of type
     104$codei%CPPAD_TEST_VECTOR< AD< AD<double> > >%$$.
    105105This will start recording a new tape of
    106 operations performed using $syntax%AD< AD<double> >%$$ class objects.
     106operations performed using $codei%AD< AD<double> >%$$ class objects.
    107107
    108108$subhead Inner Function Calculations$$
    109109The next step is to calculation
    110110the inner functions
    111 using $syntax%AD< AD<double> >%$$ class objects.
     111using $codei%AD< AD<double> >%$$ class objects.
    112112
    113113$subhead Derivative of Inner Function$$
    114114The next step is to create the
    115 $syntax%ADFun< AD<double> >%$$ function object $italic fin$$.
     115$codei%ADFun< AD<double> >%$$ function object $icode fin$$.
    116116This will also stop recording of
    117 operations performed using $syntax%AD< AD<double> >%$$ class objects.
    118 The $italic fin$$ object can then be used to calculate
     117operations performed using $codei%AD< AD<double> >%$$ class objects.
     118The $icode fin$$ object can then be used to calculate
    119119the derivatives needed to compute the outer function.
    120120
     
    122122The next step is to compute the
    123123outer function
    124 using $syntax%AD<double>%$$ class objects.
     124using $codei%AD<double>%$$ class objects.
    125125
    126126$subhead Derivative of Outer Function$$
    127127The next step is to create the
    128 $syntax%ADFun<double>%$$ function object $italic fout$$.
     128$codei%ADFun<double>%$$ function object $icode fout$$.
    129129This will also stop the recording of
    130 operations performed using $syntax%AD<double>%$$ class objects.
    131 The $italic fout$$ object can then be used to calculate
     130operations performed using $codei%AD<double>%$$ class objects.
     131The $icode fout$$ object can then be used to calculate
    132132the derivatives of the outer function.
    133133
    134134
    135135$children%
    136         example/mul_level.cpp
     136        example/mul_level.cpp%
     137        example/change_const.cpp
    137138%$$
    138139
    139140$head Example$$
    140 The file
    141 $xref/mul_level.cpp/$$
    142 contains an example and test of this procedure.   
    143 It returns true if it succeeds and false otherwise.
    144 The file $xref/ode_taylor.cpp/$$ is a more complex example
     141The files
     142$cref mul_level.cpp$$ and $cref change_const.cpp$$
     143contain an examples and tests of this procedure.   
     144They return true if they succeed and false otherwise.
     145The file $cref ode_taylor.cpp$$ is a more complex example
    145146use of multiple tapes.
    146147
  • trunk/omh/whats_new_12.omh

    r2269 r2270  
    3232The purpose of this section is to
    3333assist you in learning about changes between various versions of CppAD.
     34
     35$head 01-20$$
     36$list number$$
     37Add the example $cref change_const.cpp$$
     38which shows how to compute derivatives of functions that have
     39parameters that can change (but derivatives are not computed
     40with respect to these parameters).
     41$lnext
     42The documentation for machine $cref epsilon$$
     43has been improved.
     44(The fact that it can be used for $icode Base$$ types was missing.)
     45$lend
    3446
    3547$head 01-19$$
Note: See TracChangeset for help on using the changeset viewer.