Changeset 3779


Ignore:
Timestamp:
Jan 1, 2016 6:26:11 AM (4 years ago)
Author:
bradbell
Message:

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: cf5ca238670f67655fbbf3e23727437f7ed7b182
end hash code: 5661e2a629cceb77e7b703225bc1f3f8cf422129

commit 5661e2a629cceb77e7b703225bc1f3f8cf422129
Author: Brad Bell <bradbell@…>
Date: Fri Jan 1 04:23:41 2016 -0700

push_git2svn.py: Include changes in copyright date when checking for difference.

commit f0e9d149dc00ccf410a268389e3dcfd95499b863
Author: Brad Bell <bradbell@…>
Date: Fri Jan 1 03:57:09 2016 -0700

Advance copyright year to 2016.

commit 01d25679b7baddca878129635b0758f4ebb263fb
Author: Brad Bell <bradbell@…>
Date: Fri Jan 1 03:54:41 2016 -0700

download.omh: improve the no documentation download instructions.

Location:
trunk
Files:
104 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/add_copyright.sh

    r3768 r3779  
    22# $Id$
    33# -----------------------------------------------------------------------------
    4 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
    55#
    66# CppAD is distributed under multiple licenses. This distribution is under
     
    4141// \$Id\$
    4242/* --------------------------------------------------------------------------
    43 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     43CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
    4444
    4545CppAD is distributed under multiple licenses. This distribution is under
     
    5757# \$Id\$
    5858# -----------------------------------------------------------------------------
    59 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     59# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
    6060#
    6161# CppAD is distributed under multiple licenses. This distribution is under
     
    7474# \$Id\$
    7575# -----------------------------------------------------------------------------
    76 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     76# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
    7777#
    7878# CppAD is distributed under multiple licenses. This distribution is under
  • trunk/bin/check_copyright.sh

    r3768 r3779  
    22# $Id$
    33# -----------------------------------------------------------------------------
    4 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
    55#
    66# CppAD is distributed under multiple licenses. This distribution is under
     
    3333cat << EOF > check_copyright.1.$$
    3434# Change copyright second year to current year
    35 s/Copyright (C) \\([0-9]*\\)-[0-9][0-9] Bradley M. Bell/Copyright (C) \\1-15 Bradley M. Bell/
    36 s/Copyright (C) \\([0-9]*\\)-20[0-9][0-9] Bradley M. Bell/Copyright (C) \\1-15 Bradley M. Bell/
     35s/Copyright (C) \\([0-9]*\\)-[0-9][0-9] Bradley M. Bell/Copyright (C) \\1-16 Bradley M. Bell/
     36s/Copyright (C) \\([0-9]*\\)-20[0-9][0-9] Bradley M. Bell/Copyright (C) \\1-16 Bradley M. Bell/
    3737EOF
    3838ok=true
  • trunk/bin/push_git2svn.py

    r3758 r3779  
    22# $Id
    33# -----------------------------------------------------------------------------
    4 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
     4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
    55#
    66# CppAD is distributed under multiple licenses. This distribution is under
     
    8787id_pattern    = re.compile(r'^.*\$Id.*$',      re.MULTILINE)
    8888white_pattern = re.compile(r'[ \t]+$',         re.MULTILINE)
    89 date_pattern  = re.compile(r'2003-[0-9][0-9]', re.MULTILINE)
    9089def ignore_data(data) :
    9190        data = re.sub(id_pattern,    '', data)
    9291        data = re.sub(white_pattern, '', data)
    93         data = re.sub(date_pattern,  '', data)
    9492        return data
    9593# -----------------------------------------------------------------------------
  • trunk/compare_c/makefile.am

    r2580 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1212# automake input file
    1313# See ./CMakeLists.txt for specifications.
    14 # 
     14#
    1515BUILT_SOURCES = det_by_minor_c.c det_by_minor_cpp.cpp
    1616det_by_minor_c.c: det_by_minor.c
     
    2525DEFS =
    2626#
    27 # AM_CXXFLAGS = -g 
    28 # AM_CFLAGS   = -g 
     27# AM_CXXFLAGS = -g
     28# AM_CFLAGS   = -g
    2929#
    30 AM_CXXFLAGS = -O2 -DNDEBUG 
    31 AM_CFLAGS   = -O2 -DNDEBUG 
     30AM_CXXFLAGS = -O2 -DNDEBUG
     31AM_CFLAGS   = -O2 -DNDEBUG
    3232#
    3333check_PROGRAMS    = det_by_minor_c det_by_minor_cpp
  • trunk/cppad_ipopt/example/example.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    5252        ok &= Run( ode_simple_check,    "ode_simple_check"   );
    5353        ok &= Run( ode_fast_check,      "ode_fast_check"     );
    54        
     54
    5555        // check for errors
    5656        using std::cout;
  • trunk/cppad_ipopt/example/makefile.am

    r2683 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    2121check_PROGRAMS    = example
    2222#
    23 AM_CXXFLAGS       = -g $(CXX_FLAGS) 
     23AM_CXXFLAGS       = -g $(CXX_FLAGS)
    2424#
    2525AM_CPPFLAGS       = -I. \
     
    3636                    $(PTHREAD_LIB) \
    3737                    $(DL_LIB)
    38 AM_LDFLAGS        = -L../src 
     38AM_LDFLAGS        = -L../src
    3939#
    4040example_SOURCES   = \
  • trunk/cppad_ipopt/example/ode1.omh

    r2683 r3779  
    11$Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1919        cppad_ipopt/example/ode_check.cpp
    2020%$$
    21        
     21
    2222
    2323$end
  • trunk/cppad_ipopt/example/ode_fast_check.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-10 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    3333                ok &= ode_check(N, x);
    3434        }
    35  
     35
    3636        return ok;
    3737}
  • trunk/cppad_ipopt/example/ode_simple_check.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-10 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    3333                ok &= ode_check(N, x);
    3434        }
    35  
     35
    3636        return ok;
    3737}
  • trunk/cppad_ipopt/speed/makefile.am

    r2506 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1818#
    1919check_PROGRAMS    = speed
    20 # 
     20#
    2121# BEGIN OPTIMIZE
    2222AM_CXXFLAGS       = -O2 -DNDEBUG $(CXX_FLAGS)
     
    3939                    $(PTHREAD_LIB) \
    4040                    $(DL_LIB)
    41 AM_LDFLAGS        = -L../src 
     41AM_LDFLAGS        = -L../src
    4242#
    4343# Cannot use ../src/libcppad_ipopt.a becasue it is compiled for debugging
    44 # so build an optimized version here to use here. 
     44# so build an optimized version here to use here.
    4545speed_SOURCES   = \
    4646        speed.cpp \
     
    5151        ../src/sparse_map2vec.cpp \
    5252        ../src/vec_fun_pattern.cpp \
    53         ode_speed.cpp 
     53        ode_speed.cpp
    5454
    5555test: check
  • trunk/cppad_ipopt/speed/ode_speed.cpp

    r2769 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
  • trunk/cppad_ipopt/speed/speed.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-11 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2626        name    = "simple_retape_yes";
    2727        seconds = ode_speed(name, count);
    28         printf("ode %20s: seconds = %5.2f: eval_r_count = %d\n", 
     28        printf("ode %20s: seconds = %5.2f: eval_r_count = %d\n",
    2929                name, seconds, int(count) );
    3030
     
    4343        printf("ode %20s: seconds = %5.2f: eval_r_count = %d\n",
    4444                name, seconds, int(count) );
    45        
     45
    4646        return 0;
    4747}
  • trunk/cppad_ipopt/src/hes_fg_map.cpp

    r3223 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1919\{
    2020\file hes_fg_map.cpp
    21 \brief Creates a mapping between two representations for Hessian of fg. 
     21\brief Creates a mapping between two representations for Hessian of fg.
    2222*/
    2323
     
    2626Create mapping from CppAD to Ipopt sparse representations of Hessian of F(x).
    2727
    28 The functions 
     28The functions
    2929\f$ f : {\bf R}^n \rightarrow {\bf R} \f$ and
    30 \f$ g : {\bf R}^n \rightarrow {\bf R}^m \f$ are defined by the 
     30\f$ g : {\bf R}^n \rightarrow {\bf R}^m \f$ are defined by the
    3131\ref Users_Representation.
    32 We define the function 
     32We define the function
    3333\f$ F : {\bf R}^n \rightarrow {\bf R} \f$ by
    3434\f[
     
    3939For <tt>k = 0 , ... , K-1</tt>,
    4040for <tt>ell = 0 , ... , L[k]</tt>,
    41 the function call 
     41the function call
    4242\verbatim
    43         fg_info->index(k, ell, I, J);   
     43        fg_info->index(k, ell, I, J);
    4444\endverbatim
    45 is made by \c hes_fg_map. 
     45is made by \c hes_fg_map.
    4646The values \c k and \c ell are inputs.
    47 The input size of \c I ( \c J ) 
     47The input size of \c I ( \c J )
    4848is greater than or equal <tt>p[k] ( q[k] )</tt>
    4949and this size is not changed.
     
    6767
    6868\param K
    69 is the number of functions \f$ r_k ( u ) \f$ used for the representation of 
     69is the number of functions \f$ r_k ( u ) \f$ used for the representation of
    7070\f$ f(x) \f$ and \f$ g(x) \f$.
    7171
     
    9191is a vector with size \c K.
    9292For <tt>k = 0 , ... , K-1, pattern_jac_r[k]</tt>
    93 is a CppAD sparsity pattern for the Hessian of the function 
     93is a CppAD sparsity pattern for the Hessian of the function
    9494\f[
    9595        R(u) = \sum_{i=0}^{p[k]-1} r_k (u)_i
     
    109109\param index_hes_fg:
    110110On input, this is empty; i.e., <tt>index_jac_g.size() == 0</tt>.
    111 On output, it is the index mapping from \f$ (i, j) \f$ in the Jacobian of 
     111On output, it is the index mapping from \f$ (i, j) \f$ in the Jacobian of
    112112\f$ g(x) \f$ to the corresponding index value used by Ipopt to represent
    113113the Jacobian.
     
    116116*/
    117117void hes_fg_map(
    118         cppad_ipopt_fg_info*  fg_info                                  , 
     118        cppad_ipopt_fg_info*  fg_info                                  ,
    119119        size_t                                          m              ,
    120120        size_t                                          n              ,
     
    142142        }
    143143# endif
    144        
     144
    145145        // Now compute pattern for fg
    146146        // (use standard set representation because can be huge).
    147147        CppAD::vector< std::set<size_t> > pattern_hes_fg(n);
    148148        for(k = 0; k < K; k++) for(ell = 0; ell < L[k]; ell++)
    149         {       fg_info->index(k, ell, I, J);   
    150                 for(i = 0; i < q[k]; i++) 
     149        {       fg_info->index(k, ell, I, J);
     150                for(i = 0; i < q[k]; i++)
    151151                {       for(j = 0; j < q[k]; j++)
    152152                        {       ij  = i * q[k] + j;
     
    157157        }
    158158
    159         // Now compute the mapping from (i, j) in the Hessian of fg to the 
     159        // Now compute the mapping from (i, j) in the Hessian of fg to the
    160160        // corresponding index value used by Ipopt to represent the Hessian.
    161161        CPPAD_ASSERT_UNKNOWN( index_hes_fg.size() == 0 );
     
    164164        ell = 0;
    165165        for(i = 0; i < n; i++)
    166         {       for(    itr = pattern_hes_fg[i].begin(); 
     166        {       for(    itr = pattern_hes_fg[i].begin();
    167167                        itr != pattern_hes_fg[i].end(); itr++)
    168168                {
  • trunk/cppad_ipopt/src/jac_g_map.cpp

    r3223 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1818\{
    1919\file jac_g_map.cpp
    20 \brief Creates a mapping between two representations for Jacobian of g. 
     20\brief Creates a mapping between two representations for Jacobian of g.
    2121*/
    2222
     
    2525Create mapping from CppAD to Ipopt sparse representations of Jacobian of g.
    2626
    27 The functions 
     27The functions
    2828\f$ f : {\bf R}^n \rightarrow {\bf R} \f$ and
    2929\f$ g : {\bf R}^n \rightarrow {\bf R}^m \f$ are defined by
     
    3333For <tt>k = 0 , ... , K-1</tt>,
    3434for <tt>ell = 0 , ... , L[k]</tt>,
    35 the function call 
     35the function call
    3636\verbatim
    37         fg_info->index(k, ell, I, J);   
     37        fg_info->index(k, ell, I, J);
    3838\endverbatim
    39 is made by \c jac_g_map. 
     39is made by \c jac_g_map.
    4040The values \c k and \c ell are inputs.
    41 The input size of \c I ( \c J ) 
     41The input size of \c I ( \c J )
    4242is greater than or equal <tt>p[k] ( q[k] )</tt>
    4343and this size is not changed.
     
    6161
    6262\param K
    63 is the number of functions \f$ r_k ( u ) \f$ used for the representation of 
     63is the number of functions \f$ r_k ( u ) \f$ used for the representation of
    6464\f$ f(x) \f$ and \f$ g(x) \f$.
    6565
     
    8585is a vector with size \c K.
    8686For <tt>k = 0 , ... , K-1, pattern_jac_r[k]</tt>
    87 is a CppAD sparsity pattern for the Jacobian of the function 
     87is a CppAD sparsity pattern for the Jacobian of the function
    8888\f$ r_k : {\bf R}^{q(k)} \rightarrow {\bf R}^{p(k)} \f$.
    8989As such, <tt>pattern_jac_r[k].size() == p[k] * q[k]</tt>.
     
    101101\param index_jac_g:
    102102On input, this is empty; i.e., <tt>index_jac_g.size() == 0</tt>.
    103 On output, it is the index mapping from \f$ (i, j) \f$ in the Jacobian of 
     103On output, it is the index mapping from \f$ (i, j) \f$ in the Jacobian of
    104104\f$ g(x) \f$ to the corresponding index value used by Ipopt to represent
    105105the Jacobian.
     
    108108*/
    109109void jac_g_map(
    110         cppad_ipopt_fg_info*  fg_info                                  , 
     110        cppad_ipopt_fg_info*  fg_info                                  ,
    111111        size_t                                          m              ,
    112112        size_t                                          n              ,
     
    138138        CppAD::vector< std::set<size_t> > pattern_jac_g(m);
    139139        for(k = 0; k < K; k++) for(ell = 0; ell < L[k]; ell++)
    140         {       fg_info->index(k, ell, I, J);   
     140        {       fg_info->index(k, ell, I, J);
    141141                for(i = 0; i < p[k]; i++) if( I[i] != 0 )
    142142                {       for(j = 0; j < q[k]; j++)
     
    148148        }
    149149
    150         // Now compute the mapping from (i, j) in the Jacobian of g to the 
     150        // Now compute the mapping from (i, j) in the Jacobian of g to the
    151151        // corresponding index value used by Ipopt to represent the Jacobian.
    152152        CPPAD_ASSERT_UNKNOWN( index_jac_g.size() == 0 );
     
    155155        ell = 0;
    156156        for(i = 0; i < m; i++)
    157         {       for(    itr = pattern_jac_g[i].begin(); 
     157        {       for(    itr = pattern_jac_g[i].begin();
    158158                        itr != pattern_jac_g[i].end(); itr++)
    159159                {
  • trunk/cppad_ipopt/src/makefile.am

    r2683 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1616#
    1717#
    18 AM_CXXFLAGS               = -g $(CXX_FLAGS) 
     18AM_CXXFLAGS               = -g $(CXX_FLAGS)
    1919#
    2020AM_CPPFLAGS               = \
     
    3939        sparse_map2vec.hpp \
    4040        vec_fun_pattern.cpp  \
    41         vec_fun_pattern.hpp 
     41        vec_fun_pattern.hpp
    4242endif
  • trunk/cppad_ipopt/src/sparse_map2vec.cpp

    r3223 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
  • trunk/cppad_ipopt/src/vec_fun_pattern.cpp

    r3223 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    6868is a vector of length p[k] * q[k]
    6969and the value of its elements does not matter.
    70 On output it is a CppAD sparsity pattern for the Jacobian of 
     70On output it is a CppAD sparsity pattern for the Jacobian of
    7171\f$ r_k (u) \f$.
    7272
     
    7676is a vector of length q[k] * q[k]
    7777and the value of its elements does not matter.
    78 On output it is a CppAD sparsity pattern for the Hessian of 
     78On output it is a CppAD sparsity pattern for the Hessian of
    7979\f$ R : {\bf R}^{q[k]} \rightarrow {\bf R} \f$ which is defined by
    8080\f[
     
    109109                {       for(i = 0; i < p[k]; i++)
    110110                        {       for(j = 0; j < q[k]; j++)
    111                                         pattern_jac_r[k][i*q[k] + j] = true; 
     111                                        pattern_jac_r[k][i*q[k] + j] = true;
    112112                        }
    113113                        for(i = 0; i < q[k]; i++)
    114114                        {       for(j = 0; j < q[k]; j++)
    115                                         pattern_hes_r[k][i*q[k] + j] = true; 
     115                                        pattern_hes_r[k][i*q[k] + j] = true;
    116116                        }
    117117                }
    118                 else 
     118                else
    119119                {       // check assumptions about r_k
    120120                        CPPAD_ASSERT_UNKNOWN( r_fun[k].Range() == p[k] );
     
    124124                        CppAD::vectorBool pattern_domain(q[k] * q[k]);
    125125                        for(i = 0; i < q[k]; i++)
    126                         {       for(j = 0; j < q[k]; j++) 
     126                        {       for(j = 0; j < q[k]; j++)
    127127                                        pattern_domain[i*q[k] + j] = (i == j);
    128128                        }
    129129                        // use forward mode to compute Jacobian sparsity
    130                         pattern_jac_r[k] = 
     130                        pattern_jac_r[k] =
    131131                                r_fun[k].ForSparseJac(q[k], pattern_domain);
    132132                        // user reverse mode to compute Hessian sparsity
  • trunk/cppad_ipopt/test/makefile.am

    r2506 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1919check_PROGRAMS    = test_more
    2020#
    21 AM_CXXFLAGS       = -g $(CXX_FLAGS) 
     21AM_CXXFLAGS       = -g $(CXX_FLAGS)
    2222#
    2323AM_CPPFLAGS       = -I. \
     
    3434                    $(PTHREAD_LIB) \
    3535                    $(DL_LIB)
    36 AM_LDFLAGS        = -L../src 
     36AM_LDFLAGS        = -L../src
    3737#
    3838test_more_SOURCES   = \
  • trunk/cppad_ipopt/test/multiple_solution.cpp

    r2896 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    4343        {       size_t q;
    4444                switch(k)
    45                 {       case 0:  q = 1;  break; 
     45                {       case 0:  q = 1;  break;
    4646                        default: assert(0);
    4747                }
     
    8282                assert( u.size() == 1 );
    8383                ADVector r(1);
    84                 r[0] = u[0] ; 
     84                r[0] = u[0] ;
    8585                return r;
    8686        }
     
    9494        size_t n = 2;
    9595        // number of constraints (range dimension for g)
    96         size_t m = 2; 
     96        size_t m = 2;
    9797        // initial value of the independent variables
    9898        NumberVector x_i(n);
  • trunk/cppad_ipopt/test/test_more.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    5454        ok &= Run( retape_k1_l1,        "retape_k1_l1"       );
    5555        ok &= Run( retape_k1_l2,        "retape_k1_l2"       );
    56        
     56
    5757        // check for errors
    5858        using std::cout;
  • trunk/example/ipopt_solve/makefile.am

    r2661 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1717check_PROGRAMS    = solve
    1818#
    19 AM_CXXFLAGS       = -g $(CXX_FLAGS) 
     19AM_CXXFLAGS       = -g $(CXX_FLAGS)
    2020#
    2121AM_CPPFLAGS       = -I. \
  • trunk/introduction/exp_apx/exp_2.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1515bool exp_2(void)
    1616{       double x     = .5;
    17         double check = 1 + x + x * x / 2.; 
    18         bool   ok    = std::fabs( exp_2(x) - check ) <= 1e-10; 
     17        double check = 1 + x + x * x / 2.;
     18        bool   ok    = std::fabs( exp_2(x) - check ) <= 1e-10;
    1919        return ok;
    2020}
  • trunk/introduction/exp_apx/exp_2_cppad.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-07 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    4040partial derivative with respect to $latex x$$,
    4141at the point $latex x = .5$$,
    42 of the function 
     42of the function
    4343$codei%
    4444        exp_2(%x%)
     
    5050Create and test a modified version of the routine below that computes
    5151the same order derivatives with respect to $latex x$$,
    52 at the point $latex x = .1$$ 
    53 of the function 
     52at the point $latex x = .1$$
     53of the function
    5454$codei%
    5555        exp_2(%x%)
     
    5959$codei%
    6060        exp_3(%x%)
    61 %$$ 
     61%$$
    6262that evaluates the function
    6363$latex \[
     
    7070$codep */
    7171
    72 # include <cppad/cppad.hpp>  // http://www.coin-or.org/CppAD/ 
     72# include <cppad/cppad.hpp>  // http://www.coin-or.org/CppAD/
    7373# include "exp_2.hpp"        // second order exponential approximation
    7474bool exp_2_cppad(void)
     
    8888        // evaluate our exponential approximation
    8989        AD<double> x   = X[0];
    90         AD<double> apx = exp_2(x); 
     90        AD<double> apx = exp_2(x);
    9191
    9292        // range space vector
     
    9696
    9797        // Create f: X -> Y corresponding to this operation sequence
    98         // and stop recording. This also executes a zero order forward 
     98        // and stop recording. This also executes a zero order forward
    9999        // sweep using values in X for x.
    100100        CppAD::ADFun<double> f(X, Y);
     
    119119        // second order forward sweep that computes
    120120        // second partial of exp_2(x) with respect to x
    121         vector<double> x2(n);     // second order Taylor coefficients 
    122         vector<double> y2(m); 
     121        vector<double> x2(n);     // second order Taylor coefficients
     122        vector<double> y2(m);
    123123        x2[0] = 0.;               // evaluate second partial .w.r.t. x
    124124        y2    = f.Forward(2, x2);
    125         check = 0.5 * 1.;         // Taylor coef is 1/2 second derivative 
     125        check = 0.5 * 1.;         // Taylor coef is 1/2 second derivative
    126126        ok   &= NearEqual(y2[0], check, 1e-10, 1e-10);
    127127
  • trunk/introduction/exp_apx/exp_eps.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1717        double epsilon = .2;
    1818        double check   = 1 + .5 + .125; // include 1 term less than epsilon
    19         bool   ok      = std::fabs( exp_eps(x, epsilon) - check ) <= 1e-10; 
     19        bool   ok      = std::fabs( exp_eps(x, epsilon) - check ) <= 1e-10;
    2020        return ok;
    2121}
  • trunk/introduction/exp_apx/exp_eps_cppad.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-07 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    4141partial derivative with respect to $latex x$$,
    4242at the point $latex x = .5$$ and $latex \varepsilon = .2$$,
    43 of the function 
     43of the function
    4444$codei%
    4545        exp_eps(%x%, %epsilon%)
     
    5252the same order derivatives with respect to $latex x$$,
    5353at the point $latex x = .1$$ and $latex \varepsilon = .2$$,
    54 of the function 
     54of the function
    5555$codei%
    5656        exp_eps(%x%, %epsilon%)
     
    6060partial derivative with respect to $latex x$$,
    6161at the point $latex x = .1$$ and $latex \varepsilon = .2$$,
    62 of the function corresponding to the operation sequence 
     62of the function corresponding to the operation sequence
    6363for $latex x = .5$$ and $latex \varepsilon = .2$$.
    6464Hint: you could define a vector u with two components and use
     
    7171$lend
    7272$codep */
    73 # include <cppad/cppad.hpp>  // http://www.coin-or.org/CppAD/ 
     73# include <cppad/cppad.hpp>  // http://www.coin-or.org/CppAD/
    7474# include "exp_eps.hpp"      // our example exponential function approximation
    7575bool exp_eps_cppad(void)
     
    9191        AD<double> x       = U[0];
    9292        AD<double> epsilon = U[1];
    93         AD<double> apx = exp_eps(x, epsilon); 
     93        AD<double> apx = exp_eps(x, epsilon);
    9494
    9595        // range space vector
     
    9999
    100100        // Create f: U -> Y corresponding to this operation sequence
    101         // and stop recording. This also executes a zero order forward 
     101        // and stop recording. This also executes a zero order forward
    102102        // mode sweep using values in U for x and e.
    103103        CppAD::ADFun<double> f(U, Y);
     
    115115        vector<double>  w(m);     // weights for components of the range
    116116        vector<double> dw(n);     // derivative of the weighted function
    117         w[0] = 1.;                // there is only one weight 
     117        w[0] = 1.;                // there is only one weight
    118118        dw   = f.Reverse(1, w);   // derivative of w[0] * exp_eps(x, epsilon)
    119119        check = 1.5;              // partial w.r.t. x
  • trunk/introduction/exp_apx/makefile.am

    r2541 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    2020        exp_eps.omh
    2121#
    22 check_PROGRAMS    = exp_apx 
     22check_PROGRAMS    = exp_apx
    2323#
    2424AM_CPPFLAGS       = -I. -I$(top_srcdir) $(BOOST_INCLUDE) $(EIGEN_INCLUDE)
  • trunk/introduction/get_started/makefile.am

    r2541 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1616DEFS          =
    1717#
    18 check_PROGRAMS      = get_started 
     18check_PROGRAMS      = get_started
    1919#
    2020AM_CPPFLAGS         = -I. -I$(top_srcdir) $(BOOST_INCLUDE) $(EIGEN_INCLUDE)
  • trunk/multi_thread/makefile.am

    r2556 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1818OPENMP_TEST = openmp_test
    1919else
    20 OPENMP_TEST = 
     20OPENMP_TEST =
    2121endif
    2222#
     
    2929else
    3030# BTHREAD_LIB empty in this case
    31 BTHREAD_TEST = 
    32 BOOST_LIB     = 
     31BTHREAD_TEST =
     32BOOST_LIB     =
    3333endif
    3434#
     
    3636PTHREAD_TEST = pthread_test
    3737else
    38 PTHREAD_TEST = 
     38PTHREAD_TEST =
    3939endif
    4040#
    41 check_PROGRAMS    = $(OPENMP_TEST) $(BTHREAD_TEST) $(PTHREAD_TEST) 
     41check_PROGRAMS    = $(OPENMP_TEST) $(BTHREAD_TEST) $(PTHREAD_TEST)
    4242#
    4343if CppAD_MS_COMPILER
    44 # AM_CXXFLAGS     = -EHsc -g $(CXX_FLAGS) 
    45 AM_CXXFLAGS       = -EHsc -DNDEBUG -O2 $(CXX_FLAGS) 
     44# AM_CXXFLAGS     = -EHsc -g $(CXX_FLAGS)
     45AM_CXXFLAGS       = -EHsc -DNDEBUG -O2 $(CXX_FLAGS)
    4646else
    4747# AM_CXXFLAGS     = -g $(CXX_FLAGS)
     
    6969        harmonic_time.cpp      harmonic_time.hpp \
    7070        harmonic.cpp           harmonic.hpp \
    71         harmonic_work.cpp      harmonic_work.hpp 
     71        harmonic_work.cpp      harmonic_work.hpp
    7272#
    7373bthread_test_SOURCES = \
     
    8181        openmp/team_openmp.cpp \
    8282        openmp/a11c_openmp.cpp  \
    83         openmp/simple_ad_openmp.cpp 
     83        openmp/simple_ad_openmp.cpp
    8484#
    8585pthread_test_SOURCES = \
     
    8787        pthread/team_pthread.cpp \
    8888        pthread/a11c_pthread.cpp  \
    89         pthread/simple_ad_pthread.cpp 
     89        pthread/simple_ad_pthread.cpp
    9090#
    9191dist_noinst_SCRIPTS = test.sh
  • trunk/multi_thread/test_multi/makefile.am

    r2506 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1818TEST_OPENMP_FLAG   = -DCPPAD_TEST_OPENMP
    1919else
    20 TEST_OPENMP_FLAG   = 
     20TEST_OPENMP_FLAG   =
    2121endif
    2222#
     
    3636test_multi_SOURCES  = \
    3737        test_multi.cpp \
    38         user_atomic.cpp 
     38        user_atomic.cpp
    3939
    4040test: check
  • trunk/multi_thread/test_multi/user_atomic.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2929        {       return static_cast<size_t>( omp_get_thread_num() ); }
    3030# endif
    31        
     31
    3232        // y[0] = x[0] + x[1]
    3333        bool user_atomic_forward(
    3434                size_t                         id ,
    35                 size_t                          k , 
     35                size_t                          k ,
    3636                size_t                          n ,
    3737                size_t                          m ,
    3838                const CppAD::vector<bool>&     vx ,
    3939                CppAD::vector<bool>&           vy ,
    40                 const CppAD::vector<double>&   tx , 
     40                const CppAD::vector<double>&   tx ,
    4141                CppAD::vector<double>&         ty )
    4242        {       assert(n >= 3 && m == 2);
    43                 if( k > 0 ) 
     43                if( k > 0 )
    4444                        return false;
    4545
    4646                ty[0] = tx[0] + tx[1];
    4747                ty[1] = tx[1] + tx[2];
    48                
     48
    4949                if( vy.size() > 0 )
    5050                {       vy[0] = (vx[0] | vx[1]);
    5151                        vy[1] = (vx[1] | vx[2]);
    5252                }
    53                 return true; 
     53                return true;
    5454        }
    5555
    5656        bool user_atomic_reverse(
    5757                size_t                         id ,
    58                 size_t                          k , 
    59                 size_t                          n , 
    60                 size_t                          m , 
    61                 const CppAD::vector<double>&   tx , 
     58                size_t                          k ,
     59                size_t                          n ,
     60                size_t                          m ,
     61                const CppAD::vector<double>&   tx ,
    6262                const CppAD::vector<double>&   ty ,
    6363                CppAD::vector<double>&         px ,
     
    103103                user_atomic_for_jac_sparse ,
    104104                user_atomic_rev_jac_sparse ,
    105                 user_atomic_rev_hes_sparse 
     105                user_atomic_rev_hes_sparse
    106106        )
    107107
     
    118118                        ax[j] = AD<double>(j + 1);
    119119                CppAD::Independent(ax);
    120        
     120
    121121                // use user atomic function
    122122                size_t id = 0;
    123123                my_user_atomic(id, ax, ay);
    124        
     124
    125125                // create function
    126126                CppAD::ADFun<double> g(ax, ay);
    127        
     127
    128128                // now use the tape with the user atomic function
    129129                vector<double> x(n), y(m);
     
    135135                // y[1] = x[1] + x[2]
    136136                ok &= (y[0] == x[0] + x[1]);
    137        
     137
    138138                return ok;
    139139        }
     
    183183
    184184        // --------------------------------------------------------------------
    185         // Free all temporary work space associated with user_atomic objects. 
    186         // (If there are future calls to user atomic functions, they will 
     185        // Free all temporary work space associated with user_atomic objects.
     186        // (If there are future calls to user atomic functions, they will
    187187        // create new temporary work space.)
    188188        CppAD::user_atomic<double>::clear();
  • trunk/omh/bib.omh

    r2506 r3779  
    22// BEGIN SHORT COPYRIGHT
    33/* --------------------------------------------------------------------------
    4 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-06 Bradley M. Bell
     4CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    55
    66CppAD is distributed under multiple licenses. This distribution is under
    7 the terms of the 
     7the terms of the
    88                    Eclipse Public License Version 1.0.
    99
     
    4444Evaluating Derivatives: Principles and Techniques of
    4545Algorithmic Differentiation,
    46 Andreas Griewank, 
    47 SIAM, 
     46Andreas Griewank,
     47SIAM,
    4848Philadelphia,
    49492000
  • trunk/omh/forward/size_order.omh

    r3214 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2727$head Purpose$$
    2828Determine the number of Taylor coefficient orders, per variable,direction,
    29 currently calculated and stored in the ADFun object $icode f$$. 
    30 See the discussion under 
     29currently calculated and stored in the ADFun object $icode f$$.
     30See the discussion under
    3131$cref/Constructor/size_order/Constructor/$$,
    3232$cref/Forward/size_order/Forward/$$, and
     
    4646        size_t %s%
    4747%$$
    48 and is the number of Taylor coefficient orders, 
     48and is the number of Taylor coefficient orders,
    4949per variable,direction in the AD operation sequence,
    5050currently calculated and stored in the ADFun object $icode f$$.
     
    6565        %f%.Forward(%q%, %x_q%)
    6666%$$
    67 the value of $icode s$$ returned by $code size_order$$ 
     67the value of $icode s$$ returned by $code size_order$$
    6868would be $latex q + 1$$.
    6969The call to $code Forward$$ above
    70 uses the lower order Taylor coefficients to compute and store 
     70uses the lower order Taylor coefficients to compute and store
    7171the $th q$$ order Taylor coefficients for all
    7272the variables in the operation sequence corresponding to $icode f$$.
     
    7878$head capacity_order$$
    7979If the number of Taylor coefficient orders
    80 currently stored in $icode f$$ is less than or equal $icode c$$, 
     80currently stored in $icode f$$ is less than or equal $icode c$$,
    8181a call to $cref capacity_order$$ with the syntax
    8282$codei%
     
    8787the value $icode s$$ returned by $code size_order$$
    8888is equal to $icode c$$
    89 (only Taylor coefficients of order zero through $latex c-1$$ 
     89(only Taylor coefficients of order zero through $latex c-1$$
    9090have been retained).
    9191
  • trunk/omh/install/download.omh

    r3778 r3779  
    129129
    130130$head Release Versions$$
     131
     132$subhead Coin$$
    131133Release versions have the $icode rel$$ field in the compressed archive name.
    132134The release version on the
     
    136138        cppad-%version%.%rel%.%lic%.tgz
    137139%$$
     140
     141$subhead github$$
    138142The release versions on the
    139143$href%https://github.com/coin-or/CppAD/releases%github download page%$$
     
    224228
    225229
    226 $subhead Install Instructions$$
    227 The instructions on the web correspond to the current version of CppAD.
     230$head Install Instructions$$
     231The $cref install$$ instructions on this web site correspond to the
     232$cref/current version/download/Current Version/$$ of CppAD.
    228233If you are using an old version of CppAD
    229 You should follow the install instructions in
     234these instructions may work.
     235If you have trouble (or just to be careful),
     236you should follow the instructions in
    230237the $code doc$$ subdirectory of the distribution directory.
    231 
    232 $head Repository Methods$$
    233 The following instructions pertain to using
    234 $cref/subversion/download/Current Version/Subversion/$$ or
    235 $cref/git/download/Current Version/Git/$$,
    236 or one of the
    237 $href%https://github.com/coin-or/CppAD/releases%github%$$
    238 $cref/release versions/download/Release Versions/$$.
    239 
    240 $subhead Limitations$$
    241 $list number$$
    242 No documentation is included by this download procedure,
    243 though it can be built from the source code; see
    244 $cref/documentation/download/Repository Methods/Documentation/$$ below.
    245 $lnext
    246 Only the
     238If there is no such documentation, you can build it; see
     239$cref/building documentation
     240        /download
     241        /No Documentation
     242        /Building Documentation
     243/$$.
     244
     245$head No Documentation$$
     246Some of the download methods do not include documentation.
     247To be specific, the
     248$cref/subversion/download/Current Version/Subversion/$$ method,
     249$cref/git/download/Current Version/Git/$$ method,
     250$cref/daily version/download/Daily Versions/$$ method, and the
     251$cref/github release version/download/Release Versions/github/$$ method.
     252In addition, these methods only provide the
    247253$href%http://opensource.org/licenses/EPL-1.0%EPL licensed%$$
    248 version of CppAD can be obtained by these download procedures.
    249 $lend
    250 
    251 $subhead Documentation$$
    252 If you are using one of these download procedures,
    253 you will have to build the documentation to get the corresponding install
    254 instructions.
     254version of CppAD.
     255
     256$subhead Building Documentation$$
     257If you are using one of these download methods,
     258you can build the documentation to get the corresponding install instructions.
    255259The documentation for CppAD is built from the source code files using
    256260$href%http://www.seanet.com/~bradbell/omhelp/%OMhelp%$$.
  • trunk/omh/license.omh

    r2506 r3779  
    11$Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-06 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
  • trunk/omh/new_feature.omh

    r2506 r3779  
    22// BEGIN SHORT COPYRIGHT
    33/* --------------------------------------------------------------------------
    4 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-06 Bradley M. Bell
     4CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    55
    66CppAD is distributed under multiple licenses. This distribution is under
    7 the terms of the 
     7the terms of the
    88                    Eclipse Public License Version 1.0.
    99
     
    2828
    2929$head Overview$$
    30 Suppose that you add a new feature to CppAD and the 
     30Suppose that you add a new feature to CppAD and the
    3131corresponding include file is $icode%Name%.h%$$.
    32 You should check each of the following steps: 
     32You should check each of the following steps:
    3333
    3434$list number$$
     
    3636
    3737$lnext
    38 Add a test file called $codei%example/%Name%.cpp%$$ that check 
     38Add a test file called $codei%example/%Name%.cpp%$$ that check
    3939for correct results (and run the test to make sure it works).
    4040
     
    4646
    4747$lnext
    48 Add the file $icode%Name%.cpp%$$ to the list of 
     48Add the file $icode%Name%.cpp%$$ to the list of
    4949$code Example_SOURCES$$ in the file $code example/Makefile.am$$.
    5050
     
    5454
    5555$lnext
    56 Add the file $icode%Name%.h%$$ to the list of 
     56Add the file $icode%Name%.h%$$ to the list of
    5757$code nobase_include_HEADERS$$ in the file $code Makefile.am$$.
    5858
  • trunk/omh/reverse/reverse.omh

    r3301 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
  • trunk/omh/theory/reverse_identity.omh

    r3169 r3779  
    11$Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    5252The theorem below implies that
    5353$latex \[
    54         \D{ W_j }{ x^{(i)} } (x) = \D{ W_{j-i} }{ x^{(0)} } (x) 
     54        \D{ W_j }{ x^{(i)} } (x) = \D{ W_{j-i} }{ x^{(0)} } (x)
    5555\] $$
    5656A $cref/general reverse sweep/reverse_any/$$ calculates the values
     
    6767Suppose that $latex F : B^n \rightarrow B^m$$ is a $latex p$$ times
    6868continuously differentiable function.
    69 Define the functions 
     69Define the functions
    7070$latex Z : B \times B^{n \times p} \rightarrow B^n$$,
    7171$latex Y : B \times B^{n \times p }\rightarrow B^m$$,
     
    7878        Y(t, x)  & = & F [ Z(t, x) ]
    7979        \\
    80         y^{(j)} (x) & = & \frac{1}{j !} \Dpow{j}{t} Y(0, x) 
     80        y^{(j)} (x) & = & \frac{1}{j !} \Dpow{j}{t} Y(0, x)
    8181\end{array}
    8282\] $$
    83 where $latex x^{(j)}$$ denotes the $th j$$ column of 
     83where $latex x^{(j)}$$ denotes the $th j$$ column of
    8484$latex x \in B^{n \times p}$$.
    8585It follows that
     
    9797\begin{array}{rclr}
    9898\D{ y^{(j)} }{ x^{(i)} } (x)
    99 & = & 
    100 \frac{1}{j ! } \D{ }{ x^{(i)} } 
     99& = &
     100\frac{1}{j ! } \D{ }{ x^{(i)} }
    101101        \left[ \Dpow{j}{t} (F \circ  Z) (t, x)  \right]_{t=0}
    102102\\
    103103& = &
    104 \frac{1}{j ! } \left[ \Dpow{j}{t} 
    105         \D{ }{ x^{(i)} } (F \circ  Z) (t, x) 
     104\frac{1}{j ! } \left[ \Dpow{j}{t}
     105        \D{ }{ x^{(i)} } (F \circ  Z) (t, x)
    106106\right]_{t=0}
    107107\\
    108108& = &
    109 \frac{1}{j ! } \left\{ 
    110         \Dpow{j}{t} \left[ t^i ( F^{(1)} \circ Z ) (t, x) \right] 
     109\frac{1}{j ! } \left\{
     110        \Dpow{j}{t} \left[ t^i ( F^{(1)} \circ Z ) (t, x) \right]
    111111\right\}_{t=0}
    112112\end{array}
    113113\] $$
    114 For $latex k > i$$, the $th k$$ 
     114For $latex k > i$$, the $th k$$
    115115partial of $latex t^i$$ with respect to $latex t$$ is zero.
    116116Thus, the partial with respect to $latex t$$ is given by
    117117$latex \[
    118118\begin{array}{rcl}
    119 \Dpow{j}{t} \left[ t^i ( F^{(1)} \circ Z ) (t, x) \right] 
     119\Dpow{j}{t} \left[ t^i ( F^{(1)} \circ Z ) (t, x) \right]
    120120& = &
    121 \sum_{k=0}^i 
     121\sum_{k=0}^i
    122122\left( \begin{array}{c} j \\ k \end{array} \right)
    123 \frac{ i ! }{ (i - k) ! } t^{i-k} \; 
     123\frac{ i ! }{ (i - k) ! } t^{i-k} \;
    124124\Dpow{j-k}{t} ( F^{(1)} \circ Z ) (t, x)
    125125\\
    126 \left\{ 
    127         \Dpow{j}{t} \left[ t^i ( F^{(1)} \circ Z ) (t, x) \right] 
     126\left\{
     127        \Dpow{j}{t} \left[ t^i ( F^{(1)} \circ Z ) (t, x) \right]
    128128\right\}_{t=0}
    129129& = &
     
    136136\\
    137137\D{ y^{(j)} }{ x^{(i)} } (x)
    138 & = & 
     138& = &
    139139\frac{ 1 }{ (j - i) ! }
    140140\Dpow{j-i}{t} ( F^{(1)} \circ Z ) (t, x)
  • trunk/omh/theory/reverse_theory.omh

    r3495 r3779  
    11$Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2020
    2121$head Taylor Notation$$
    22 In Taylor notation, each variable corresponds to 
     22In Taylor notation, each variable corresponds to
    2323a function of a single argument which we denote by $icode t$$
    2424(see Section 10.2 of
    2525$cref/Evaluating Derivatives/Bib/Evaluating Derivatives/$$).
    2626Here and below
    27 $latex X(t)$$, $latex Y(t)$$, and $icode Z(t)$$ are scalar valued functions 
     27$latex X(t)$$, $latex Y(t)$$, and $icode Z(t)$$ are scalar valued functions
    2828and the corresponding $th p$$ order Taylor coefficients row vectors are
    2929$latex x$$, $latex y$$ and $latex z$$; i.e.,
     
    3232X(t) & = & x^{(0)} + x^{(1)} * t + \cdots + x^{(p)} * t^p + O( t^{p+1} ) \\
    3333Y(t) & = & y^{(0)} + y^{(1)} * t + \cdots + y^{(p)} * t^p + O( t^{p+1} ) \\
    34 Z(t) & = & z^{(0)} + z^{(1)} * t + \cdots + z^{(p)} * t^p + O( t^{p+1} ) 
     34Z(t) & = & z^{(0)} + z^{(1)} * t + \cdots + z^{(p)} * t^p + O( t^{p+1} )
    3535\end{array}
    3636\] $$
     
    3838we are given the $th p$$ order Taylor coefficient row vectors
    3939$latex x$$, $latex y$$, and  $latex z$$.
    40 In addition, we are given the partial derivatives of a scalar valued function 
     40In addition, we are given the partial derivatives of a scalar valued function
    4141$latex \[
    4242        G ( z^{(j)} , \ldots , z^{(0)}, x, y)
     
    4444We need to compute the partial derivatives of the scalar valued function
    4545$latex \[
    46         H ( z^{(j-1)} , \ldots , z^{(0)}, x, y)  = 
     46        H ( z^{(j-1)} , \ldots , z^{(0)}, x, y)  =
    4747        G ( z^{(j)}, z^{(j-1)} , \ldots , z^{(0)}, x , y )
    4848\] $$
    49 where $latex z^{(j)}$$ is expressed as a function of the 
     49where $latex z^{(j)}$$ is expressed as a function of the
    5050$th j-1$$ order Taylor coefficient row
    5151vector for $latex Z$$ and the vectors $latex x$$, $latex y$$; i.e.,
     
    7474\\
    7575\D{H}{ y^{(k)} } & = &
    76 \D{G}{ y^{(k)} }  + \D{G}{ z^{(k)} } 
     76\D{G}{ y^{(k)} }  + \D{G}{ z^{(k)} }
    7777\\
    78 \D{H}{ z^{(l)} } & = & \D{G}{ z^{(l)} } 
    79 \end{array} 
     78\D{H}{ z^{(l)} } & = & \D{G}{ z^{(l)} }
     79\end{array}
    8080\] $$
    8181
     
    9393\\
    9494\D{H}{ y^{(k)} } & = &
    95 \D{G}{ y^{(k)} }  - \D{G}{ z^{(k)} } 
    96 \end{array} 
     95\D{G}{ y^{(k)} }  - \D{G}{ z^{(k)} }
     96\end{array}
    9797\] $$
    9898
     
    109109\D{H}{ x^{(j-k)} } & = &
    110110\D{G}{ x^{(j-k)} }  +
    111 \sum_{k=0}^j \D{G}{ z^{(j)} } y^{(k)} 
     111\sum_{k=0}^j \D{G}{ z^{(j)} } y^{(k)}
    112112\\
    113113\D{H}{ y^{(k)} } & = &
    114114\D{G}{ y^{(k)} }  +
    115 \sum_{k=0}^j \D{G}{ z^{(j)} } x^{(j-k)} 
    116 \end{array} 
     115\sum_{k=0}^j \D{G}{ z^{(j)} } x^{(j-k)}
     116\end{array}
    117117\] $$
    118118
     
    121121$cref/division/ForwardTheory/Binary Operators/Division/$$ is
    122122$latex \[
    123 z^{(j)} = 
    124 \frac{1}{y^{(0)}} 
    125 \left( 
    126         x^{(j)} - \sum_{k=1}^j z^{(j-k)} y^{(k)} 
     123z^{(j)} =
     124\frac{1}{y^{(0)}}
     125\left(
     126        x^{(j)} - \sum_{k=1}^j z^{(j-k)} y^{(k)}
    127127\right)
    128128\] $$
     
    131131\begin{array}{rcl}
    132132\D{H}{ x^{(j)} } & = &
    133 \D{G}{ x^{(j)} }  + \D{G}{ z^{(j)} } \frac{1}{y^{(0)}} 
     133\D{G}{ x^{(j)} }  + \D{G}{ z^{(j)} } \frac{1}{y^{(0)}}
    134134\\
    135135\D{H}{ z^{(j-k)} } & = &
     
    140140\\
    141141\D{H}{ y^{(0)} } & = &
    142 \D{G}{ y^{(0)} }  - \D{G}{ z^{(j)} } \frac{1}{y^{(0)}} \frac{1}{y^{(0)}} 
    143 \left( 
    144         x^{(j)} - \sum_{k=1}^j z^{(j-k)} y^{(k)} 
     142\D{G}{ y^{(0)} }  - \D{G}{ z^{(j)} } \frac{1}{y^{(0)}} \frac{1}{y^{(0)}}
     143\left(
     144        x^{(j)} - \sum_{k=1}^j z^{(j-k)} y^{(k)}
    145145\right)
    146146\\
     
    152152$head Standard Math Functions$$
    153153The standard math functions have only one argument.
    154 Hence we are given the partial derivatives of a scalar valued function 
     154Hence we are given the partial derivatives of a scalar valued function
    155155$latex \[
    156156        G ( z^{(j)} , \ldots , z^{(0)}, x)
     
    158158We need to compute the partial derivatives of the scalar valued function
    159159$latex \[
    160         H ( z^{(j-1)} , \ldots , z^{(0)}, x)  = 
     160        H ( z^{(j-1)} , \ldots , z^{(0)}, x)  =
    161161        G ( z^{(j)}, z^{(j-1)} , \ldots , z^{(0)}, x)
    162162\] $$
    163 where $latex z^{(j)}$$ is expressed as a function of the 
     163where $latex z^{(j)}$$ is expressed as a function of the
    164164$th j-1$$ order Taylor coefficient row
    165165vector for $latex Z$$ and the vector $latex x$$; i.e.,
  • trunk/omh/theory/theory.omh

    r3169 r3779  
    11$Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
  • trunk/omh/whats_new/whats_new.omh

    r3552 r3779  
    11$Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1919
    2020$head Introduction$$
    21 The sections listed below contain a list of the changes to CppAD 
     21The sections listed below contain a list of the changes to CppAD
    2222in reverse order by date.
    2323The purpose of these sections is to
  • trunk/omh/whats_new/whats_new_09.omh

    r3627 r3779  
    11$Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    6363
    6464$head 12-23$$
    65 The 
     65The
    6666$code ADFun$$ $cref/assignment operator/FunConstruct/Assignment Operator/$$
    6767was changed so that it now copies forward mode
     
    7777
    7878$head 12-22$$
    79 Convert the optimization of a sequence of additions from multiple operators 
    80 to one operator with a varying number of arguments. This improved the speed 
     79Convert the optimization of a sequence of additions from multiple operators
     80to one operator with a varying number of arguments. This improved the speed
    8181for forward and reverse mode computations of an optimized tape.
    8282
     
    100100$head 12-02$$
    101101Fix minor grammatical error in the Purpose heading
    102 for $cref/conditional expressions/CondExp/Purpose/$$. 
    103 $pre
    104 
    105 $$
    106 Add the following functions: 
     102for $cref/conditional expressions/CondExp/Purpose/$$.
     103$pre
     104
     105$$
     106Add the following functions:
    107107$cref/size_op/seq_property/size_op/$$,
    108108$cref/size_op_arg/seq_property/size_op_arg/$$,
    109109and
    110110$cref/size_op_seq/seq_property/size_op_seq/$$.
    111 In addition, improve and extend the 
    112 $cref seq_property.cpp$$ example. 
     111In addition, improve and extend the
     112$cref seq_property.cpp$$ example.
    113113
    114114$head 11-28$$
     
    130130
    131131$head 10-29$$
    132 Split out the 
     132Split out the
    133133$cref/ode inverse problem/ipopt_nlp_ode_problem/$$,
    134134$cref/its simple representation/ipopt_nlp_ode_simple/$$,
     
    139139$cref ipopt_nlp_ode_simple.hpp$$,
    140140$cref ipopt_nlp_ode_fast.hpp$$,
    141 and 
     141and
    142142$cref ipopt_nlp_ode_check.cpp$$.
    143143
    144144$head 10-28$$
    145 Improve the documentation for $cref ipopt_nlp_ode_simple$$ and 
     145Improve the documentation for $cref ipopt_nlp_ode_simple$$ and
    146146$cref ipopt_nlp_ode_fast$$.
    147147
     
    149149Moved old $code ipopt_cppad_simple.cpp$$ to $cref ipopt_nlp_get_started.cpp$$,
    150150created the example $cref ipopt_nlp_ode_simple.hpp$$,
    151 and split and $code ipopt_cppad_ode.cpp$$ 
     151and split and $code ipopt_cppad_ode.cpp$$
    152152into $cref ipopt_nlp_ode_fast.hpp$$ and $cref ipopt_nlp_ode_check.cpp$$.
    153153
     
    155155Added the $cref/assignment operator/FunConstruct/Assignment Operator/$$
    156156to the $code ADFun$$ object class.
    157 This makes a copy of the entire operation sequence in another 
     157This makes a copy of the entire operation sequence in another
    158158function object.
    159159The intention is that the two functions objects can do calculations in
    160160parallel.
    161161In addition,
    162 CppAD now check for the $code ADFun$$ 
     162CppAD now check for the $code ADFun$$
    163163$cref/copy constructor/FunConstruct/Copy Constructor/$$
    164164and generates an error message if it is used.
     
    193193
    194194$head 10-03$$
    195 The Microsoft Visual Studio project files for 
     195The Microsoft Visual Studio project files for
    196196examples and testing
    197197and for
     
    213213$head 09-28$$
    214214Changed $cref RevSparseHes$$ so that it uses a sparse
    215 representation when the corresponding call to 
     215representation when the corresponding call to
    216216$cref ForSparseJac$$ used a sparse representation.
    217 This should have been included with the change on 09-26 
     217This should have been included with the change on 09-26
    218218because Hessian sparsity patters after $code ForSparseJac$$
    219219with $icode packed$$ did not work.
     
    224224$cref ForSparseJac$$ and $cref RevSparseJac$$.
    225225If $icode packed$$ is false,
    226 a sparse instead of packed representation is used 
     226a sparse instead of packed representation is used
    227227during the calculations of sparsity patterns.
    228228The sparse representation
     
    238238
    239239$head 09-19$$
    240 Some more memory allocation improvements (related to those 
    241 on 09-18) were made. 
     240Some more memory allocation improvements (related to those
     241on 09-18) were made.
    242242
    243243$head 09-18$$
     
    259259$pre
    260260
    261 $$ 
    262 $bold Begin Merge$$ 
    263 $pre
    264 $$
    265 of changes from the directory $code branches/optimize$$ 
     261$$
     262$bold Begin Merge$$
     263$pre
     264$$
     265of changes from the directory $code branches/optimize$$
    266266in the CppAD subversion repository.
    267 The subheading dates below represent when the correspond change was made in 
     267The subheading dates below represent when the correspond change was made in
    268268$code branches/optimize$$.
    269269
     
    271271An automatic check of the $cref forward_zero$$ results was added
    272272after each call to $cref/f.optimize()/optimize/$$
    273 (this $cref/check/optimize/Checking Optimization/$$ 
     273(this $cref/check/optimize/Checking Optimization/$$
    274274is skipped when $code NDEBUG$$ is defined).
    275275In addition, all of the $codei%speed/cppad/%*%.cpp%$$ tests
     
    293293
    294294$$
    295 The function 
     295The function
    296296$cref/size_VecAD/seq_property/size_VecAD/$$ function was added
    297 so that the user could see the $code VecAD$$ vectors 
     297so that the user could see the $code VecAD$$ vectors
    298298and elements corresponding to an operation sequence.
    299299
     
    311311Add hash table coding to reduce the number of copies of the same
    312312parameter value necessary in a tape recording.
    313 In addition, add the function 
     313In addition, add the function
    314314$cref/size_par/seq_property/size_par/$$ was added
    315315so that the user could see the number of parameters
     
    322322
    323323$$
    324 Fix bug in overnight build where HTML version and entire documentation 
     324Fix bug in overnight build where HTML version and entire documentation
    325325as one page versions of documentation were not being built.
    326326$pre
    327327
    328328$$
    329 Fix missing new line under 
     329Fix missing new line under
    330330$cref/Using Value/SimpleVector/Element Access/Using Value/$$
    331331heading for simple vector documentation.
     
    333333$head 08-01$$
    334334Fix bug in reverse mode Jacobian $cref/sparsity/RevSparseJac/$$
    335 for $cref VecAD$$ objects. 
     335for $cref VecAD$$ objects.
    336336
    337337$head 07-31$$
     
    357357
    358358$$
    359 Improve the $cref vec_ad.cpp$$ user example. 
     359Improve the $cref vec_ad.cpp$$ user example.
    360360
    361361$subhead 07-06$$
     
    368368$$
    369369Add developer documentation for tape evaluation of the
    370 VecAD load operations 
     370VecAD load operations
    371371(a load operation accesses an element of the vector but
    372372does not change it.)
     
    374374
    375375$$
    376 Fix $code isnan$$ undefined in $code example/cond_exp.cpp$$ error 
     376Fix $code isnan$$ undefined in $code example/cond_exp.cpp$$ error
    377377introduced on 07-04 change.
    378378
     
    382382$pre
    383383
    384 $$ 
    385 $bold Begin Merge$$ 
    386 $pre
    387 $$
    388 of changes from the directory $code branches/sweep$$ 
     384$$
     385$bold Begin Merge$$
     386$pre
     387$$
     388of changes from the directory $code branches/sweep$$
    389389in the CppAD subversion repository.
    390 The subheading dates below represent when the correspond change was made in 
     390The subheading dates below represent when the correspond change was made in
    391391$code branches/sweep$$.
    392392
     
    400400$$
    401401A simpler and useful example was provided for
    402 $cref/conditional expressions/CondExp/$$; 
     402$cref/conditional expressions/CondExp/$$;
    403403see $cref cond_exp.cpp$$.
    404404
    405405
    406406$subhead 07-03$$
    407 Some minor improvements were made to the documentation for 
     407Some minor improvements were made to the documentation for
    408408$cref CondExp$$.
    409409To be specific, a newer OMhelp option was used to change the formatting
     
    411411
    412412$subhead 07-02$$
    413 Add developer doxygen documentation of 
     413Add developer doxygen documentation of
    414414tape evaluation for power (exponentiation) operators.
    415415
    416416$subhead 07-01$$
    417 Fix an example indexing error in 
     417Fix an example indexing error in
    418418$code introduction/exp_apx/exp_eps_for2.cpp$$ (found by valgrind).
    419419$pre
    420420
    421421$$
    422 Add developer doxygen documentation of 
     422Add developer doxygen documentation of
    423423tape evaluation for multiplication and division operators.
    424424
    425425$subhead 06-30$$
    426 Add developer doxygen documentation of 
     426Add developer doxygen documentation of
    427427tape evaluation for addition and subtraction operators.
    428428
    429429$subhead 06-29$$
    430 Add developer doxygen documentation of 
     430Add developer doxygen documentation of
    431431tape evaluation for sin, sinh, cos, and cosh.
    432432
    433433$subhead 06-28$$
    434 Add developer doxygen documentation of 
     434Add developer doxygen documentation of
    435435tape evaluation for atan, asin, acos, sqrt, log.
    436436$pre
     
    439439
    440440$head 06-25$$
    441 The tarball for most recent release (of the subversion trunk for CppAD) 
    442 was not being placed in the 
    443 $href%http://www.coin-or.org/download/source/CppAD/%download%$$ 
    444 directory. 
     441The tarball for most recent release (of the subversion trunk for CppAD)
     442was not being placed in the
     443$href%http://www.coin-or.org/download/source/CppAD/%download%$$
     444directory.
    445445This has been fixed.
    446446
     
    467467$$
    468468Fix conflict between CppAD's use of config.h preprocessor symbols
    469 and other packages use of the same symbol names. 
     469and other packages use of the same symbol names.
    470470
    471471$head 06-06$$
    472472$list number$$
    473473Using complex of an AD type (instead of AD of complex) was not working
    474 correctly in $code not_complex_ad.cpp$$ because the 
     474correctly in $code not_complex_ad.cpp$$ because the
    475475$cref/default constructor/ad_ctor/$$ for an AD object has an unspecified value.
    476476This has been fixed for the complex type by changing the default constructor
    477 to use value zero. 
    478 (The $code not_complex_ad.cpp$$ example has been removed; 
     477to use value zero.
     478(The $code not_complex_ad.cpp$$ example has been removed;
    479479see $cref/complex FAQ/Faq/Complex Types/$$.)
    480480$lnext
     
    484484with out any warning or error messages.
    485485In addition, a minor initialization error was fixed in the
    486 $code test_more/jacobian.cpp$$ routine so now 
     486$code test_more/jacobian.cpp$$ routine so now
    487487$code valgrind$$ also runs the CppAD $code test_more/test_more$$ program
    488488with out any warnings or error messages.
     
    495495
    496496$head 03-24$$
    497 Added cross references in 
     497Added cross references in
    498498the $cref/examples/ListAllExamples/$$ to occurrence of the following tokens:
    499499$cref AD$$,
     
    530530$head 01-18$$
    531531Sometimes an error occurs while taping AD operations.
    532 The $cref abort_recording$$ function has been added 
     532The $cref abort_recording$$ function has been added
    533533to make it easier to recover in such cases.
    534534$pre
     
    544544
    545545$$
    546 A discussion has been added to the documentation for $cref Jacobian$$ 
     546A discussion has been added to the documentation for $cref Jacobian$$
    547547about its use of
    548548$cref/forward or reverse/Jacobian/Forward or Reverse/$$
     
    553553A minor typo has been fixed in the description of
    554554$code W(t, u)$$ in $cref reverse_any$$.
    555 To be specific, 
     555To be specific,
    556556$latex o ( t^{p-1} ) * t^{1-p} \rightarrow 0$$
    557557has been replaced by
  • trunk/print_for/makefile.am

    r2541 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    2626#
    2727# Microsoft project files
    28 EXTRA_DIST        =  test.sh 
     28EXTRA_DIST        =  test.sh
    2929#
    3030check_PROGRAMS    = print_for
  • trunk/speed/adolc/makefile.am

    r3481 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    2020DEFS          =
    2121#
    22 check_PROGRAMS   = speed_adolc 
     22check_PROGRAMS   = speed_adolc
    2323#
    2424AM_CPPFLAGS   = \
  • trunk/speed/cppad/makefile.am

    r3481 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1919DEFS          =
    2020#
    21 check_PROGRAMS   = speed_cppad 
     21check_PROGRAMS   = speed_cppad
    2222#
    2323AM_CPPFLAGS   = -I$(top_srcdir) $(BOOST_INCLUDE) $(EIGEN_INCLUDE)
  • trunk/speed/double/makefile.am

    r3481 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1919DEFS          =
    2020#
    21 check_PROGRAMS   = speed_double 
     21check_PROGRAMS   = speed_double
    2222#
    2323AM_CPPFLAGS   = -I$(top_srcdir) $(BOOST_INCLUDE) $(EIGEN_INCLUDE)
  • trunk/speed/example/makefile.am

    r3481 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    1818        speed_program.cpp
    1919#
    20 check_PROGRAMS    = speed_example 
     20check_PROGRAMS    = speed_example
    2121#
    2222AM_CPPFLAGS       = -I. -I$(top_srcdir) $(BOOST_INCLUDE) $(EIGEN_INCLUDE)
     
    3838        speed_test.cpp \
    3939        time_test.cpp \
    40         ../src/microsoft_timer.cpp 
     40        ../src/microsoft_timer.cpp
    4141
    4242test: check
  • trunk/speed/fadbad/makefile.am

    r3481 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    2020DEFS          =
    2121#
    22 check_PROGRAMS   = speed_fadbad 
     22check_PROGRAMS   = speed_fadbad
    2323#
    2424AM_CPPFLAGS   = \
  • trunk/speed/profile/makefile.am

    r3481 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    7070        gprof.sed
    7171#
    72 check_PROGRAMS   = speed_profile 
     72check_PROGRAMS   = speed_profile
    7373#
    7474AM_CPPFLAGS   = -I$(top_srcdir) $(BOOST_INCLUDE) $(EIGEN_INCLUDE)
  • trunk/speed/src/makefile.am

    r2529 r3779  
    11# $Id$
    22# -----------------------------------------------------------------------------
    3 # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44#
    55# CppAD is distributed under multiple licenses. This distribution is under
    6 # the terms of the 
     6# the terms of the
    77#                     Eclipse Public License Version 1.0.
    88#
     
    2020#
    2121# BEGIN DEBUG
    22 # AM_CXXFLAGS   = -g $(CXX_FLAGS) 
     22# AM_CXXFLAGS   = -g $(CXX_FLAGS)
    2323# END DEBUG
    2424#
  • trunk/test_more/abs.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
  • trunk/test_more/add.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    4141        Z[x] = U[s]  + U[t];   // AD<double> + AD<double>
    4242        Z[y] = Z[x]  + 1.;     // AD<double> + double
    43         Z[z] = 1.    + Z[y];   // double + AD<double> 
     43        Z[z] = 1.    + Z[y];   // double + AD<double>
    4444
    4545        // create f: U -> Z and vectors used for derivative calculations
     
    8181        double u0 = .5;
    8282        CPPAD_TESTVECTOR(AD<double>) U(1);
    83         U[0]      = u0; 
     83        U[0]      = u0;
    8484        Independent(U);
    8585
    8686        AD<double> a = U[0] + 1.; // AD<double> + double
    8787        AD<double> b = a  + 2;    // AD<double> + int
    88         AD<double> c = 3. + b;    // double     + AD<double> 
    89         AD<double> d = 4  + c;    // int        + AD<double> 
     88        AD<double> c = 3. + b;    // double     + AD<double>
     89        AD<double> d = 4  + c;    // int        + AD<double>
    9090
    91         // dependent variable vector 
     91        // dependent variable vector
    9292        CPPAD_TESTVECTOR(AD<double>) Z(1);
    93         Z[0] = d + U[0];          // AD<double> + AD<double> 
     93        Z[0] = d + U[0];          // AD<double> + AD<double>
    9494
    9595        // create f: U -> Z and vectors used for derivative calculations
    96         ADFun<double> f(U, Z); 
     96        ADFun<double> f(U, Z);
    9797        CPPAD_TESTVECTOR(double) v(1);
    9898        CPPAD_TESTVECTOR(double) w(1);
    9999
    100         // check value 
     100        // check value
    101101        ok &= NearEqual(Z[0] , 2 * u0 + 10,  1e-10 , 1e-10);
    102102
     
    109109        for(j = 1; j < p; j++)
    110110        {       jfac *= j;
    111                 w     = f.Forward(j, v);       
     111                w     = f.Forward(j, v);
    112112                ok &= NearEqual(jfac*w[0], value, 1e-10 , 1e-10); // d^jz/du^j
    113113                v[0]  = 0.;
     
    116116
    117117        // reverse computation of partials of Taylor coefficients
    118         CPPAD_TESTVECTOR(double) r(p); 
     118        CPPAD_TESTVECTOR(double) r(p);
    119119        w[0]  = 1.;
    120120        r     = f.Reverse(p, w);
     
    135135{       bool ok = true;
    136136        ok &= AddTestOne();
    137         ok &= AddTestTwo(); 
     137        ok &= AddTestTwo();
    138138        return ok;
    139139}
  • trunk/test_more/add_eq.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    4242        Z[x] += U[s];  // parameter += variable
    4343        Z[x] += U[t];  // variable  += variable
    44         Z[y] += .5;    // variable  += double 
     44        Z[y] += .5;    // variable  += double
    4545        // use .5 because it is represented exactly in binary and
    4646        // because it makes sure that += does not slice the double to an int
     
    8181        double u0 = .5;
    8282        CPPAD_TESTVECTOR(AD<double>) U(1);
    83         U[0]      = u0; 
     83        U[0]      = u0;
    8484        Independent(U);
    8585
    86         // dependent variable vector 
     86        // dependent variable vector
    8787        CPPAD_TESTVECTOR(AD<double>) Z(1);
    8888        Z[0] = U[0];       // initial value
    8989        Z[0] += 2;         // AD<double> += int
    9090        Z[0] += 4.;        // AD<double> += double
    91         Z[0] += U[0];      // AD<double> += AD<double> 
     91        Z[0] += U[0];      // AD<double> += AD<double>
    9292
    9393        // create f: U -> Z and vectors used for derivative calculations
    94         ADFun<double> f(U, Z); 
     94        ADFun<double> f(U, Z);
    9595        CPPAD_TESTVECTOR(double) v(1);
    9696        CPPAD_TESTVECTOR(double) w(1);
    9797
    98         // check value 
     98        // check value
    9999        ok &= NearEqual(Z[0] , u0+2+4+u0,  1e-10 , 1e-10);
    100100
     
    107107        for(j = 1; j < p; j++)
    108108        {       jfac *= j;
    109                 w     = f.Forward(j, v);       
     109                w     = f.Forward(j, v);
    110110                ok &= NearEqual(jfac*w[0], value, 1e-10 , 1e-10); // d^jz/du^j
    111111                v[0]  = 0.;
     
    114114
    115115        // reverse computation of partials of Taylor coefficients
    116         CPPAD_TESTVECTOR(double) r(p); 
     116        CPPAD_TESTVECTOR(double) r(p);
    117117        w[0]  = 1.;
    118118        r     = f.Reverse(p, w);
  • trunk/test_more/add_zero.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2121
    2222bool AddZero(void)
    23 {       
     23{
    2424        using namespace CppAD;
    2525
  • trunk/test_more/adfun_copy.cpp

    r3519 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-10 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
  • trunk/test_more/alloc_openmp.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    4848bool alloc_openmp(void)
    4949{       bool ok = true;
    50        
     50
    5151        int num_threads = NUMBER_THREADS;
    5252
     
    5555                size_t(num_threads), in_parallel, thread_number
    5656        );
    57        
     57
    5858        // Execute the worker function in parallel
    5959        int thread_num;
     
    6262                worker();
    6363// end omp parallel for
    64        
     64
    6565        // now inform CppAD that there is only one thread
    6666        thread_alloc::parallel_setup(1, CPPAD_NULL, CPPAD_NULL);
     
    7070                ok &= thread_all_[thread_num].x[0] == static_cast<double>(thread_num);
    7171
    72                 // test having master thread (thread number zero) 
     72                // test having master thread (thread number zero)
    7373                // free memory that was allocated by thread number thread_num.
    7474                thread_all_[thread_num].x.clear();
  • trunk/test_more/assign.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2929        // declare independent variables and start tape recording
    3030        CppAD::Independent(x);
    31        
    32         // range space vector 
     31
     32        // range space vector
    3333        size_t m = 3;
    3434        CPPAD_TESTVECTOR(AD<double>) y(m);
     
    3737        // (choose the first independent variable to check a special case)
    3838        // use the value returned by the assignment (for another assignment)
    39         y[0] = y[1] = x[0]; 
     39        y[0] = y[1] = x[0];
    4040
    41         // assign an AD<Base> object equal to an expression 
     41        // assign an AD<Base> object equal to an expression
    4242        y[1] = x[1] + 1.;
    4343        y[2] = x[2] + 2.;
  • trunk/test_more/atan2.cpp

    r3083 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    4646        // a temporary values
    4747        AD<double> x = cos(U[0]);
    48         AD<double> y = sin(U[0]); 
     48        AD<double> y = sin(U[0]);
    4949
    50         // dependent variable vector 
     50        // dependent variable vector
    5151        CPPAD_TESTVECTOR(AD<double>) Z(1);
    52         Z[0] = atan2(y, x); 
     52        Z[0] = atan2(y, x);
    5353
    5454        // create f: U -> Z and vectors used for derivative calculations
    55         ADFun<double> f(U, Z); 
     55        ADFun<double> f(U, Z);
    5656        CPPAD_TESTVECTOR(double) v(1);
    5757        CPPAD_TESTVECTOR(double) w(1);
     
    8383        for(j = 1; j < p; j++)
    8484        {       jfac *= j;
    85                 w     = f.Forward(j, v);       
     85                w     = f.Forward(j, v);
    8686                ok &= NearEqual(jfac*w[0], value, 1e-10 , 1e-10); // d^jz/du^j
    8787                v[0]  = 0.;
     
    9090
    9191        // reverse computation of partials of Taylor coefficients
    92         CPPAD_TESTVECTOR(double) r(p); 
     92        CPPAD_TESTVECTOR(double) r(p);
    9393        w[0]  = 1.;
    9494        r     = f.Reverse(p, w);
  • trunk/test_more/base_adolc.cpp

    r2794 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
     
    1414# include <adolc/interfaces.h>
    1515
    16 // adouble definitions not in Adolc distribution and 
     16// adouble definitions not in Adolc distribution and
    1717// required in order to use CppAD::AD<adouble>
    1818# include <cppad/example/base_adolc.hpp>
     
    2020# include <cppad/cppad.hpp>
    2121
    22 bool base_adolc(void) 
     22bool base_adolc(void)
    2323{       bool ok = true;                   // initialize test result
    2424
     
    4040                aa_x[j] = a_x[j];          // track how aa_x depends on a_x
    4141        CppAD::Independent(aa_x);          // aa_x is independent for ADDdouble
    42          
     42
    4343
    4444        // compute function
  • trunk/test_more/base_alloc.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
     
    3030        for(i = 0; i < N; i++)
    3131                a_y[0] += double(i);
    32                
     32
    3333        CppAD::ADFun<base_alloc> f(a_x, a_y);
    3434
  • trunk/test_more/check_simple_vector.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2020        void Case(const Scalar& x, const Scalar& y)
    2121        {       using CppAD::CheckSimpleVector;
    22        
     22
    2323                CheckSimpleVector<Scalar, CppAD::vector<Scalar> > (x, y);
    2424                CheckSimpleVector<Scalar, std::vector<Scalar>   > (x, y);
  • trunk/test_more/compare.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-06 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1616# include <cppad/cppad.hpp>
    1717
    18 namespace { 
     18namespace {
    1919        template <class Type>
    2020        bool Compare(void)
    2121        {       bool ok = true;
    2222                using CppAD::AD;
    23        
     23
    2424                Type      middle = 4;
    2525                AD<double> three = 3;
    2626                AD<double> four  = 4;
    2727                AD<double> five  = 5;
    28        
     28
    2929                // AD<double> > Type
    30                 ok &= ! (three  >  middle);   
    31                 ok &= ! (four   >  middle);   
    32                 ok &=   (five   >  middle);   
    33                 // Type > AD<double> 
    34                 ok &=   (middle >  three );   
    35                 ok &= ! (middle >  four  );   
    36                 ok &= ! (middle >  five  );   
    37        
     30                ok &= ! (three  >  middle);
     31                ok &= ! (four   >  middle);
     32                ok &=   (five   >  middle);
     33                // Type > AD<double>
     34                ok &=   (middle >  three );
     35                ok &= ! (middle >  four  );
     36                ok &= ! (middle >  five  );
     37
    3838                // AD<double> >= Type
    39                 ok &= ! (three  >= middle);   
    40                 ok &=   (four   >= middle);   
    41                 ok &=   (five   >= middle);   
    42                 // Type > AD<double> 
    43                 ok &=   (middle >= three );   
    44                 ok &=   (middle >= four  );   
    45                 ok &= ! (middle >= five  );   
    46        
     39                ok &= ! (three  >= middle);
     40                ok &=   (four   >= middle);
     41                ok &=   (five   >= middle);
     42                // Type > AD<double>
     43                ok &=   (middle >= three );
     44                ok &=   (middle >= four  );
     45                ok &= ! (middle >= five  );
     46
    4747                // AD<double> < Type
    48                 ok &=   (three  <  middle);   
    49                 ok &= ! (four   <  middle);   
    50                 ok &= ! (five   <  middle);   
    51                 // Type > AD<double> 
    52                 ok &= ! (middle <  three );   
    53                 ok &= ! (middle <  four  );   
    54                 ok &=   (middle <  five  );   
    55        
     48                ok &=   (three  <  middle);
     49                ok &= ! (four   <  middle);
     50                ok &= ! (five   <  middle);
     51                // Type > AD<double>
     52                ok &= ! (middle <  three );
     53                ok &= ! (middle <  four  );
     54                ok &=   (middle <  five  );
     55
    5656                // AD<double> <= Type
    57                 ok &=   (three  <= middle);   
    58                 ok &=   (four   <= middle);   
    59                 ok &= ! (five   <= middle);   
    60                 // Type > AD<double> 
    61                 ok &= ! (middle <= three );   
    62                 ok &=   (middle <= four  );   
    63                 ok &=   (middle <= five  );   
    64        
     57                ok &=   (three  <= middle);
     58                ok &=   (four   <= middle);
     59                ok &= ! (five   <= middle);
     60                // Type > AD<double>
     61                ok &= ! (middle <= three );
     62                ok &=   (middle <= four  );
     63                ok &=   (middle <= five  );
     64
    6565                return ok;
    6666        }
  • trunk/test_more/cond_exp_ad.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    7878        ADFun< ADdouble > fa(Xaa, Yaa);
    7979
    80         // function values 
     80        // function values
    8181        CPPAD_TESTVECTOR( ADdouble ) Ya(m);
    8282        Ya  = fa.Forward(0, Xa);
     
    228228        ADFun< ADdouble > fa(Xaa, Yaa);
    229229
    230         // function values 
     230        // function values
    231231        CPPAD_TESTVECTOR( ADdouble ) Ya(m);
    232232        Ya  = fa.Forward(0, Xa);
  • trunk/test_more/cos.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2828        Independent(U);
    2929
    30         // dependent variable vector 
     30        // dependent variable vector
    3131        CPPAD_TESTVECTOR(AD<double>) Z(1);
    32         Z[0] = cos(U[0]); 
     32        Z[0] = cos(U[0]);
    3333
    3434        // create f: U -> Z and vectors used for derivative calculations
    35         ADFun<double> f(U, Z); 
     35        ADFun<double> f(U, Z);
    3636        CPPAD_TESTVECTOR(double) v(1);
    3737        CPPAD_TESTVECTOR(double) w(1);
    3838
    39         // check value 
     39        // check value
    4040        double sin_u = sin( Value(U[0]) );
    4141        double cos_u = cos( Value(U[0]) );
     
    4949        v[0]         = 1.;
    5050        for(j = 1; j < p; j++)
    51         {       w     = f.Forward(j, v);       
     51        {       w     = f.Forward(j, v);
    5252
    5353                double value;
     
    6666
    6767        // reverse computation of partials of Taylor coefficients
    68         CPPAD_TESTVECTOR(double) r(p); 
     68        CPPAD_TESTVECTOR(double) r(p);
    6969        w[0]  = 1.;
    7070        r     = f.Reverse(p, w);
  • trunk/test_more/cosh.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2828        Independent(U);
    2929
    30         // dependent variable vector 
     30        // dependent variable vector
    3131        CPPAD_TESTVECTOR(AD<double>) Z(1);
    32         Z[0] = cosh(U[0]); 
     32        Z[0] = cosh(U[0]);
    3333
    3434        // create f: U -> Z and vectors used for derivative calculations
    35         ADFun<double> f(U, Z); 
     35        ADFun<double> f(U, Z);
    3636        CPPAD_TESTVECTOR(double) v(1);
    3737        CPPAD_TESTVECTOR(double) w(1);
    3838
    39         // check value 
     39        // check value
    4040        double sinh_u = sinh( Value(U[0]) );
    4141        double cosh_u = cosh( Value(U[0]) );
     
    4949        v[0]         = 1.;
    5050        for(j = 1; j < p; j++)
    51         {       w     = f.Forward(j, v);       
     51        {       w     = f.Forward(j, v);
    5252
    5353                double value;
     
    6262
    6363        // reverse computation of partials of Taylor coefficients
    64         CPPAD_TESTVECTOR(double) r(p); 
     64        CPPAD_TESTVECTOR(double) r(p);
    6565        w[0]  = 1.;
    6666        r     = f.Reverse(p, w);
  • trunk/test_more/dbl_epsilon.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-08 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1212
    1313/*
    14 Check the value of machine epsilon is accurate enough for the correctness tests 
     14Check the value of machine epsilon is accurate enough for the correctness tests
    1515*/
    1616
  • trunk/test_more/div_zero_one.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2121
    2222bool DivZeroOne(void)
    23 {       
     23{
    2424        using namespace CppAD;
    2525
  • trunk/test_more/exp.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    6060        ok &= NearEqual(v[s], Z[y] * Z[x],     1e-10 , 1e-10); // dy/ds
    6161
    62         // forward computation of second partials w.r.t s 
     62        // forward computation of second partials w.r.t s
    6363        v[s] = 1.;
    6464        w    = f.Forward(1, v);
     
    6666        w    = f.Forward(2, v);
    6767        ok &= NearEqual(       // d^2 y / (ds ds)
    68                 2. * w[y] , 
     68                2. * w[y] ,
    6969                Z[y] * Z[x] * Z[x] + Z[y] * Z[x],
    7070                1e-10 ,
    71                 1e-10 
    72         ); 
     71                1e-10
     72        );
    7373
    7474        // reverse computation of second partials of y
     
    7878        r    = f.Reverse(2, w);
    7979        ok &= NearEqual(      // d^2 y / (ds ds)
    80                 r[2 * s + 1] , 
     80                r[2 * s + 1] ,
    8181                Z[y] * Z[x] * Z[x] + Z[y] * Z[x],
    8282                1e-10 ,
    83                 1e-10 
    84         ); 
     83                1e-10
     84        );
    8585
    8686        return ok;
     
    9797        Independent(U);
    9898
    99         // dependent variable vector 
     99        // dependent variable vector
    100100        CPPAD_TESTVECTOR(AD<double>) Z(1);
    101         Z[0] = exp(U[0]); 
     101        Z[0] = exp(U[0]);
    102102
    103103        // create f: U -> Z and vectors used for derivative calculations
    104         ADFun<double> f(U, Z); 
     104        ADFun<double> f(U, Z);
    105105        CPPAD_TESTVECTOR(double) v(1);
    106106        CPPAD_TESTVECTOR(double) w(1);
    107107
    108         // check value 
     108        // check value
    109109        double exp_u = exp( Value(U[0]) );
    110110        ok &= NearEqual(exp_u, Value(Z[0]),  1e-10 , 1e-10);
     
    116116        v[0]         = 1.;
    117117        for(j = 1; j < p; j++)
    118         {       w     = f.Forward(j, v);       
     118        {       w     = f.Forward(j, v);
    119119                jfac *= j;
    120120                ok &= NearEqual(jfac*w[0], exp_u, 1e-10 , 1e-10); // d^jz/du^j
     
    123123
    124124        // reverse computation of partials of Taylor coefficients
    125         CPPAD_TESTVECTOR(double) r(p); 
     125        CPPAD_TESTVECTOR(double) r(p);
    126126        w[0]  = 1.;
    127127        r     = f.Reverse(p, w);
     
    140140{       bool ok = true;
    141141        ok &= ExpTestOne();
    142         ok &= ExpTestTwo(); 
     142        ok &= ExpTestTwo();
    143143        return ok;
    144144}
  • trunk/test_more/extern_value.cpp

    r2756 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1616# define INSTANTIATE(Type) template class extern_value< Type >
    1717
    18 template <class Type> 
     18template <class Type>
    1919extern_value<Type>::extern_value(Type value)
    2020{       value_ = value; }
    2121
    22 template <class Type> 
     22template <class Type>
    2323void extern_value<Type>::set(Type value)
    2424{       value_ = value; }
    2525
    26 template <class Type> 
     26template <class Type>
    2727Type extern_value<Type>::get(void)
    2828{       return value_; }
  • trunk/test_more/for_hess.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    3939        CPPAD_TESTVECTOR(AD<double>) Y(2);
    4040        Y[0] = U[0] * exp( U[1] );
    41         Y[1] = U[1] * sin( U[2] ); 
     41        Y[1] = U[1] * sin( U[2] );
    4242
    4343        // create the function y = F(u)
    4444        ADFun<double> F(U, Y);
    4545
    46         // formulas for the upper triangle of Hessian of F_0 
     46        // formulas for the upper triangle of Hessian of F_0
    4747        CPPAD_TESTVECTOR(double) H0(9);
    4848        H0[0] = 0.;                    // d^2 y[0] / d_u[0] d_u[0]
     
    8888                        CPPAD_TESTVECTOR(double) Cij = F.Forward(2, u2);
    8989
    90                         // diagonal of Hessian in j-th coordinate direction 
     90                        // diagonal of Hessian in j-th coordinate direction
    9191                        u1[i] = 0.;
    9292                        F.Forward(1, u1);
  • trunk/test_more/for_sparse_jac.cpp

    r2859 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    7676
    7777        // dimension of the domain space
    78         size_t n = 3; 
     78        size_t n = 3;
    7979
    8080        // dimension of the range space
    8181        size_t m = (4 + 11 + 1) * 3 + 4;
    8282
    83         // independent variable vector 
     83        // independent variable vector
    8484        CPPAD_TESTVECTOR(AD<double>) X(n);
    85         X[0] = .1; 
     85        X[0] = .1;
    8686        X[1] = .2;
    8787        X[2] = .3;
     
    167167        {       for(j = 0; j < n; j++)
    168168                        ok &= (Py[i * n + j] == Check[i * n + j]);
    169         }       
     169        }
    170170
    171171        // ---------------------------------------------------------
     
    188188                        ok &= (found == Check[i * n + j]);
    189189                }
    190         }       
     190        }
    191191
    192192        return ok;
     
    198198
    199199        // dimension of the domain space
    200         size_t n = 3; 
     200        size_t n = 3;
    201201
    202202        // dimension of the range space
     
    209209                Z[k] = 0.;
    210210
    211         // independent variable vector 
     211        // independent variable vector
    212212        CPPAD_TESTVECTOR(AD<double>) X(n);
    213         X[0] = 0.; 
     213        X[0] = 0.;
    214214        X[1] = 1.;
    215215        X[2] = 2.;
     
    218218        // VecAD vector is going to depend on X[1] and X[2]
    219219        Z[ X[0] ] = X[1];
    220         Z[ X[1] ] = X[2]; 
     220        Z[ X[1] ] = X[2];
    221221
    222222        // dependent variable vector
     
    275275        {       for(j = 0; j < n; j++)
    276276                        ok &= (Py[i * n + j] == Check[i * n + j]);
    277         }       
     277        }
    278278
    279279        // ---------------------------------------------------------
     
    296296                        ok &= (found == Check[i * n + j]);
    297297                }
    298         }       
     298        }
    299299
    300300        return ok;
     
    306306
    307307        // dimension of the domain space
    308         size_t n = 2; 
     308        size_t n = 2;
    309309
    310310        // dimension of the range space
    311311        size_t m = 3;
    312312
    313         // independent variable vector 
     313        // independent variable vector
    314314        CPPAD_TESTVECTOR(AD<double>) X(n);
    315         X[0] = 2.; 
     315        X[0] = 2.;
    316316        X[1] = 3.;
    317317        Independent(X);
     
    368368        {       for(j = 0; j < n; j++)
    369369                        ok &= (Py[i * n + j] == Check[i * n + j]);
    370         }       
     370        }
    371371
    372372        // ---------------------------------------------------------
    373         // dependency matrix for the identity function 
     373        // dependency matrix for the identity function
    374374        CPPAD_TESTVECTOR(std::set<size_t>) Sx(n);
    375375        for(i = 0; i < n; i++)
     
    389389                        ok &= (found == Check[i * n + j]);
    390390                }
    391         }       
     391        }
    392392
    393393        return ok;
     
    399399
    400400        // dimension of the domain space
    401         size_t n = 2; 
     401        size_t n = 2;
    402402
    403403        // dimension of the range space
    404404        size_t m = 3;
    405405
    406         // independent variable vector 
     406        // independent variable vector
    407407        CPPAD_TESTVECTOR(AD<double>) X(n);
    408         X[0] = 2.; 
     408        X[0] = 2.;
    409409        X[1] = 3.;
    410410        Independent(X);
     
    462462        {       for(j = 0; j < n; j++)
    463463                        ok &= (Py[j * m + i] == Check[i * n + j]);
    464         }       
     464        }
    465465
    466466        // ---------------------------------------------------------
    467         // dependency matrix for the identity function 
     467        // dependency matrix for the identity function
    468468        CPPAD_TESTVECTOR(std::set<size_t>) Sx(n);
    469469        for(i = 0; i < n; i++)
     
    483483                        ok &= (found == Check[i * n + j]);
    484484                }
    485         }       
     485        }
    486486
    487487        return ok;
  • trunk/test_more/forward_order.cpp

    r3214 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    8989        CPPAD_TESTVECTOR(double) x(n), x_p(n * p1), y_p(m * p1);
    9090        for(j = 0; j < n; j++)
    91         {       x[j]            = double(j) / double(n); 
     91        {       x[j]            = double(j) / double(n);
    9292                x_p[j * p1 + 0] = x[j]; // order 0
    9393                x_p[j * p1 + 1] = 1.;   // order 1
  • trunk/test_more/from_base.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-06 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2222        using namespace CppAD;
    2323
    24         // construct directly form Base where Base = double 
    25         AD<double> x(1.); 
     24        // construct directly form Base where Base = double
     25        AD<double> x(1.);
    2626        AD<double> y = 2.;
    2727
    28         // construct from a type that can be converted to Base 
     28        // construct from a type that can be converted to Base
    2929        // where Base = AD<double>
    30         AD< AD<double> > X(1.); 
     30        AD< AD<double> > X(1.);
    3131        AD< AD<double> > Y(2);
    3232
  • trunk/test_more/fun_check.cpp

    r3214 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    3333                for(i = 0; i < n; i++)
    3434                {       // This operaiton sequence depends on x
    35                         if( x[i] >= 0 ) 
     35                        if( x[i] >= 0 )
    3636                                y[i] = exp(x[i]);
    3737                        else    y[i] = exp(-x[i]);
    3838                }
    3939                return y;
    40         }       
     40        }
    4141};
    4242// template function FunCheckCases<Vector, ADVector> in empty namespace
     
    7575        Fun<double, Vector> g(n);
    7676
    77         // function values should agree when the independent variable 
     77        // function values should agree when the independent variable
    7878        // values are the same as during recording
    7979        Vector x(n);
     
    8181        for(j = 0; j < n; j++)
    8282                x[j] = Value(X[j]);
    83         double r = 1e-10; 
     83        double r = 1e-10;
    8484        double a = 1e-10;
    8585        ok      &= FunCheck(f, g, x, a, r);
     
    106106        return ok;
    107107}
    108 } // End empty namespace 
     108} // End empty namespace
    109109# include <vector>
    110110# include <valarray>
     
    118118        typedef std::valarray< CppAD::AD<double> > ADVector3;
    119119        // Run with Vector and ADVector equal to three different cases
    120         // all of which are Simple Vectors with elements of type 
     120        // all of which are Simple Vectors with elements of type
    121121        // double and AD<double> respectively.
    122122        ok &= FunCheckCases< Vector1, ADVector2 >();
  • trunk/test_more/jacobian.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    4545
    4646
    47 } // End empty namespace 
     47} // End empty namespace
    4848
    4949bool jacobian(void)
     
    7474                ok &= CppAD::NearEqual(jac_g[k], check[k], 1e-10, 1e-10);
    7575
    76         // one argument sparse jacobian 
     76        // one argument sparse jacobian
    7777        jac_g = fun_g.SparseJacobian(x);
    7878        for(k = 0; k < m *n; k++)
  • trunk/test_more/mul.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    4646        Z[x] = U[s] * U[t];   // AD<double> * AD<double>
    4747        Z[y] = Z[x] * 4.;     // AD<double> *    double
    48         Z[z] = 4.   * Z[y];   //    double  * AD<double> 
     48        Z[z] = 4.   * Z[y];   //    double  * AD<double>
    4949        Z[u] =  one * Z[z];   // multiplication by parameter equal to one
    5050        Z[v] = zero * Z[z];   // multiplication by parameter equal to zero
     
    7272        q[t] = 0.;
    7373        r    = f.Forward(1, q);
    74         ok &= ( r[x] == U[t] );           // dx/ds     
     74        ok &= ( r[x] == U[t] );           // dx/ds
    7575        ok &= ( r[y] == U[t] * 4. );      // dy/ds
    7676        ok &= ( r[z] == 4. * U[t] * 4. ); // dz/ds
     
    107107        AD<double> a = U[0] * 1.; // AD<double> * double
    108108        AD<double> b = a  * 2;    // AD<double> * int
    109         AD<double> c = 3. * b;    // double     * AD<double> 
    110         AD<double> d = 4  * c;    // int        * AD<double> 
     109        AD<double> c = 3. * b;    // double     * AD<double>
     110        AD<double> d = 4  * c;    // int        * AD<double>
    111111
    112         // dependent variable vector 
     112        // dependent variable vector
    113113        CPPAD_TESTVECTOR(AD<double>) Z(1);
    114114        Z[0] = U[0] * d;          // AD<double> * AD<double>
    115115
    116116        // create f: U -> Z and vectors used for derivative calculations
    117         ADFun<double> f(U, Z); 
     117        ADFun<double> f(U, Z);
    118118        CPPAD_TESTVECTOR(double) v(1);
    119119        CPPAD_TESTVECTOR(double) w(1);
    120120
    121         // check value 
     121        // check value
    122122        ok &= NearEqual(Value(Z[0]) , u0*4*3*2*u0,  1e-10 , 1e-10);
    123123
     
    136136
    137137                jfac *= j;
    138                 w     = f.Forward(j, v);       
     138                w     = f.Forward(j, v);
    139139                ok &= NearEqual(jfac*w[0], value, 1e-10 , 1e-10); // d^jz/du^j
    140140                v[0]  = 0.;
     
    142142
    143143        // reverse computation of partials of Taylor coefficients
    144         CPPAD_TESTVECTOR(double) r(p); 
     144        CPPAD_TESTVECTOR(double) r(p);
    145145        w[0]  = 1.;
    146146        r     = f.Reverse(p, w);
     
    166166{       bool ok = true;
    167167        ok &= MulTestOne();
    168         ok &= MulTestTwo(); 
     168        ok &= MulTestTwo();
    169169        return ok;
    170170}
  • trunk/test_more/mul_eq.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    8888        double u0 = .5;
    8989        CPPAD_TESTVECTOR(AD<double>) U(1);
    90         U[0]      = u0; 
     90        U[0]      = u0;
    9191        Independent(U);
    9292
    93         // dependent variable vector 
     93        // dependent variable vector
    9494        CPPAD_TESTVECTOR(AD<double>) Z(1);
    9595        Z[0] = U[0];       // initial value
    9696        Z[0] *= 2;         // AD<double> *= int
    9797        Z[0] *= 4.;        // AD<double> *= double
    98         Z[0] *= U[0];      // AD<double> *= AD<double> 
     98        Z[0] *= U[0];      // AD<double> *= AD<double>
    9999
    100100        // create f: U -> Z and vectors used for derivative calculations
    101         ADFun<double> f(U, Z); 
     101        ADFun<double> f(U, Z);
    102102        CPPAD_TESTVECTOR(double) v(1);
    103103        CPPAD_TESTVECTOR(double) w(1);
    104104
    105         // check value 
     105        // check value
    106106        ok &= NearEqual(Z[0] , u0*2*4*u0,  1e-10 , 1e-10);
    107107
     
    120120
    121121                jfac *= j;
    122                 w     = f.Forward(j, v);       
     122                w     = f.Forward(j, v);
    123123                ok &= NearEqual(jfac*w[0], value, 1e-10 , 1e-10); // d^jz/du^j
    124124                v[0]  = 0.;
     
    126126
    127127        // reverse computation of partials of Taylor coefficients
    128         CPPAD_TESTVECTOR(double) r(p); 
     128        CPPAD_TESTVECTOR(double) r(p);
    129129        w[0]  = 1.;
    130130        r     = f.Reverse(p, w);
     
    150150{       bool ok = true;
    151151        ok &= MulEqTestOne();
    152         ok &= MulEqTestTwo(); 
     152        ok &= MulEqTestTwo();
    153153        return ok;
    154154}
  • trunk/test_more/mul_level.cpp

    r3071 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1616# include <adolc/taping.h>
    1717# include <adolc/interfaces.h>
    18 // adouble definitions not in Adolc distribution and 
     18// adouble definitions not in Adolc distribution and
    1919// required in order to use CppAD::AD<adouble>
    2020# include <cppad/example/base_adolc.hpp>
     
    2626namespace { // BEGIN empty namespace
    2727
    28 bool One(void) 
     28bool One(void)
    2929{       bool ok = true;                          // initialize test result
    3030        using CppAD::NearEqual;
     
    9595
    9696        // check computed assignment AD< AD<double> > -= int
    97         sum -= 1; 
    98 
    99         // check double * AD< AD<double> > 
     97        sum -= 1;
     98
     99        // check double * AD< AD<double> >
    100100        return .5 * sum;
    101 } 
    102 
    103 bool Two(void) 
     101}
     102
     103bool Two(void)
    104104{       bool ok = true;                          // initialize test result
    105105
     
    128128        CppAD::ADFun<ADdouble> a_F(aa_x, aa_f);
    129129
    130         // compute f'(x) 
     130        // compute f'(x)
    131131        size_t p = 1;                        // order of derivative of a_F
    132132        CPPAD_TESTVECTOR(ADdouble) a_w(1);  // weight vector for a_F
     
    156156# ifdef CPPAD_ADOLC_TEST
    157157
    158 bool adolc(void) 
     158bool adolc(void)
    159159{       bool ok = true;                   // initialize test result
    160160
     
    187187        CppAD::ADFun<ADdouble> a_F(aa_x, aa_f);
    188188
    189         // compute f'(x) 
     189        // compute f'(x)
    190190        size_t p = 1;                        // order of derivative of a_F
    191191        CPPAD_TESTVECTOR(ADdouble) a_w(1);  // weight vector for a_F
     
    194194        a_df   = a_F.Reverse(p, a_w);        // gradient of f
    195195
    196         // declare outter function 
     196        // declare outter function
    197197        // (corresponding to the tape of adouble operations)
    198198        double df_j;
     
    252252        ADFun<double> g(ax, ay);
    253253
    254         // evaluate h(x) = g(x) 
     254        // evaluate h(x) = g(x)
    255255        x[0] = 1.;
    256256        y = g.Forward(0, x);
  • trunk/test_more/mul_zero_one.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2121
    2222bool MulZeroOne(void)
    23 {       
     23{
    2424        using namespace CppAD;
    2525
  • trunk/test_more/near_equal_ext.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-06 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2323        using CppAD::NearEqual;
    2424
    25         // double 
     25        // double
    2626        double x    = 1.00000;
    2727        double y    = 1.00001;
    2828        double a    =  .00005;
    2929        double r    =  .00005;
    30         double zero = 0.; 
     30        double zero = 0.;
    3131        double inf  = 1. / zero;
    3232        double nan  = 0. / zero;
    3333
    34         // AD<double> 
     34        // AD<double>
    3535        AD<double> X(x);
    3636        AD<double> Y(y);
  • trunk/test_more/neg.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    3636
    3737        // dependent variable values
    38         Z[x] = - U[t];   //  - AD<double> 
     38        Z[x] = - U[t];   //  - AD<double>
    3939
    4040        // create f: U -> Z and vectors used for derivative calculations
     
    6464        ok &= ( r[2 * s + 1] == 0. );  // d^2 x / (ds ds)
    6565        ok &= ( r[2 * t + 1] == 0. );  // d^2 x / (ds dt)
    66          
     66
    6767        return ok;
    6868}
  • trunk/test_more/parameter.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    3232        CPPAD_TESTVECTOR(AD<Float>) ax(n);
    3333        for(j = 0; j < n; j++)
    34                 ax[j] = Float(j); 
     34                ax[j] = Float(j);
    3535        Independent(ax);
    3636
     
    3939        CPPAD_TESTVECTOR(AD<Float>) ay(m);
    4040        for(i = 0; i < m; i++)
    41         {       // must avoid Float(k) = 0 because it would get optimized out   
    42                 size_t k = (i % n_parameter); 
     41        {       // must avoid Float(k) = 0 because it would get optimized out
     42                size_t k = (i % n_parameter);
    4343                k        = k * k * 10 + 1;
    4444                j        = i;
     
    4646        }
    4747
    48         // create f: ax -> ay 
     48        // create f: ax -> ay
    4949        ADFun<Float> f(ax, ay);
    5050
     
    5959{       bool ok = true;
    6060        ok &= test<double>();
    61         ok &= test<float>(); 
     61        ok &= test<float>();
    6262        return ok;
    6363}
  • trunk/test_more/poly.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    4343        Independent(Z);                       // declare independent variable
    4444
    45         // dependent variables 
     45        // dependent variables
    4646        CPPAD_TESTVECTOR(AD<double>) P(1); // one dependent variable
    4747        P[0]     = Poly(0, A, Z[0]);    // value of polynomial at Z[0]
    4848
    49         // define f : Z -> P as a function mapping independent to dependent 
     49        // define f : Z -> P as a function mapping independent to dependent
    5050        ADFun<double> f(Z, P);          // ADFun corresponding to polynomial
    5151
  • trunk/test_more/pow.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    3535        CppAD::Independent(XY);
    3636
    37         // range space vector 
     37        // range space vector
    3838        size_t m = 3;
    3939        CPPAD_TESTVECTOR(AD<double>) Z(m);
     
    4343
    4444        // create f: XY -> Z and stop tape recording
    45         CppAD::ADFun<double> f(XY, Z); 
    46 
    47         // check value 
     45        CppAD::ADFun<double> f(XY, Z);
     46
     47        // check value
    4848        double check = std::pow(x, y);
    4949        size_t i;
     
    153153        ok &= ( w[y] == U[s] * u * Z[y] );               // dy/dt
    154154
    155         // forward computation of second Taylor coefficient w.r.t. t 
     155        // forward computation of second Taylor coefficient w.r.t. t
    156156        v[t] = 1.;
    157157        w    = f.Forward(1, v);
     
    159159        CPPAD_TESTVECTOR(double) f_tt = f.Forward(2, v);
    160160
    161         // forward computation of second Taylor coefficient w.r.t. s 
     161        // forward computation of second Taylor coefficient w.r.t. s
    162162        v[s] = 1.;
    163163        w    = f.Forward(1, v);
     
    165165        CPPAD_TESTVECTOR(double) f_ss = f.Forward(2, v);
    166166
    167         // second Taylor coefficient w.r.t. direction r = (s,t) 
     167        // second Taylor coefficient w.r.t. direction r = (s,t)
    168168        v[s] = 1.;
    169169        v[t] = 1.;
     
    175175        // check second order partial of y
    176176        ok &= NearEqual(
    177                 f_rr[y] - f_ss[y] - f_tt[y], 
    178                 (1. + U[s]) * u * Z[y] + 
     177                f_rr[y] - f_ss[y] - f_tt[y],
     178                (1. + U[s]) * u * Z[y] +
    179179                        (1. + U[s]) * U[t] * u * U[s] * u * Z[y],
    180180                1e-10 ,
    181                 1e-10 
    182         ); 
     181                1e-10
     182        );
    183183
    184184        return ok;
     
    199199        CppAD::Independent(x);
    200200
    201         // range space vector 
     201        // range space vector
    202202        size_t m = 4;
    203203        CPPAD_TESTVECTOR(AD<double>) y(m);
     
    210210
    211211        // create f: x -> y and stop tape recording
    212         CppAD::ADFun<double> f(x, y); 
     212        CppAD::ADFun<double> f(x, y);
    213213
    214214        // check function values
     
    228228        ok   &= (dy[3] == 0.);
    229229
    230         // reverse mode computation of derivative of y[0]+y[1]+y[2]+y[3] 
     230        // reverse mode computation of derivative of y[0]+y[1]+y[2]+y[3]
    231231        CPPAD_TESTVECTOR(double)  w(m);
    232232        CPPAD_TESTVECTOR(double) dw(n);
     
    238238        ok  &= NearEqual(dw[0], 1., 1e-10, 1e-10);
    239239
    240         return ok;     
     240        return ok;
    241241}
    242242
     
    256256        CppAD::Independent(x);
    257257
    258         // range space vector 
     258        // range space vector
    259259        size_t m = 5;
    260260        CPPAD_TESTVECTOR(AD<double>) y(m);
     
    263263        y[0] = pow(1., x[0]);
    264264        size_t i;
    265         for(i = 1; i < m; i++) 
     265        for(i = 1; i < m; i++)
    266266                y[i] = pow(x[0], i-1);   // pow(AD<double>, int)
    267267
    268268        // create f: x -> y and stop tape recording
    269         CppAD::ADFun<double> f(x, y); 
     269        CppAD::ADFun<double> f(x, y);
    270270
    271271        ok  &= (Value(y[0]) == 1.);
     
    299299        ok  &= NearEqual(dw[0], sum, 1e-10, 1e-10);
    300300
    301         return ok;     
     301        return ok;
    302302}
    303303bool PowTestFive(void)
     
    316316        CppAD::Independent(x);
    317317
    318         // range space vector 
     318        // range space vector
    319319        size_t m = 1;
    320320        CPPAD_TESTVECTOR(AD<double>) y(m);
     
    325325
    326326        // create f: x -> y and stop tape recording
    327         CppAD::ADFun<double> f(x, y); 
     327        CppAD::ADFun<double> f(x, y);
    328328
    329329        // check function value
     
    338338        ok   &= NearEqual(dy[0], d1, 1e-10, 1e-10);
    339339
    340         // reverse mode computation of second partials 
     340        // reverse mode computation of second partials
    341341        // x.r.t. x[1],x[0]  and x[1], x[1]
    342342        double d2 = e * (e-1) * pow(x0, (e-2));
     
    348348        ok  &= NearEqual(ddw[1], d2, 1e-10, 1e-10);
    349349
    350         return ok;     
     350        return ok;
    351351}
    352352bool PowTestSix(void)
     
    369369        CppAD::Independent(X);
    370370
    371         // range space vector 
     371        // range space vector
    372372        size_t m = 1;
    373373        CPPAD_TESTVECTOR(AD< AD<double> >) Y(m);
     
    375375        // case of AD< AD<double> > raised to a double power
    376376        double e = 2.5;
    377         Y[0] = pow(X[0], e); 
     377        Y[0] = pow(X[0], e);
    378378
    379379        // create F: X -> Y and stop tape recording
    380         CppAD::ADFun< AD<double> > F(X, Y); 
     380        CppAD::ADFun< AD<double> > F(X, Y);
    381381
    382382        // check function value
     
    391391        ok   &= NearEqual(dy[0], d1, 1e-10, 1e-10);
    392392
    393         // reverse mode computation of second partials 
     393        // reverse mode computation of second partials
    394394        // x.r.t. x[1],x[0]  and x[1], x[1]
    395395        double d2 = e * (e-1) * pow(x0, (e-2));
     
    401401        ok  &= NearEqual(ddw[1], d2, 1e-10, 1e-10);
    402402
    403         return ok;     
     403        return ok;
    404404}
    405405
    406406} // END empty namespace
    407  
     407
    408408bool Pow(void)
    409409{       bool ok = true;
  • trunk/test_more/pow_int.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    5353        ok &= NearEqual(Z[1] , exp( - log(u) * 5.),            1e-10 , 1e-10);
    5454
    55         // forward computation of partials 
     55        // forward computation of partials
    5656        v[0] = 1.;
    5757        w = f.Forward(1, v);
  • trunk/test_more/print_for.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1414# include <cppad/cppad.hpp>
    1515
    16 namespace { 
     16namespace {
    1717        using std::endl;
    1818        using CppAD::AD;
     
    2727
    2828                return log(y);
    29         } 
     29        }
    3030}
    3131
     
    4747        AD<double> Zero(0);
    4848        av[Zero] = 0.;
    49         PrintFor("v[0] = ", av[Zero]); 
     49        PrintFor("v[0] = ", av[Zero]);
    5050        string_check += "v[0] = 0"; // v[0] == 0 during Forward(0, x)
    5151
    5252        // Print a newline to separate this from previous output,
    5353        // then print an AD<double> object that is a variable.
    54         PrintFor("\nv[0] + x[0] = ", av[0] + ax[0]); 
    55         string_check += "\nv[0] + x[0] = 2"; // x[0] == 2 during Forward(0, x) 
     54        PrintFor("\nv[0] + x[0] = ", av[0] + ax[0]);
     55        string_check += "\nv[0] + x[0] = 2"; // x[0] == 2 during Forward(0, x)
    5656
    5757        // A conditional print that will not generate output when x[0] = 2.
     
    6767        string_check += "check_log: y == 0 which is <= 0\n";
    6868
    69         // dependent variable vector 
     69        // dependent variable vector
    7070        size_t m = 2;
    7171        CPPAD_TESTVECTOR(AD<double>) ay(m);
     
    7373
    7474        // define f: x -> y and stop tape recording
    75         CppAD::ADFun<double> f(ax, ay); 
     75        CppAD::ADFun<double> f(ax, ay);
    7676
    77         // zero order forward with x[0] = 2 
     77        // zero order forward with x[0] = 2
    7878        CPPAD_TESTVECTOR(double) x(n);
    7979        x[0] = 2.;
    80         f.Forward(0, x, stream_out);   
     80        f.Forward(0, x, stream_out);
    8181
    8282        std::string string_out = stream_out.str();
    83         ok &= string_out == string_check; 
     83        ok &= string_out == string_check;
    8484        return ok;
    8585}
  • trunk/test_more/rev_sparse_hes.cpp

    r2935 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    1313
    1414# include <cppad/cppad.hpp>
    15  
     15
    1616namespace { // Begin empty namespace
    1717
     
    2121
    2222        // dimension of the domain space
    23         size_t n = 10; 
     23        size_t n = 10;
    2424
    2525        // dimension of the range space
     
    3434                Check[j] = false;
    3535
    36         // independent variable vector 
     36        // independent variable vector
    3737        CPPAD_TESTVECTOR(AD<double>) X(n);
    3838        for(j = 0; j < n; j++)
     
    5555        Check[6 * n + 6] = true;
    5656        Check[7 * n + 7] = true;
    57        
     57
    5858        // pow(variable, variable)
    5959        sum += pow(X[8], X[9]);
     
    8383        F.ForSparseJac(n, Px);
    8484
    85         // compute sparsity pattern for Hessian of F_0 ( U(x) ) 
     85        // compute sparsity pattern for Hessian of F_0 ( U(x) )
    8686        CPPAD_TESTVECTOR(bool) Py(m);
    8787        Py[0] = true;
     
    110110        F.ForSparseJac(n, Sx);
    111111
    112         // compute sparsity pattern for Hessian of F_0 ( U(x) ) 
     112        // compute sparsity pattern for Hessian of F_0 ( U(x) )
    113113        CPPAD_TESTVECTOR(std::set<size_t>) Sy(1);
    114114        Sy[0].insert(0);
     
    143143
    144144        // dimension of the domain space
    145         size_t n = 4; 
     145        size_t n = 4;
    146146
    147147        // dimension of the range space
     
    156156                Check[j] = false;
    157157
    158         // independent variable vector 
     158        // independent variable vector
    159159        CPPAD_TESTVECTOR(AD<double>) X(n);
    160160        for(j = 0; j < n; j++)
     
    163163
    164164        // Test the case where dependent variable is a non-linear function
    165         // of the result of a conditional expression. 
     165        // of the result of a conditional expression.
    166166        CPPAD_TESTVECTOR(AD<double>) Y(m);
    167167        Y[0] = CondExpLt(X[0], X[1], X[2], X[3]);
     
    174174        Check[2 * n + 2] = Check[ 2 * n + 3 ] = true;
    175175        Check[3 * n + 2] = Check[ 3 * n + 3 ] = true;
    176        
     176
    177177        // create function object F : X -> Y
    178178        ADFun<double> F(X, Y);
     
    190190        F.ForSparseJac(n, Px);
    191191
    192         // compute sparsity pattern for Hessian of F_0 ( U(x) ) 
     192        // compute sparsity pattern for Hessian of F_0 ( U(x) )
    193193        CPPAD_TESTVECTOR(bool) Py(m);
    194194        Py[0] = true;
     
    209209        F.ForSparseJac(n, Sx);
    210210
    211         // compute sparsity pattern for Hessian of F_0 ( U(x) ) 
     211        // compute sparsity pattern for Hessian of F_0 ( U(x) )
    212212        CPPAD_TESTVECTOR(std::set<size_t>) Sy(1);
    213213        Sy[0].insert(0);
     
    231231
    232232        // domain space vector
    233         size_t n = 1; 
     233        size_t n = 1;
    234234        CPPAD_TESTVECTOR(AD<double>) X(n);
    235         X[0] = 0.; 
     235        X[0] = 0.;
    236236
    237237        // declare independent variables and start recording
     
    282282        f.ForSparseJac(n, Sx);
    283283
    284         // compute sparsity pattern for Hessian of F_0 ( U(x) ) 
     284        // compute sparsity pattern for Hessian of F_0 ( U(x) )
    285285        CPPAD_TESTVECTOR(std::set<size_t>) Sy(1);
    286286        Sy[0].insert(0);
     
    300300
    301301        // dimension of the domain space
    302         size_t n = 3; 
     302        size_t n = 3;
    303303
    304304        // dimension of the range space
     
    311311                Z[k] = 0.;
    312312
    313         // independent variable vector 
     313        // independent variable vector
    314314        CPPAD_TESTVECTOR(AD<double>) X(n);
    315         X[0] = 0.; 
     315        X[0] = 0.;
    316316        X[1] = 1.;
    317317        X[2] = 2.;
     
    321321        // (component indices do not matter because they can change).
    322322        Z[ X[0] ] = X[1] * X[2];
    323         Z[ X[1] ] = 0.; 
     323        Z[ X[1] ] = 0.;
    324324
    325325        // dependent variable vector
     
    367367        {       for(j = 0; j < n; j++)
    368368                        ok &= (h[i * n + j] == Check[i * n + j]);
    369         }       
     369        }
    370370
    371371        // ------------------------------------------------------------------
     
    378378        F.ForSparseJac(n, Sx);
    379379
    380         // compute sparsity pattern for Hessian of F_0 ( U(x) ) 
     380        // compute sparsity pattern for Hessian of F_0 ( U(x) )
    381381        CPPAD_TESTVECTOR(std::set<size_t>) Sy(1);
    382382        Sy[0].insert(0);
     
    401401
    402402        size_t n = 2;
    403         CPPAD_TESTVECTOR(AD<double>) X(n); 
     403        CPPAD_TESTVECTOR(AD<double>) X(n);
    404404        X[0] = 1.;
    405405        X[1] = 2.;
     
    423423        F.ForSparseJac(n, Px);
    424424
    425         // compute sparsity pattern for Hessian of F_k ( U(x) ) 
     425        // compute sparsity pattern for Hessian of F_k ( U(x) )
    426426        CPPAD_TESTVECTOR(bool) Py(m);
    427427        CPPAD_TESTVECTOR(bool) Pxx(n * n);
     
    446446
    447447        // dimension of the domain space
    448         size_t n = 3; 
     448        size_t n = 3;
    449449
    450450        // dimension of the range space
    451451        size_t m = 1;
    452452
    453         // independent variable vector 
     453        // independent variable vector
    454454        CPPAD_TESTVECTOR(AD<double>) X(n);
    455         X[0] = 0.; 
     455        X[0] = 0.;
    456456        X[1] = 1.;
    457457        X[2] = 2.;
     
    513513        {       for(j = 0; j < n; j++)
    514514                        ok &= (h[i * n + j] == Check[i * n + j]);
    515         }       
     515        }
    516516
    517517        // compute the reverse Hessian sparsity pattern for R^T * F^2
     
    523523        {       for(j = 0; j < n; j++)
    524524                        ok &= (h[j * n + i] == Check[i * n + j]);
    525         }       
     525        }
    526526
    527527        return ok;
  • trunk/test_more/reverse.cpp

    r2859 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2323        using namespace CppAD;
    2424
    25         // independent variable vector 
     25        // independent variable vector
    2626        CPPAD_TESTVECTOR(AD<double>) U(3);
    2727        U[0] = 0.; U[1] = 1.; U[2] = 2.;
     
    3737        }
    3838
    39         // dependent variable vector 
     39        // dependent variable vector
    4040        CPPAD_TESTVECTOR(AD<double>) V(2);
    4141        V[0] = Sum;
     
    6262        // compare values
    6363        for(i = 0; i < 3; i++)
    64         {       ok &= NearEqual(r1[i] , 
     64        {       ok &= NearEqual(r1[i] ,
    6565                        v[0] * g0[i] + v[1] * g1[i], 1e-10, 1e-10);
    6666        }
     
    8686        // check derivative of the zero order term
    8787        for(i = 0; i < 3; i++)
    88         {       ok &= NearEqual(r2[p * i + 0] , 
     88        {       ok &= NearEqual(r2[p * i + 0] ,
    8989                        v[0] * g0[i] + v[1] * g1[i], 1e-10, 1e-10);
    9090        }
    9191
    9292        /*
    93         The j-th component of the first order term is 
     93        The j-th component of the first order term is
    9494                d/dt z_j(0, u0, u1) = f_j^{(1)} (u0) * u1
    9595        We use ei to denote the vector with its i-th component one and all
    9696        the other components zero. The partial derivative of the j-th
    97         component of the first order term with respect u0[i] is 
     97        component of the first order term with respect u0[i] is
    9898                ei * f_j^{(2)} ( u0 ) * u1
    9999        */
     
    122122
    123123// define the template function reverse_any_cases<Vector> in empty namespace
    124 template <typename Vector> 
     124template <typename Vector>
    125125bool reverse_any_cases(void)
    126126{       bool ok = true;
     
    131131        size_t n = 3;
    132132        CPPAD_TESTVECTOR(AD<double>) X(n);
    133         X[0] = 0.; 
     133        X[0] = 0.;
    134134        X[1] = 1.;
    135135        X[2] = 2.;
     
    219219$index composition, example$$
    220220$index example, composition$$
    221 $index test, composition$$ 
     221$index test, composition$$
    222222
    223223$head Purpose$$
    224 Break a derivative computation into pieces and only store values at the 
     224Break a derivative computation into pieces and only store values at the
    225225interface of the pieces.
    226 In actual applications, there may be many functions, but 
     226In actual applications, there may be many functions, but
    227227for this example there are only two.
    228 The functions 
    229 $latex F : \B{R}^2 \rightarrow \B{R}^2$$ 
     228The functions
     229$latex F : \B{R}^2 \rightarrow \B{R}^2$$
    230230and
    231 $latex G : \B{R}^2 \rightarrow \B{R}^2$$ 
     231$latex G : \B{R}^2 \rightarrow \B{R}^2$$
    232232defined by
    233233$latex \[
    234         F(x) = \left( \begin{array}{c} x_0 x_1   \\ x_1 - x_0 \end{array} \right) 
     234        F(x) = \left( \begin{array}{c} x_0 x_1   \\ x_1 - x_0 \end{array} \right)
    235235        \; , \;
    236         G(y) = \left( \begin{array}{c} y_0 - y_1 \\ y_1  y_0   \end{array} \right) 
     236        G(y) = \left( \begin{array}{c} y_0 - y_1 \\ y_1  y_0   \end{array} \right)
    237237\] $$
    238238Another difference is that in actual applications,
     
    246246$latex \[
    247247\begin{array}{rcl}
    248         H(x) 
    249         & = & G_0 [ F(x) ] + G_1 [ F(x)  ] 
    250         \\
    251         & = & x_0 x_1 - ( x_1 - x_0 ) + x_0 x_1 ( x_1 - x_0 ) 
     248        H(x)
     249        & = & G_0 [ F(x) ] + G_1 [ F(x)  ]
     250        \\
     251        & = & x_0 x_1 - ( x_1 - x_0 ) + x_0 x_1 ( x_1 - x_0 )
    252252        \\
    253253        & = & x_0 x_1 ( 1 - x_0 + x_1 ) - x_1 + x_0
    254254\end{array}
    255 \] $$ 
    256 Given the zero and first order Taylor coefficients 
     255\] $$
     256Given the zero and first order Taylor coefficients
    257257$latex x^{(0)} $$ and $latex x^{(1)}$$,
    258258we use $latex X(t)$$, $latex Y(t)$$ and $latex Z(t)$$
     
    260260$latex \[
    261261\begin{array}{rcl}
    262         X(t) & = & x^{(0)} + x^{(1)} t 
     262        X(t) & = & x^{(0)} + x^{(1)} t
    263263        \\
    264264        Y(t) & = & F[X(t)] = y^{(0)} + y^{(1)} t  + O(t^2)
     
    273273Here are the processing steps:
    274274$list number$$
    275 Use forward mode on $latex F(x)$$ to compute 
    276 $latex y^{(0)}$$ and $latex y^{(1)}$$ 
     275Use forward mode on $latex F(x)$$ to compute
     276$latex y^{(0)}$$ and $latex y^{(1)}$$
    277277$lnext
    278 Use forward mode on $latex G(y)$$ to compute 
    279 $latex z^{(0)}$$ and $latex z^{(1)}$$ 
     278Use forward mode on $latex G(y)$$ to compute
     279$latex z^{(0)}$$ and $latex z^{(1)}$$
    280280$lnext
    281 Use reverse mode on $latex G(y)$$ to compute the derivative of 
     281Use reverse mode on $latex G(y)$$ to compute the derivative of
    282282$latex h^{(k)}$$ with respect to
    283283$latex y^{(0)}$$ and $latex y^{(1)}$$.
     
    389389        w[1*p+0] = 1.; // coefficient for z^0_1
    390390        w[0*p+1] = 0.; // coefficient for z^1_0
    391         w[1*p+1] = 0.; // coefficient for z^1_1 
     391        w[1*p+1] = 0.; // coefficient for z^1_1
    392392        dw       = g.Reverse(p, w);
    393393
    394         // dv^0 = dw^0 * \partial_x^0 y^0 (x) + dw^1 * \partial_x^0 y^1 (x) 
    395         // dv^1 = dw^0 * \partial_x^1 y^0 (x) + dw^1 * \partial_x^1 y^1 (x) 
     394        // dv^0 = dw^0 * \partial_x^0 y^0 (x) + dw^1 * \partial_x^0 y^1 (x)
     395        // dv^1 = dw^0 * \partial_x^1 y^0 (x) + dw^1 * \partial_x^1 y^1 (x)
    396396        CPPAD_TESTVECTOR(double) dv(n*p);
    397         dv   = f.Reverse(p, dw); 
     397        dv   = f.Reverse(p, dw);
    398398
    399399        // check partial of h^0 w.r.t x^0_0
     
    418418        w[1*p+0] = 0.; // coefficient for z^0_1
    419419        w[0*p+1] = 1.; // coefficient for z^1_0
    420         w[1*p+1] = 1.; // coefficient for z^1_1 
     420        w[1*p+1] = 1.; // coefficient for z^1_1
    421421        dw       = g.Reverse(p, w);
    422422
    423         // dv^0 = dw^0 * \partial_x^0 y^0 (x) + dw^1 * \partial_x^0 y^1 (x) 
    424         // dv^1 = dw^0 * \partial_x^1 y^0 (x) + dw^1 * \partial_x^1 y^1 (x) 
    425         dv   = f.Reverse(p, dw); 
     423        // dv^0 = dw^0 * \partial_x^0 y^0 (x) + dw^1 * \partial_x^0 y^1 (x)
     424        // dv^1 = dw^0 * \partial_x^1 y^0 (x) + dw^1 * \partial_x^1 y^1 (x)
     425        dv   = f.Reverse(p, dw);
    426426
    427427        // check partial of h^1 w.r.t x^0_0
     
    433433        // check partial of h^1 w.r.t x^0_1
    434434        check  = x0[0] * (- x1[0] + x1[1]);
    435         check += x1[0] * (1. - x0[0] + x0[1]) + x1[0] * x0[1]; 
     435        check += x1[0] * (1. - x0[0] + x0[1]) + x1[0] * x0[1];
    436436        check += x0[0] * x1[1];
    437437        ok    &= NearEqual(dv[1*p+0], check, eps, eps);
     
    452452}
    453453// ----------------------------------------------------------------------------
    454 } // End empty namespace 
     454} // End empty namespace
    455455
    456456# include <vector>
  • trunk/test_more/rosen_34.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2424Case where
    2525x[0](0) = 1, x[0]'(t) = - w[0] * x[0](t)
    26 x[1](0) = 1, x[1]'(t) = - w[1] * x[1](t) 
     26x[1](0) = 1, x[1]'(t) = - w[1] * x[1](t)
    2727x[2](0) = 0, x[2]'(t) =   w[2] * t
    2828
     
    4040                }
    4141                void Ode(
    42                         const CppAD::AD<double>                      &t, 
    43                         const CPPAD_TESTVECTOR(CppAD::AD<double>) &x, 
    44                         CPPAD_TESTVECTOR(CppAD::AD<double>)       &f) 
     42                        const CppAD::AD<double>                      &t,
     43                        const CPPAD_TESTVECTOR(CppAD::AD<double>) &x,
     44                        CPPAD_TESTVECTOR(CppAD::AD<double>)       &f)
    4545                {
    4646                        f[0] = - w[0] * x[0];
    4747                        f[1] = - w[1] * x[1];
    4848                        f[2] =   w[2] * t;
    49        
     49
    5050                }
    51        
     51
    5252                void Ode_ind(
    53                         const CppAD::AD<double>                      &t, 
    54                         const CPPAD_TESTVECTOR(CppAD::AD<double>) &x, 
    55                         CPPAD_TESTVECTOR(CppAD::AD<double>)       &f_t) 
     53                        const CppAD::AD<double>                      &t,
     54                        const CPPAD_TESTVECTOR(CppAD::AD<double>) &x,
     55                        CPPAD_TESTVECTOR(CppAD::AD<double>)       &f_t)
    5656                {
    5757                        f_t[0] = 0.;
    5858                        f_t[1] = 0.;
    5959                        f_t[2] = w[2];
    60        
     60
    6161                }
    62        
     62
    6363                void Ode_dep(
    64                         const CppAD::AD<double>                      &t, 
    65                         const CPPAD_TESTVECTOR(CppAD::AD<double>) &x, 
    66                         CPPAD_TESTVECTOR(CppAD::AD<double>)       &f_x) 
     64                        const CppAD::AD<double>                      &t,
     65                        const CPPAD_TESTVECTOR(CppAD::AD<double>) &x,
     66                        CPPAD_TESTVECTOR(CppAD::AD<double>)       &f_x)
    6767                {
    6868                        f_x[0] = - w[0];    f_x[1] = 0.;      f_x[2] = 0.;
    6969                        f_x[3] = 0.;        f_x[4] = - w[1];  f_x[5] = 0.;
    7070                        f_x[6] = 0.;        f_x[7] = 0.;      f_x[8] = 0.;
    71        
     71
    7272                }
    73        
     73
    7474        private:
    7575                CPPAD_TESTVECTOR(CppAD::AD<double>) w;
     
    9797        // construct the function object using the independent variables
    9898        TestFun  fun(w);
    99        
     99
    100100        // initial value of x
    101101        CPPAD_TESTVECTOR(AD<double>) xini(3);
     
    103103        xini[1] = 1.;
    104104        xini[2] = 0.;
    105        
     105
    106106
    107107        // integrate the differential equation
  • trunk/test_more/runge_45.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2727                }
    2828                void Ode(
    29                         const CppAD::AD<double>                      &t, 
    30                         const CPPAD_TESTVECTOR(CppAD::AD<double>) &x, 
    31                         CPPAD_TESTVECTOR(CppAD::AD<double>)       &f) 
     29                        const CppAD::AD<double>                      &t,
     30                        const CPPAD_TESTVECTOR(CppAD::AD<double>) &x,
     31                        CPPAD_TESTVECTOR(CppAD::AD<double>)       &f)
    3232                {
    3333                        using CppAD::exp;
    34        
     34
    3535                        size_t n = x.size();
    36        
     36
    3737                        size_t i;
    3838                        f[0]  = 0.;
    3939                        for(i = 1; i < n-1; i++)
    4040                                f[i] = w[i] * x[i-1];
    41        
     41
    4242                        f[n-1] = x[0] * x[1];
    4343                }
     
    118118                        if (j == 0 )
    119119                                ok &= NearEqual(q[j], x[i], 1e-14, 1e-14);
    120                         else if( j <= i  ) 
     120                        else if( j <= i  )
    121121                                ok &= NearEqual(
    122122                                        q[j], x[i]/w[j], 1e-14, 1e-14);
     
    136136                if (j == 0 )
    137137                        ok &= NearEqual(q[j], 2.*x[i], 1e-14, 1e-14);
    138                 else if( j == 1  ) 
     138                else if( j == 1  )
    139139                        ok &= NearEqual(
    140140                                q[j], x[i]/w[1], 1e-14, 1e-14);
  • trunk/test_more/sin.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    2828        Independent(U);
    2929
    30         // dependent variable vector 
     30        // dependent variable vector
    3131        CPPAD_TESTVECTOR(AD<double>) Z(1);
    32         Z[0] = sin(U[0]); 
     32        Z[0] = sin(U[0]);
    3333
    3434        // create f: U -> Z and vectors used for derivative calculations
    35         ADFun<double> f(U, Z); 
     35        ADFun<double> f(U, Z);
    3636        CPPAD_TESTVECTOR(double) v(1);
    3737        CPPAD_TESTVECTOR(double) w(1);
    3838
    39         // check value 
     39        // check value
    4040        double sin_u = sin( Value(U[0]) );
    4141        double cos_u = cos( Value(U[0]) );
     
    4949        v[0]         = 1.;
    5050        for(j = 1; j < p; j++)
    51         {       w     = f.Forward(j, v);       
     51        {       w     = f.Forward(j, v);
    5252
    5353                double value;
     
    6666
    6767        // reverse computation of partials of Taylor coefficients
    68         CPPAD_TESTVECTOR(double) r(p); 
     68        CPPAD_TESTVECTOR(double) r(p);
    6969        w[0]  = 1.;
    7070        r     = f.Reverse(p, w);
  • trunk/test_more/sin_cos.cpp

    r2506 r3779  
    1 /* $Id$ */
     1// $Id$
    22/* --------------------------------------------------------------------------
    3 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell
     3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    3535        Independent(X);
    3636
    37         // dependent variable vector 
     37        // dependent variable vector
    3838        CPPAD_TESTVECTOR(AD<double>) Z(1);
    3939        AD<double> U = X[0] * X[1];
    40         Z[0] = sin( U ); 
     40        Z[0] = sin( U );
    4141
    4242        // create f: X -> Z and vectors used for derivative calculations
    4343        // f(x, y) = sin(x, y)
    44         ADFun<double> f(X, Z); 
     44        ADFun<double> f(X, Z);
    4545        CPPAD_TESTVECTOR(double) v( 2 );
    4646        CPPAD_TESTVECTOR(double) w( 1 );
    4747
    48         // check value 
     48        // check value
    4949        double sin_u = sin( Value(U) );
    5050        double cos_u = cos( Value(U) );
     
    6060        double yj    = 1;   // y^j
    6161        for(j = 1; j < p; j++)
    62         {       w      = f.Forward(j, v);       
     62        {       w      = f.Forward(j, v);
    6363
    6464                // compute j-th power of y
     
    7878
    7979                // check j-th derivative of z w.r.t x
    80                 ok &= NearEqual(jfac*w[0], sinj * yj, 1e-10 , 1e-10); 
     80                ok &= NearEqual(jfac*w[0], sinj * yj, 1e-10 , 1e-10);
    8181
    8282                v[0]  = 0.;
     
    8484
    8585        // reverse computation of partials of Taylor coefficients
    86         CPPAD_TESTVECTOR(double) r( 2 * p); 
     86        CPPAD_TESTVECTOR(double) r( 2 * p);
    8787        w[0]  = 1.;
    8888        r     = f.Reverse(p, w);
     
    132132        Independent(X);
    133133
    134         // dependent variable vector 
     134        // dependent variable vector
    135135        CPPAD_TESTVECTOR(AD<double>) Z(1);
    136136        AD<double> U = X[0] * X[1];
    137         Z[0] = cos( U ); 
     137        Z[0] = cos( U );
    138138
    139139        // create f: X -> Z and vectors used for derivative calculations
    140140        // f(x, y) = cos(x, y)
    141         ADFun<double> f(X, Z); 
     141        ADFun<double> f(X, Z);
    142142        CPPAD_TESTVECTOR(double) v( 2 );
    143143        CPPAD_TESTVECTOR(double) w( 1 );
    144144
    145         // check value 
     145        // check value
    146146        double sin_u = sin( Value(U) );
    147147        double cos_u = cos( Value(U) );
     
    157157        double yj    = 1;   // y^j
    158158        for(j = 1; j < p; j++)
    159         {       w      = f.Forward(j, v);       
     159        {       w      = f.Forward(j, v);
    160160
    161161                // compute j-th power of y
     
    175175
    176176                // check j-th derivative of z w.r.t x
    177                 ok &= NearEqual(jfac*w[0], cosj * yj, 1e-10 , 1e-10); 
     177                ok &= NearEqual(jfac*w[0], cosj * yj, 1e-10 , 1e-10);
    178178
    179179                v[0]  = 0.;
     
    181181
    182182        // reverse computation of partials of Taylor coefficients
    183         CPPAD_TESTVECTOR(double) r( 2 * p); 
     183        CPPAD_TESTVECTOR(double) r( 2 * p);
    184184        w[0]  = 1.;
    185185        r     = f.Reverse(p, w);
     
    229229        Independent(X);
    230230
    231         // dependent variable vector 
     231        // dependent variable vector
    232232        CPPAD_TESTVECTOR(AD<double>) Z(1);
    233233        AD<double> U = X[0] * X[1];
    234         Z[0] = cosh( U ); 
     234        Z[0] = cosh( U );
    235235
    236236        // create f: X -> Z and vectors used for derivative calculations
    237237        // f(x, y) = cosh(x, y)
    238         ADFun<double> f(X, Z); 
     238        ADFun<double> f(X, Z);
    239239        CPPAD_TESTVECTOR(double) v( 2 );
    240240        CPPAD_TESTVECTOR(double) w( 1 );
    241241
    242         // check value 
     242        // check value