Changeset 3706


Ignore:
Timestamp:
Aug 16, 2015 11:55:39 AM (5 years ago)
Author:
bradbell
Message:

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

commit bcc054a68dd167c73d578bf420a3a631b327e72d
Author: Brad Bell <bradbell@…>
Date: Sun Aug 16 08:53:21 2015 -0700

Add size_var function to checkpoint objects.

commit 703de0ff0b07aacdff37612428a2bed94022d27e
Author: Brad Bell <bradbell@…>
Date: Sun Aug 16 06:58:56 2015 -0700

Remove invisible white space.

commit cd67e98d520319d188cd1876973c2ba65b71b5fd
Author: Brad Bell <bradbell@…>
Date: Sun Aug 16 06:54:45 2015 -0700

Improve documentation for checkpoint objects.

commit 82706229845e178fa9bfe6d1f6d13d5635b642a4
Author: Brad Bell <bradbell@…>
Date: Tue Aug 11 07:05:52 2015 -0700

vector.hpp: refactor so create_array and delete_array in only one place.

Location:
trunk
Files:
5 edited

Legend:

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

    r3607 r3706  
    77
    88CppAD is distributed under multiple licenses. This distribution is under
    9 the terms of the 
     9the terms of the
    1010                    Eclipse Public License Version 1.0.
    1111
     
    2323$begin checkpoint$$
    2424$spell
     25        sv
     26        var
    2527        cppad.hpp
    2628        CppAD
     
    2830        checkpointing
    2931        algo
    30         afun
     32        atom_fun
    3133        const
    3234$$
     
    3739
    3840$head Syntax$$
    39 $codei%checkpoint<%Base%> %afun%(%name%, %algo%, %ax%, %ay%)
    40 %afun%.option(%option_value%)
     41$codei%checkpoint<%Base%> %atom_fun%(%name%, %algo%, %ax%, %ay%)
     42%sv% = atom_fun%.size_var()
     43%atom_fun%.option(%option_value%)
    4144%algo%(%ax%, %ay%)
    42 %afun%(%ax%, %ay%)
     45%atom_fun%(%ax%, %ay%)
    4346checkpoint<%Base%>::clear()%$$
    4447
    4548$head Purpose$$
    46 You can reduce the size of the tape and memory required for AD by 
     49You can reduce the size of the tape and memory required for AD by
    4750checkpointing functions of the form $latex y = f(x)$$ where
    4851$latex f : B^n \rightarrow B^m$$.
     
    5558and hence its source code $code cppad/local/checkpoint.hpp$$
    5659provides an example implementation of $cref atomic_base$$.
    57 The difference is that $code checkpoint.hpp$$ uses AD 
     60The difference is that $code checkpoint.hpp$$ uses AD
    5861instead of user provided derivatives.
    5962
    6063$head constructor$$
    61 The constructor
     64The syntax for the checkpoint constructor is
    6265$codei%
    63         checkpoint<%Base%> %afun%(%name%, %algo%, %ax%, %ay%)
    64 %$$
    65 cannot be called in $cref/parallel/ta_in_parallel/$$ mode.
    66 In addition, you cannot currently be recording
     66        checkpoint<%Base%> %atom_fun%(%name%, %algo%, %ax%, %ay%)
     67%$$
     68$list number$$
     69This constructor cannot be called in $cref/parallel/ta_in_parallel/$$ mode.
     70$lnext
     71You cannot currently be recording
    6772$codei%AD<%Base%>%$$ operations when the constructor is called.
     73$lnext
     74This object $icode atom_fun$$ must not be destructed for as long
     75as any $code CppAD::ADFun<%Base%>$$ object use this atomic operation.
     76$lnext
    6877This class is implemented as a derived class of
    69 $cref/atomic_base/atomic_ctor/atomic_base/$$ and hence 
     78$cref/atomic_base/atomic_ctor/atomic_base/$$ and hence
    7079some of its error message will refer to $code atomic_base$$.
     80$lend
    7181
    7282$head Base$$
     
    8494%$$
    8595It is the name used for error reporting.
    86 The suggested value for $icode name$$ is $icode afun$$; i.e.,
    87 the same name as used for the function.
     96The suggested value for $icode name$$ is $icode atom_fun$$; i.e.,
     97the same name as used for the object being constructed.
    8898
    8999$head ax$$
     
    93103%$$
    94104and size must be equal to $icode n$$.
    95 It specifies vector $latex x \in B^n$$ 
    96 at which an $codei%AD<%Base%>%$$ version of 
     105It specifies vector $latex x \in B^n$$
     106at which an $codei%AD<%Base%>%$$ version of
    97107$latex y = f(x)$$ is to be evaluated.
    98108
     
    104114Its input size must be equal to $icode m$$ and does not change.
    105115The input values of its elements do not matter.
    106 Upon return, it is an $codei%AD<%Base%>%$$ version of 
     116Upon return, it is an $codei%AD<%Base%>%$$ version of
    107117$latex y = f(x)$$.
     118
     119$head size_var$$
     120This $code size_var$$ member function return value has prototype
     121$codei%
     122        size_t %sv%
     123%$$
     124It is the $cref/size_var/seq_property/size_var/$$ for the
     125$codei%ADFun<%Base%>%$$ object is used to store the operation sequence
     126corresponding to $icode algo$$.
    108127
    109128$head option$$
    110129The $code option$$ syntax can be used to set the type of sparsity
    111 pattern used by $icode afun$$.
     130pattern used by $icode atom_fun$$.
    112131This is an $codei%atomic_base<%Base%>%$$ function and its documentation
    113132can be found at $cref atomic_option$$.
     
    118137$codei%
    119138        %algo%(%ax%, %ay%)
    120 %$$ 
     139%$$
    121140must evaluate the function $latex y = f(x)$$ using
    122141$codei%AD<%Base%>%$$ operations.
    123 In addition, we assume that the 
     142In addition, we assume that the
    124143$cref/operation sequence/glossary/Operation/Sequence/$$
    125144does not depend on the value of $icode ax$$.
    126145
    127 $head afun$$
     146$head atom_fun$$
    128147Given $icode ax$$ it computes the corresponding value of $icode ay$$
    129 using the operation sequence corresponding to $icode algo$$. 
     148using the operation sequence corresponding to $icode algo$$.
    130149If $codei%AD<%Base%>%$$ operations are being recorded,
    131150it enters the computation as single operation in the recording
    132151see $cref/start recording/Independent/Start Recording/$$.
    133 (Currently each use of $icode afun$$ actually corresponds to
    134 $icode%m%+%n%+2%$$ operations and creates $icode m$$ new variables, 
     152(Currently each use of $icode atom_fun$$ actually corresponds to
     153$icode%m%+%n%+2%$$ operations and creates $icode m$$ new variables,
    135154but this is not part of the CppAD specifications and my change.)
    136155
     
    140159This call makes to work space $cref/available/ta_available/$$ to
    141160for other uses by the same thread.
    142 This should be called when you are done using the 
     161This should be called when you are done using the
    143162user atomic functions for a specific value of $icode Base$$.
    144163
     
    163182public:
    164183        /*!
    165         Constructor of a checkpoint object
     184        Constructor of a checkpoint object
    166185
    167186        \param name [in]
     
    179198        */
    180199        template <class Algo, class ADVector>
    181         checkpoint(const char* name, 
     200        checkpoint(const char* name,
    182201                Algo& algo, const ADVector& ax, ADVector& ay)
    183202        : atomic_base<Base>(name)
     
    187206                ADVector x_tmp(ax);
    188207                // delcare x_tmp as the independent variables
    189                 Independent(x_tmp);
     208                Independent(x_tmp);
    190209                // record mapping from x_tmp to ay
    191                 algo(x_tmp, ay); 
     210                algo(x_tmp, ay);
    192211                // create function f_ : x -> y
    193212                f_.Dependent(ay);
     
    202221        }
    203222        /*!
    204         Implement the user call to <tt>afun(ax, ay)</tt>.
    205        
     223        Implement the user call to <tt>atom_fun.size_var()</tt>.
     224        */
     225        size_t size_var(void)
     226        {       return f_.size_var(); }
     227        /*!
     228        Implement the user call to <tt>atom_fun(ax, ay)</tt>.
     229
    206230        \tparam ADVector
    207231        A simple vector class with elements of type <code>AD<Base></code>.
    208        
     232
    209233        \param id
    210234        optional parameter which must be zero if present.
    211        
     235
    212236        \param ax
    213237        is the argument vector for this call,
    214238        <tt>ax.size()</tt> determines the number of arguments.
    215        
     239
    216240        \param ay
    217241        is the result vector for this call,
     
    222246        {       CPPAD_ASSERT_KNOWN(
    223247                        id == 0,
    224                         "checkpoint: id is non-zero in afun(ax, ay, id)"
     248                        "checkpoint: id is non-zero in atom_fun(ax, ay, id)"
    225249                );
    226250                this->atomic_base<Base>::operator()(ax, ay, id);
    227251        }
    228252        /*!
    229         Link from user_atomic to forward mode
     253        Link from user_atomic to forward mode
    230254
    231255        \copydetails atomic_base::forward
    232         */
     256        */
    233257        virtual bool forward(
    234258                size_t                    p ,
    235259                size_t                    q ,
    236                 const vector<bool>&      vx , 
    237                       vector<bool>&      vy , 
     260                const vector<bool>&      vx ,
     261                      vector<bool>&      vy ,
    238262                const vector<Base>&      tx ,
    239263                      vector<Base>&      ty )
     
    244268                size_t n = tx.size() / (q+1);
    245269                size_t m = ty.size() / (q+1);
    246                 bool ok  = true;       
     270                bool ok  = true;
    247271                size_t i, j;
    248272
     
    284308        }
    285309        /*!
    286         Link from user_atomic to reverse mode
     310        Link from user_atomic to reverse mode
    287311
    288312        \copydetails atomic_base::reverse
    289         */
     313        */
    290314        virtual bool reverse(
    291315                size_t                    q  ,
     
    298322                CPPAD_ASSERT_UNKNOWN( tx.size() % (q+1) == 0 );
    299323                CPPAD_ASSERT_UNKNOWN( ty.size() % (q+1) == 0 );
    300                 bool ok  = true;       
     324                bool ok  = true;
    301325
    302326                // put proper forward mode coefficients in f_
     
    329353        }
    330354        /*!
    331         Link from user_atomic to forward sparse Jacobian
     355        Link from user_atomic to forward sparse Jacobian
    332356
    333357        \copydetails atomic_base::for_sparse_jac
    334         */
     358        */
    335359        virtual bool for_sparse_jac(
    336360                size_t                                  q  ,
     
    344368                // (have to reconstruct them every time)
    345369                f_.size_forward_set(0);
    346                
    347                 return ok; 
    348         }
    349         /*!
    350         Link from user_atomic to forward sparse Jacobian
     370
     371                return ok;
     372        }
     373        /*!
     374        Link from user_atomic to forward sparse Jacobian
    351375
    352376        \copydetails atomic_base::for_sparse_jac
    353         */
     377        */
    354378        virtual bool for_sparse_jac(
    355379                size_t                                  q  ,
     
    363387                // (have to reconstruct them every time)
    364388                f_.size_forward_bool(0);
    365                
    366                 return ok; 
    367         }
    368         /*!
    369         Link from user_atomic to forward sparse Jacobian
     389
     390                return ok;
     391        }
     392        /*!
     393        Link from user_atomic to forward sparse Jacobian
    370394
    371395        \copydetails atomic_base::rev_sparse_jac
    372         */
     396        */
    373397        virtual bool rev_sparse_jac(
    374398                size_t                                  q  ,
     
    385409                st = f_.RevSparseJac(q, rt, transpose, nz_compare);
    386410
    387                 return ok; 
    388         }
    389         /*!
    390         Link from user_atomic to forward sparse Jacobian
     411                return ok;
     412        }
     413        /*!
     414        Link from user_atomic to forward sparse Jacobian
    391415
    392416        \copydetails atomic_base::rev_sparse_jac
    393         */
     417        */
    394418        virtual bool rev_sparse_jac(
    395419                size_t                                  q  ,
     
    406430                st = f_.RevSparseJac(q, rt, transpose, nz_compare);
    407431
    408                 return ok; 
    409         }
    410         /*!
    411         Link from user_atomic to forward sparse Jacobian
     432                return ok;
     433        }
     434        /*!
     435        Link from user_atomic to forward sparse Jacobian
    412436
    413437        \copydetails atomic_base::rev_sparse_hes
    414         */
     438        */
    415439        virtual bool rev_sparse_hes(
    416440                const vector<bool>&                     vx ,
     
    437461# endif
    438462
    439                 // V(x) = f'(x)^T * g''(y) * f'(x) * R  +  g'(y) * f''(x) * R 
     463                // V(x) = f'(x)^T * g''(y) * f'(x) * R  +  g'(y) * f''(x) * R
    440464                // U(x) = g''(y) * f'(x) * R
    441465                // S(x) = g'(y)
    442                
     466
    443467                // compute sparsity pattern for A(x) = f'(x)^T * U(x)
    444468                vector< std::set<size_t> > a(n);
     
    474498        }
    475499        /*!
    476         Link from user_atomic to forward sparse Jacobian
     500        Link from user_atomic to forward sparse Jacobian
    477501
    478502        \copydetails atomic_base::rev_sparse_hes
    479         */
     503        */
    480504        virtual bool rev_sparse_hes(
    481505                const vector<bool>&                     vx ,
     
    503527# endif
    504528
    505                 // V(x) = f'(x)^T * g''(y) * f'(x) * R  +  g'(y) * f''(x) * R 
     529                // V(x) = f'(x)^T * g''(y) * f'(x) * R  +  g'(y) * f''(x) * R
    506530                // U(x) = g''(y) * f'(x) * R
    507531                // S(x) = g'(y)
  • trunk/cppad/vector.hpp

    r3705 r3706  
    349349        /// pointer to the first type elements
    350350        /// (not defined and should not be used when capacity_ = 0)
    351         Type   * data_;
     351        Type*  data_;
     352        /// delete data pointer
     353        void delete_data(Type* data)
     354        {       thread_alloc::delete_array(data); }
    352355public:
    353356        /// type of the elements in the vector
     
    362365                /// number of elements in this vector
    363366                size_t n
    364         ) : capacity_(0), length_(n), data_(CPPAD_NULL)
    365         {       if( length_ > 0 )
    366                 {       // set capacity and data
    367                         data_ = thread_alloc::create_array<Type>(length_, capacity_);
    368                 }
    369         }
     367        ) : capacity_(0), length_(0), data_(CPPAD_NULL)
     368        {       resize(n); }
     369
    370370        /// copy constructor
    371371        inline vector(
    372372                /// the *this vector will be a copy of \c x
    373373                const vector& x
    374         ) : capacity_(0), length_(x.length_), data_(CPPAD_NULL)
    375         {       if( length_ > 0 )
    376                 {       // set capacity and data
    377                         data_ = thread_alloc::create_array<Type>(length_, capacity_);
    378 
    379                         // copy values using assignment operator
    380                         size_t i;
    381                         for(i = 0; i < length_; i++)
     374        ) : capacity_(0), length_(0), data_(CPPAD_NULL)
     375        {       resize(x.length_);
     376
     377                // copy the data
     378                for(size_t i = 0; i < length_; i++)
    382379                                data_[i] = x.data_[i];
    383                 }
    384380        }
    385381        /// destructor
    386382        ~vector(void)
    387383        {       if( capacity_ > 0 )
    388                         thread_alloc::delete_array(data_);
     384                        delete_data(data_);
    389385        }
    390386
     
    411407        )
    412408        {       length_ = n;
     409
    413410                // check if we can use current memory
    414411                if( capacity_ >= length_ )
    415412                        return;
     413
    416414                // check if there is old memory to be freed
    417415                if( capacity_ > 0 )
    418                         thread_alloc::delete_array(data_);
     416                        delete_data(data_);
     417
    419418                // get new memory and set capacity
    420419                data_ = thread_alloc::create_array<Type>(length_, capacity_);
     
    426425                // check if there is old memory to be freed
    427426                if( capacity_ > 0 )
    428                         thread_alloc::delete_array(data_);
     427                        delete_data(data_);
    429428                capacity_ = 0;
    430429        }
     
    499498                const Type& s
    500499        )
    501         {       CPPAD_ASSERT_UNKNOWN( length_ <= capacity_ );
    502                 if( length_ + 1 > capacity_ )
    503                 {       // store old capacity and data values
    504                         size_t old_capacity = capacity_;
    505                         Type*  old_data     = data_;
    506                         // set new capacity and data values
    507                         data_ = thread_alloc::create_array<Type>(length_ + 1, capacity_);
    508                         // copy old data values
    509                         size_t i;
    510                         for(i = 0; i < length_; i++)
    511                                 data_[i] = old_data[i];
    512                         // free old data
    513                         if( old_capacity > 0 )
    514                                 thread_alloc::delete_array(old_data);
     500        {       // case where no allocation is necessary
     501                if( length_ + 1 <= capacity_ )
     502                {       data_[length_++] = s;
     503                        return;
    515504                }
    516                 data_[length_++] = s;
     505                CPPAD_ASSERT_UNKNOWN( length_ == capacity_ );
     506
     507                // store old length, capacity and data
     508                size_t old_length   = length_;
     509                size_t old_capacity = capacity_;
     510                Type*  old_data     = data_;
     511
     512                // set the new length, capacity and data
     513                length_   = 0;
     514                capacity_ = 0;
     515                resize(old_length + 1);
     516
     517                // copy old data values
     518                for(size_t i = 0; i < old_length; i++)
     519                        data_[i] = old_data[i];
     520
     521                // put the new element in the vector
     522                CPPAD_ASSERT_UNKNOWN( old_length + 1 <= capacity_ );
     523                data_[old_length] = s;
     524
     525                // free old data
     526                if( old_capacity > 0 )
     527                        delete_data(old_data);
     528
     529                CPPAD_ASSERT_UNKNOWN( old_length + 1 == length_ );
    517530                CPPAD_ASSERT_UNKNOWN( length_ <= capacity_ );
    518531        }
     
    528541        )
    529542        {       CheckSimpleVector<Type, Vector>();
    530                 CPPAD_ASSERT_UNKNOWN( length_ <= capacity_ );
    531543                size_t m = v.size();
    532                 size_t i;
    533                 if( length_ + m > capacity_ )
    534                 {       // store old capacity and data values
    535                         size_t old_capacity = capacity_;
    536                         Type*  old_data     = data_;
    537                         // set new capacity and data values
    538                         data_ = thread_alloc::create_array<Type>(length_ + m, capacity_);
    539                         // copy old data values
    540                         for(i = 0; i < length_; i++)
    541                                 data_[i] = old_data[i];
    542                         // free old data
    543                         if( old_capacity > 0 )
    544                                 thread_alloc::delete_array(old_data);
     544
     545                // case where no allcoation is necessary
     546                if( length_ + m <= capacity_ )
     547                {       for(size_t i = 0; i < m; i++)
     548                                data_[length_++] = v[i];
     549                        return;
    545550                }
    546                 for(i = 0; i < m; i++)
    547                         data_[length_++] = v[i];
     551
     552                // store old length, capacity and data
     553                size_t old_length   = length_;
     554                size_t old_capacity = capacity_;
     555                Type*  old_data     = data_;
     556
     557                // set new length, capacity and data
     558                length_   = 0;
     559                capacity_ = 0;
     560                resize(old_length + m);
     561
     562                // copy old data values
     563                for(size_t i = 0; i < old_length; i++)
     564                        data_[i] = old_data[i];
     565
     566                // put the new elements in the vector
     567                CPPAD_ASSERT_UNKNOWN( old_length + m <= capacity_ );
     568                for(size_t i = 0; i < m; i++)
     569                        data_[old_length + i] = v[i];
     570
     571                // free old data
     572                if( old_capacity > 0 )
     573                        delete_data(old_data);
     574
     575                CPPAD_ASSERT_UNKNOWN( old_length + m  == length_ );
    548576                CPPAD_ASSERT_UNKNOWN( length_ <= capacity_ );
    549577        }
  • trunk/example/atomic/checkpoint.cpp

    r3160 r3706  
    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$section Simple Checkpointing: Example and Test$$
    2121
    22 $index checkpoint, example$$
    23 $index example, checkpoint$$
    24 $index test, checkpoint$$
    25 
    2622$head Purpose$$
    27 Break a large computation into pieces and only store values at the 
     23Break a large computation into pieces and only store values at the
    2824interface of the pieces.
    29 In actual applications, there may be many functions, but 
     25In actual applications, there may be many functions, but
    3026for this example there are only two.
    31 The functions 
    32 $latex F : \B{R}^2 \rightarrow \B{R}^2$$ 
     27The functions
     28$latex F : \B{R}^2 \rightarrow \B{R}^2$$
    3329and
    34 $latex G : \B{R}^2 \rightarrow \B{R}^2$$ 
     30$latex G : \B{R}^2 \rightarrow \B{R}^2$$
    3531defined by
    3632$latex \[
    37         F(x) = \left( \begin{array}{c} 
     33        F(x) = \left( \begin{array}{c}
    3834                x_0 \cdot x_0 \cdot x_0 \cdot x_0 \cdot x_0
    3935                \\
    4036                x_1 \cdot x_1 \cdot x_1 \cdot x_1 \cdot x_1
    41         \end{array} \right) 
     37        \end{array} \right)
    4238        \; , \;
    43         G(y) = \left( \begin{array}{c} 
    44                 y_0 + y_0 + y_0 
    45                 \\ 
    46                 y_1 + y_1 + y_1 
    47         \end{array} \right) 
     39        G(y) = \left( \begin{array}{c}
     40                y_0 + y_0 + y_0
     41                \\
     42                y_1 + y_1 + y_1
     43        \end{array} \right)
    4844\] $$
    4945
     
    9591        for(j = 0; j < n; j++)
    9692                ax[j] = double(j);
    97         checkpoint<double> f_check("f_check", f_algo, ax, ay);
    98         checkpoint<double> g_check("g_check", g_algo, ay, az);
     93        checkpoint<double> atom_f("atom_f", f_algo, ax, ay);
     94        checkpoint<double> atom_g("atom_g", g_algo, ay, az);
    9995
    10096        // Record a version of z = g[f(x)] without checkpointing
     
    106102        // Record a version of z = g[f(x)] with checkpointing
    107103        Independent(ax);
    108         f_check(ax, ay);
    109         g_check(ay, az);
     104        atom_f(ax, ay);
     105        atom_g(ay, az);
    110106        ADFun<double> check_yes(ax, az);
    111107
    112108        // checkpointing should use fewer operations
    113109        ok &= check_yes.size_var() < check_not.size_var();
     110
     111        // this does not really save space becasue f and g are only used once
     112        ok &= check_not.size_var() <=
     113                check_yes.size_var() + atom_f.size_var() + atom_g.size_var();
    114114
    115115        // compare forward mode results for orders 0, 1, 2
     
    143143
    144144        // mix sparsity so test both cases
    145         f_check.option( CppAD::atomic_base<double>::bool_sparsity_enum );
    146         g_check.option( CppAD::atomic_base<double>::set_sparsity_enum );
     145        atom_f.option( CppAD::atomic_base<double>::bool_sparsity_enum );
     146        atom_g.option( CppAD::atomic_base<double>::set_sparsity_enum );
    147147
    148148        // compare forward mode Jacobian sparsity patterns
     
    163163        for(i = 0; i < m; i++)
    164164                ok &= s_not[i] == s_yes[i];
    165        
     165
    166166
    167167        // compare reverse mode Hessian sparsity patterns
    168         CppAD::vector< std::set<size_t> > s_one(1), h_not(n), h_yes(n); 
     168        CppAD::vector< std::set<size_t> > s_one(1), h_not(n), h_yes(n);
    169169        for(i = 0; i < m; i++)
    170170                s_one[0].insert(i);
     
    173173        for(i = 0; i < n; i++)
    174174                ok &= h_not[i] == h_yes[i];
    175        
     175
    176176        return ok;
    177177}
  • trunk/omh/whats_new/whats_new_13.omh

    r3627 r3706  
    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
     
    6565$head 12-29$$
    6666$list number$$
    67 The include file 
     67The include file
    6868$cref cppad_eigen.hpp$$ now automatically includes $code cppad.hpp$$.
    6969$lnext
     
    8181The constructor from an arbitrary type to $codei%AD<%Base%>%$$ was
    8282implicit, but there was no specification to this effect.
    83 The caused problems when using CppAD with 
     83The caused problems when using CppAD with
    8484$cref/eigen 3.2/eigen_prefix/$$ (scheduled to be fixed in 3.3).
    85 The default for this constructor has been changed to be 
     85The default for this constructor has been changed to be
    8686$cref/explicit/ad_ctor/x/explicit/$$.
    87 In addition, other 
     87In addition, other
    8888$cref/implicit/ad_ctor/x/implicit/$$ constructors
    8989are now listed in the documentation.
     
    121121$head 11-27$$
    122122$list number$$
    123 Fix bug when using $cref optimize$$ with an $cref ADFun$$ object containing 
     123Fix bug when using $cref optimize$$ with an $cref ADFun$$ object containing
    124124the $cref sign$$ function.
    125125$lnext
     
    132132$cref atomic_rev_sparse_jac$$ for each atomic function that was
    133133part of an $cref ADFun$$ object that was $cref/optimized/optimize/$$.
    134 Now the current 
     134Now the current
    135135$cref/atomic_sparsity/atomic_option/atomic_sparsity/$$ setting is used
    136136to determine if the $code bool$$ or $code std::set$$ version of
     
    145145
    146146$head 10-29$$
    147 The $cref/optimization/CondExp/Optimize/$$ 
     147The $cref/optimization/CondExp/Optimize/$$
    148148now handles nested conditional expressions.
    149149For example, give the code
     
    163163Fix a bug in the optimization of calls to $cref atomic$$ functions.
    164164This bug existed before recent change to optimizing conditional expressions.
    165 This required adding the 
    166 $cref/nz_compare/RevSparseJac/nz_compare/$$ argument to the 
     165This required adding the
     166$cref/nz_compare/RevSparseJac/nz_compare/$$ argument to the
    167167reverse Jacobian sparsity pattern calculation.
    168168For further details; see sparsity heading under conditional expressions in the
     
    198198The script $cref get_adolc.sh$$ was added
    199199(for downloading and installing
    200 $href%https://projects.coin-or.org/ADOL-C%ADOL-C%$$) in the 
     200$href%https://projects.coin-or.org/ADOL-C%ADOL-C%$$) in the
    201201$code build$$ directory.
    202202Note that this local install of Adolc requires ColPack; see
     
    206206
    207207$head 10-13$$
    208 Make sure that all of the 
     208Make sure that all of the
    209209$cref/preprocessor symbols/cppad/Preprocessor Symbols/$$,
    210210that are not part of the CppAD API, are undefined when the
     
    222222Fix following $code g++$$ error on OSX system:
    223223$codep
    224 error: no match for 'operator|=' (operand types are 
     224error: no match for 'operator|=' (operand types are
    225225'std::vector<bool>::reference {aka std::_Bit_reference}' and 'bool')
    226226    Check[i * n + j] |= F2[i * n + k] & r[ k * n + j];
     
    235235This required adding sub-headings in the example usages
    236236corresponding to the function documentation sections.
    237 For example; see 
     237For example; see
    238238$cref/atomic forward examples/atomic_forward/Examples/$$.
    239239$lnext
     
    247247Add links from the $cref atomic_base$$ functions documentation
    248248to the corresponding examples.
    249 This required adding headings in the examples that 
    250 correspond to the function documentation sections. 
    251 For example; see 
     249This required adding headings in the examples that
     250correspond to the function documentation sections.
     251For example; see
    252252$cref/atomic forward examples/atomic_forward/Examples/$$.
    253253
     
    268268$lnext
    269269There was a bug during the
    270 $cref/checking for nan/check_for_nan/$$ during 
     270$cref/checking for nan/check_for_nan/$$ during
    271271$cref reverse$$ mode.
    272272This has been fixed.
     
    288288for $cref Forward$$ orders greater than zero.
    289289This was detected by the $cref checkpoint$$ tests
    290 when $code optimize$$ was used to make the 
     290when $code optimize$$ was used to make the
    291291checkpoint functions faster.
    292292The bug has been fixed and the checkpoint functions now use
     
    299299$lnext
    300300Use this option to remove the need to handel $code nan$$ as a special
    301 case in $cref checkpoint$$ functions that 
     301case in $cref checkpoint$$ functions that
    302302$cref/atomic functions/optimize/Atomic Functions/$$ in within
    303303another function is optimized.
    304304$lnext
    305 Check $cref/reverse/reverse_any/$$  mode results when 
     305Check $cref/reverse/reverse_any/$$  mode results when
    306306$cref check_for_nan$$ is true.
    307307(It used to be the case that only $cref/forward/forward_order/$$ results
     
    332332$head 05-28$$
    333333Remove $icode ok$$ return flag from
    334 $cref/checkpoint algo/checkpoint/algo/$$ 
     334$cref/checkpoint algo/checkpoint/algo/$$
    335335and
    336 $cref/checkpoint afun/checkpoint/afun/$$.
     336$cref/checkpoint atom_fun/checkpoint/atom_fun/$$.
    337337
    338338$head 05-21$$
     
    368368$lnext
    369369Fix bug in $cref RevSparseJac$$ for case when $cref/q/RevSparseJac/q/$$
    370 was not equal to $icode m$$ (range dimension) and sparsity pattern was a 
     370was not equal to $icode m$$ (range dimension) and sparsity pattern was a
    371371vector of $code bool$$.
    372372$lnext
     
    380380
    381381$head 05-11$$
    382 The $cref/old_atomic examples/old_atomic/Example/$$ 
     382The $cref/old_atomic examples/old_atomic/Example/$$
    383383names were all changed to begin with $code user$$.
    384384
    385385$head 05-04$$
    386 The option to compute 
     386The option to compute
    387387$cref/multiple orders/forward_order/xq/Multiple Orders/$$ was added.
    388388The $cref old_usead_2.cpp$$ example shows the need for this.
     
    394394$list number$$
    395395The scripts $cref get_eigen.sh$$ and $cref get_sacado.sh$$ were added.
    396 If you are using Unix, and you do not have 
     396If you are using Unix, and you do not have
    397397$href%http://eigen.tuxfamily.org%Eigen%$$ or
    398 $href%http://trilinos.sandia.gov/packages/sacado%Sacado%$$ 
    399 installed on your system, you can use the corresponding script 
    400 to download and install a local copy for use when testing CppAD. 
     398$href%http://trilinos.sandia.gov/packages/sacado%Sacado%$$
     399installed on your system, you can use the corresponding script
     400to download and install a local copy for use when testing CppAD.
    401401$lnext
    402402The code $codei%std::cout << %X%$$,
     
    415415        struct significant_decimals_default_impl
    416416$$
    417 because the original template requires definition of a implicit conversion 
     417because the original template requires definition of a implicit conversion
    418418from the scalar type to an $code int$$ and this is dangerous for AD types
    419419(note that $cref Integer$$ is used for explicit conversions).
     
    422422$head 04-26$$
    423423$list number$$
    424 The example $cref old_usead_2.cpp$$ was completed. 
     424The example $cref old_usead_2.cpp$$ was completed.
    425425This is a more realistic, but also more complicated, example of
    426426using AD to computed derivatives inside an atomic function.
    427427$lnext
    428428The script $cref get_fadbad.sh$$ has been added.
    429 If you are using Unix, and you do not have 
     429If you are using Unix, and you do not have
    430430$href%http://www.fadbad.com%FADBAD%$$
    431 installed on your system, you can use this script 
    432 to download and install a local copy for use when testing CppAD. 
     431installed on your system, you can use this script
     432to download and install a local copy for use when testing CppAD.
    433433$lend
    434434
     
    440440$head 04-16$$
    441441The script $cref get_ipopt.sh$$ has been added.
    442 If you are using Unix, and you do not have 
    443 $href%http://www.coin-or.org/projects/Ipopt.xml%Ipopt%$$ 
    444 installed on your system, you can use this script 
    445 to download and install a local copy for use when testing CppAD. 
     442If you are using Unix, and you do not have
     443$href%http://www.coin-or.org/projects/Ipopt.xml%Ipopt%$$
     444installed on your system, you can use this script
     445to download and install a local copy for use when testing CppAD.
    446446
    447447$head 04-14$$
     
    457457        }
    458458$$
    459 It now generates the following message, 
     459It now generates the following message,
    460460(when compiled without $cref/NDEBUG/faq/Speed/NDEBUG/$$)"
    461461$codep
     
    477477
    478478$head 03-01$$
    479 Remove the $cref cmake$$ $code cppad_c11_flag$$ and instead 
     479Remove the $cref cmake$$ $code cppad_c11_flag$$ and instead
    480480automatically detect if the compiler supports specific c++11 features.
    481481
     
    506506$lnext
    507507The $cref limits.cpp$$ example was simplified and restricted to just testing
    508 for $code AD<double>$$. 
     508for $code AD<double>$$.
    509509$lnext
    510510Testing for types other than $code AD<double>$$
     
    516516$head 01-05$$
    517517$list number$$
    518 The $cref limits.cpp$$ example was failing on some machines 
    519 because they were using guard digits during calculations. 
     518The $cref limits.cpp$$ example was failing on some machines
     519because they were using guard digits during calculations.
    520520This has been fixed by using vectors instead of scalars
    521521for storing values.
     
    530530$list number$$
    531531A new stable version of CppAD, for 2013, was created
    532 and its first release $code cppad-20130000.0$$ is available 
     532and its first release $code cppad-20130000.0$$ is available
    533533for download at
    534534$pre
     
    544544$codei%
    545545%...%rev_sparse_jac.hpp:315:9: warning: unused variable 'm' [-Wunused-variable]
    546 %$$ 
     546%$$
    547547This has been fixed.
    548548
  • trunk/omh/whats_new/whats_new_15.omh

    r3705 r3706  
    6161assist you in learning about changes between various versions of CppAD.
    6262
     63$head 08-16$$
     64$list number$$
     65Improve the documentation for checkpoint functions.
     66To be specific, change the $cref/syntax/checkpoint/Syntax/$$ to use
     67the name $icode atom_fun$$.
     68In addition, include the fact that $icode atom_fun$$ must not
     69be destructed for as along as the corresponding atomic operations are used.
     70$lnext
     71Add the $cref/size_var/checkpoint/size_var/$$ function
     72to the checkpoint objects.
     73$lend
     74
     75
    6376$head 08-09$$
    6477Add the preservation of data to the specifications of a $code CppAD::vector$$
Note: See TracChangeset for help on using the changeset viewer.