Changeset 3724


Ignore:
Timestamp:
Sep 21, 2015 1:04:18 AM (4 years ago)
Author:
bradbell
Message:

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

commit eccf28fdd721e38ba23745ca0c75983db6422b12
Author: Brad Bell <bradbell@…>
Date: Sat Sep 19 12:58:30 2015 -0700

Remove invisible white space.

commit d8220b7cf37a3d33245d3aa78426a1104aaa6bf6
Author: Brad Bell <bradbell@…>
Date: Sat Sep 19 12:58:14 2015 -0700

configure.hpp.in: use C++11 features when available with MS compiler.
time_test.hpp: add missing include file.
base_alloc.hpp: fix numeric limits (found with MS compiler).

commit adc580b3f01919edaf6b19c20e19ad87a75c510e
Author: Brad Bell <bradbell@…>
Date: Sat Sep 19 08:16:03 2015 -0700

Remove invisible white space.

commit 2e84887e84d5981004a384e9815f5870c309c18b
Author: Brad Bell <bradbell@…>
Date: Sat Sep 19 08:15:42 2015 -0700

Fix missing external when using MS compiler without 2011 support.


microsoft_timer.cpp: fix location of this source file.

commit 062e304bd5ff180b0e9e6c3fd36d932d5e2ac065
Author: Brad Bell <bradbell@…>
Date: Sat Sep 19 07:53:56 2015 -0700

Remove invisible white space.

commit 64123e8b0f01fd3849bbe9de7290d251ee5aeabc
Author: Brad Bell <bradbell@…>
Date: Sat Sep 19 07:53:46 2015 -0700

Fix some more MS compiler warnings and delete invisible white space.


nan.cpp: fix MS compiler error (remove code to detect error in old compilers).

commit eb93ab1174c856f88b9f47356ceee6ac9aa2cd01
Author: Brad Bell <bradbell@…>
Date: Sat Sep 19 05:01:41 2015 -0700

Remove invisible white space.

commit 33a72c1856ad4f90bf4ac9293a81c268cba50c29
Author: Brad Bell <bradbell@…>
Date: Sat Sep 19 05:01:25 2015 -0700

Fix some Microsoft compiler warnings.

commit 74ad70b97feb3a401ae1ea0eacfa8558d7602b0c
Author: Brad Bell <bradbell@…>
Date: Thu Sep 17 06:41:23 2015 -0700

  1. fix conditional expressions with AD<adouble>.
  2. Add test case mul_cond.cpp with test_one.sh only (not yet working).

commit 72cabe99430d7562026e7f571c81fa2f1453c21c
Author: Brad Bell <bradbell@…>
Date: Tue Sep 15 07:18:05 2015 -0700

cond_exp.sh: fix tabs.

commit a826150eaca038c76a5a215e05bcecb4e6159ec5
Author: Brad Bell <bradbell@…>
Date: Tue Sep 15 07:09:50 2015 -0700

cond_exp_1.sh: no longer a bug.
cond_exp_2.sh: no longer a bug.
cond_exp.sh: We would like this case to work.

commit 9bb3452eb7daaf57d9da16705cf951d8ed3e0c5a
Author: Brad Bell <bradbell@…>
Date: Mon Sep 14 16:03:11 2015 -0700

master
wish_list.omh: add an item.

commit 50bd0dbae18cc76c0f76ccf7c23d9b64aae30c11
Author: Brad Bell <bradbell@…>
Date: Mon Sep 14 08:54:39 2015 -0700

Remove invisible white space.

commit b833a6bb476fc4f2fb7ea22c243db8a115d87437
Author: Brad Bell <bradbell@…>
Date: Mon Sep 14 08:54:23 2015 -0700

Edit wish list as follows:

  1. Move low priority items to the end
  2. No sub-headings (so easy to sort by priority).
  3. Remove index commands that are now redundant.

commit 3bf661d259eb696cbed9201e090e5ad6fadad57f
Author: Brad Bell <bradbell@…>
Date: Sat Sep 12 22:53:19 2015 -0700

atomic_base.hpp: fix syntax error for old version of C++.

Location:
trunk
Files:
2 added
2 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/cppad/configure.hpp.in

    r3685 r3724  
    4545determined that all the necessary features are avaiable.
    4646*/
    47 # if __cplusplus >= 201100
    48 # define CPPAD_USE_CPLUSPLUS_2011 @cppad_cplusplus_201100_ok@
    49 # else
    50 # define CPPAD_USE_CPLUSPLUS_2011 0
    51 # endif
     47# if     _MSC_VER
     48# define    CPPAD_USE_CPLUSPLUS_2011 @cppad_cplusplus_201100_ok@
     49# else   //
     50# if         __cplusplus >= 201100
     51# define         CPPAD_USE_CPLUSPLUS_2011 @cppad_cplusplus_201100_ok@
     52# else       //
     53# define         CPPAD_USE_CPLUSPLUS_2011 0
     54# endif      //
     55# endif //
    5256
    5357/*!
  • trunk/cppad/example/base_adolc.hpp

    r3685 r3724  
    146146/* $$
    147147
     148$head CondExpRel$$
     149The $cref/CPPAD_COND_EXP_REL/base_cond_exp/CondExpRel/$$ macro invocation
     150$codep */
     151namespace CppAD {
     152        CPPAD_COND_EXP_REL(adouble)
     153}
     154/* $$
     155
    148156$head EqualOpSeq$$
    149157The Adolc user interface does not specify a way to determine if
  • trunk/cppad/example/matrix_mul.hpp

    r3538 r3724  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    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
     
    4747}
    4848//
    49 // matrix result = left * right 
     49// matrix result = left * right
    5050class matrix_mul : public CppAD::atomic_base<double> {
    5151/* $$
     
    7373        n_middle_(n_middle)    ,
    7474        nc_result_(nc_result) ,
    75         n_( nr_result * n_middle + n_middle * nc_result ) 
     75        n_( nr_result * n_middle + n_middle * nc_result )
    7676# ifndef NDEBUG
    77         , m_( n_middle * nc_result ) 
     77        , m_( n_middle * nc_result )
    7878# endif
    7979        { }
     
    8787                size_t j  , // left matrix column index
    8888                size_t k  , // Taylor coeffocient order
    89                 size_t nk ) // number of Taylor coefficients in tx 
     89                size_t nk ) // number of Taylor coefficients in tx
    9090        {       assert( i < nr_result_ );
    9191                assert( j < n_middle_ );
     
    100100                size_t j  , // right matrix column index
    101101                size_t k  , // Taylor coeffocient order
    102                 size_t nk ) // number of Taylor coefficients in tx 
     102                size_t nk ) // number of Taylor coefficients in tx
    103103        {       assert( i < n_middle_  );
    104104                assert( j < nc_result_ );
    105105                size_t offset = nr_result_ * n_middle_;
    106                 return (offset + i * nc_result_ + j) * nk + k; 
     106                return (offset + i * nc_result_ + j) * nk + k;
    107107        }
    108108/* $$
     
    128128                size_t                 k_right , // order for right coefficients
    129129                const vector<double>&  tx      , // domain space Taylor coefficients
    130                       vector<double>&  ty      ) // range space Taylor coefficients 
     130                      vector<double>&  ty      ) // range space Taylor coefficients
    131131        {       size_t nk       = tx.size() / n_;
    132132                assert( nk == ty.size() / m_ );
     
    157157                size_t                 k_right , // order for right coefficients
    158158                const vector<double>&  tx      , // domain space Taylor coefficients
    159                 const vector<double>&  ty      , // range space Taylor coefficients 
     159                const vector<double>&  ty      , // range space Taylor coefficients
    160160                      vector<double>&  px      , // partials w.r.t. tx
    161                 const vector<double>&  py      ) // partials w.r.t. ty 
     161                const vector<double>&  py      ) // partials w.r.t. ty
    162162        {       size_t nk       = tx.size() / n_;
    163163                assert( nk == ty.size() / m_ );
     
    215215                                                // if not multiplying by the constant zero
    216216                                                if( nz_left & nz_right )
    217                                                                 var |= vx[i_left] | vx[i_right];
     217                                                                var |= bool(vx[i_left]) | bool(vx[i_right]);
    218218                                        }
    219219                                        size_t i_result = result(i, j, k, nk);
     
    291291                        {       size_t i_result = result(i, j, k, nk);
    292292                                for(p = 0; p < q; p++)
    293                                         s[i_result * q + p] = false; 
     293                                        s[i_result * q + p] = false;
    294294                                for(size_t ell = 0; ell < n_middle_; ell++)
    295295                                {       size_t i_left  = left(i, ell, k, nk);
    296296                                        size_t i_right = right(ell, j, k, nk);
    297297                                        for(p = 0; p < q; p++)
    298                                         {       s[i_result * q + p] |= r[i_left * q + p ];
    299                                                 s[i_result * q + p] |= r[i_right * q + p ];
     298                                        {       // cast avoids Microsoft warning (should not be needed)
     299                                                s[i_result * q + p] |= bool( r[i_left * q + p ] );
     300                                                s[i_result * q + p] |= bool( r[i_right * q + p ] );
    300301                                        }
    301302                                }
     
    357358                                        size_t i_right = right(ell, j, k, nk);
    358359                                        for(p = 0; p < q; p++)
    359                                         {       st[i_left * q + p] |= rt[i_result * q + p];
    360                                                 st[i_right* q + p] |= rt[i_result * q + p];
     360                                        {       st[i_left * q + p] |= bool( rt[i_result * q + p] );
     361                                                st[i_right* q + p] |= bool( rt[i_result * q + p] );
    361362                                        }
    362363                                }
     
    406407                const vector< std::set<size_t> >&     u ,
    407408                      vector< std::set<size_t> >&     v )
    408         {       size_t n = vx.size();   
     409        {       size_t n = vx.size();
    409410                assert( t.size() == n );
    410411                assert( r.size() == n );
     
    432433                                        // Compute sparsity for T(x) = S(x) * f'(x).
    433434                                        // We need not use vx with f'(x) back propagation.
    434                                         t[i_left]  |= s[i_result];
    435                                         t[i_right] |= s[i_result];
    436 
    437                                         // V(x) = f'(x)^T * U(x) +  S(x) * f''(x) * R 
     435                                        t[i_left]  |= bool( s[i_result] );
     436                                        t[i_right] |= bool( s[i_result] );
     437
     438                                        // V(x) = f'(x)^T * U(x) +  S(x) * f''(x) * R
    438439                                        // U(x) = g''(y) * f'(x) * R
    439440                                        // S(x) = g'(y)
     
    490491                                        // Compute sparsity for T(x) = S(x) * f'(x).
    491492                                        // We so not need to use vx with f'(x) propagation.
    492                                         t[i_left]  |= s[i_result];
    493                                         t[i_right] |= s[i_result];
    494 
    495                                         // V(x) = f'(x)^T * U(x) +  S(x) * f''(x) * R 
     493                                        t[i_left]  |= bool( s[i_result] );
     494                                        t[i_right] |= bool( s[i_result] );
     495
     496                                        // V(x) = f'(x)^T * U(x) +  S(x) * f''(x) * R
    496497                                        // U(x) = g''(y) * f'(x) * R
    497498                                        // S(x) = g'(y)
     
    500501                                        // (no need to use vx with f'(x) propogation)
    501502                                        for(p = 0; p < q; p++)
    502                                         {       v[ i_left  * q + p] |= u[ i_result * q + p];
    503                                                 v[ i_right * q + p] |= u[ i_result * q + p];
     503                                        {       v[ i_left  * q + p] |= bool( u[ i_result * q + p] );
     504                                                v[ i_right * q + p] |= bool( u[ i_result * q + p] );
    504505                                        }
    505506
     
    508509                                        if( s[i_result] & vx[i_left] & vx[i_right] )
    509510                                        {       for(p = 0; p < q; p++)
    510                                                 {       v[i_left * q + p]  |= r[i_right * q + p];
    511                                                         v[i_right * q + p] |= r[i_left * q + p];
     511                                                {       v[i_left * q + p]  |= bool( r[i_right * q + p] );
     512                                                        v[i_right * q + p] |= bool( r[i_left * q + p] );
    512513                                                }
    513514                                        }
  • trunk/cppad/local/atomic_base.hpp

    r3717 r3724  
    3232                pack_sparsity_enum   ,
    3333                bool_sparsity_enum   ,
    34                 set_sparsity_enum    ,
     34                set_sparsity_enum
    3535        };
    3636private:
  • trunk/cppad/local/checkpoint.hpp

    r3719 r3724  
    642642                                        while(j < n )
    643643                                        {       // y[i] depends on the value of x[j]
    644                                                 vy[i] |= vx[j];
     644                                                // cast avoid Microsoft warning (should not be needed)
     645                                                vy[i] |= static_cast<bool>( vx[j] );
    645646                                                j = jac_sparse_set_.next_element();
    646647                                        }
     
    660661                                        {       if( jac_sparse_bool_[ i * n + j ] )
    661662                                                {       // y[i] depends on the value of x[j]
    662                                                         vy[i] |= vx[j];
     663                                                        // cast avoid Microsoft warning
     664                                                        vy[i] |= static_cast<bool>( vx[j] );
    663665                                                }
    664666                                        }
  • trunk/cppad/local/cond_exp.hpp

    r3607 r3724  
    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
     
    4747
    4848$head Purpose$$
    49 Record, 
     49Record,
    5050as part of an AD of $icode Base$$
    5151$cref/operation sequence/glossary/Operation/Sequence/$$,
    52 the conditional result 
     52the conditional result
    5353$codei%
    5454        if( %left% %Cop% %right% )
     
    5656        else    %result% = %if_false%
    5757%$$
    58 The relational $icode Rel$$ and comparison operator $icode Cop$$ 
    59 above have the following correspondence: 
     58The relational $icode Rel$$ and comparison operator $icode Cop$$
     59above have the following correspondence:
    6060$codei%
    6161        %Rel%   Lt   Le   Eq   Ge   Gt
     
    6767in an AD conditional expression is made each time
    6868$cref/f.Forward/Forward/$$ is used to evaluate the zero order Taylor
    69 coefficients with new values for the 
     69coefficients with new values for the
    7070$cref/independent variables/glossary/Tape/Independent Variable/$$.
    7171This is in contrast to the $cref/AD comparison operators/Compare/$$
    72 which are boolean valued and not included in the AD operation sequence. 
     72which are boolean valued and not included in the AD operation sequence.
    7373
    7474$head Rel$$
    7575In the syntax above, the relation $icode Rel$$ represents one of the following
    76 two characters: $code Lt$$, $code Le$$, $code Eq$$, $code Ge$$, $code Gt$$. 
     76two characters: $code Lt$$, $code Le$$, $code Eq$$, $code Ge$$, $code Gt$$.
    7777As in the table above,
    7878$icode Rel$$ determines which comparison operator $icode Cop$$ is used
     
    8484$codei%AD<%Base%>%$$.
    8585(Note that all four arguments must have the same type.)
    86  
     86
    8787$head left$$
    8888The argument $icode left$$ has prototype
     
    9191%$$
    9292It specifies the value for the left side of the comparison operator.
    93  
     93
    9494$head right$$
    9595The argument $icode right$$ has prototype
     
    123123in the following way:
    124124During $cref/zero order forward mode/forward_zero/$$,
    125 once the value of the $icode left$$ and $icode right$$ have been determined, 
     125once the value of the $icode left$$ and $icode right$$ have been determined,
    126126it is known if the true or false case is required.
    127127From this point on, values corresponding to the case that is not required
    128 are not computed. 
     128are not computed.
    129129This optimization is done for the rest of zero order forward mode
    130130as well as forward and reverse derivatives calculations.
    131131There is one exception to this optimization; see
    132 $cref/wish list/WishList/Conditional Expressions/$$.
     132$cref/optimizing nested conditional expressions
     133        /WishList
     134        /Optimizing Nested Conditional Expressions
     135/$$.
    133136
    134137$head Deprecate 2005-08-07$$
    135 Previous versions of CppAD used 
     138Previous versions of CppAD used
    136139$codei%
    137140        CondExp(%flag%, %if_true%, %if_false%)
    138141%$$
    139 for the same meaning as 
     142for the same meaning as
    140143$codei%
    141144        CondExpGt(%flag%, %Type%(0), %if_true%, %if_false%)
     
    159162The file
    160163$cref cond_exp.cpp$$
    161 contains an example and test of this function.   
     164contains an example and test of this function.
    162165It returns true if it succeeds and false otherwise.
    163166
     
    181184AD<Base> CondExpOp(
    182185        enum  CompareOp cop       ,
    183         const AD<Base> &left      , 
    184         const AD<Base> &right     , 
    185         const AD<Base> &if_true   , 
     186        const AD<Base> &left      ,
     187        const AD<Base> &right     ,
     188        const AD<Base> &if_true   ,
    186189        const AD<Base> &if_false  )
    187190{
     
    231234
    232235        // must use CondExp incase Base is an AD type and recording
    233         returnValue.value_ = CondExpOp(cop, 
     236        returnValue.value_ = CondExpOp(cop,
    234237                left.value_, right.value_, if_true.value_, if_false.value_);
    235238
     
    245248
    246249        // add this operation to the tape
    247         if( tape != CPPAD_NULL ) 
    248                 tape->RecordCondExp(cop, 
     250        if( tape != CPPAD_NULL )
     251                tape->RecordCondExp(cop,
    249252                        returnValue, left, right, if_true, if_false);
    250253
     
    288291        else
    289292        {       ind1 += 1;
    290                 ind2 = left.taddr_;     
     293                ind2 = left.taddr_;
    291294        }
    292295
     
    296299        else
    297300        {       ind1 += 2;
    298                 ind3 = right.taddr_;   
     301                ind3 = right.taddr_;
    299302        }
    300303
     
    304307        else
    305308        {       ind1 += 4;
    306                 ind4 = if_true.taddr_; 
     309                ind4 = if_true.taddr_;
    307310        }
    308311
     
    312315        else
    313316        {       ind1 += 8;
    314                 ind5 = if_false.taddr_; 
     317                ind5 = if_false.taddr_;
    315318        }
    316319
     
    347350CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
    348351AD<Base> CondExp(
    349         const AD<Base> &flag      , 
     352        const AD<Base> &flag      ,
    350353        const AD<Base> &if_true   ,
    351354        const AD<Base> &if_false  )
    352 {       
     355{
    353356        return CondExpOp(CompareGt, flag, AD<Base>(0), if_true, if_false);
    354357}
     
    357360} // END CppAD namespace
    358361
    359 # endif 
     362# endif
  • trunk/cppad/local/optimize.hpp

    r3688 r3724  
    180180        /// the comparision in the conditional expression is true (false)
    181181        bool compare(void) const
    182         {       return bool(pack_ % 2); }
     182        {       return pack_ % 2 != 0; }
    183183
    184184        /// This is the index of the conditional expression (in cksip_info)
     
    26352635                        tape[i_var].new_var = rec->PutOp(op);
    26362636                        break;
    2637                         // ---------------------------------------------------
     2637                        // ---------------------------------------------------
    26382638                        // Operations with one argument that is a parameter
    26392639                        case ParOp:
  • trunk/cppad/omp_alloc.hpp

    r2910 r3724  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    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
     
    5252$codei%
    5353        size_t %number%
    54 %$$ 
     54%$$
    5555and must be greater than zero.
    5656
    5757$head set_max_num_threads$$
    58 Informs $cref omp_alloc$$ of the maximum number of OpenMP threads. 
     58Informs $cref omp_alloc$$ of the maximum number of OpenMP threads.
    5959
    6060$head get_max_num_threads$$
     
    6464
    6565$head Restrictions$$
    66 The function $code set_max_num_threads$$ must be called before 
     66The function $code set_max_num_threads$$ must be called before
    6767the program enters $cref/parallel/omp_in_parallel/$$ execution mode.
    6868In addition, this function cannot be called while in parallel mode.
     
    7171*/
    7272        /*!
    73         Inform omp_alloc of the maximum number of OpenMP threads and enable 
     73        Inform omp_alloc of the maximum number of OpenMP threads and enable
    7474        parallel execution mode by initializing all statics in this file.
    7575
     
    8686        Get the current maximum number of OpenMP threads that omp_alloc can use.
    8787
    88         \return 
     88        \return
    8989        maximum number of OpenMP threads.
    9090        */
     
    120120        bool %flag%
    121121%$$
    122 It is true if the current execution is in parallel mode 
     122It is true if the current execution is in parallel mode
    123123(possibly multi-threaded) and false otherwise (sequential mode).
    124124
     
    129129*/
    130130        /// Are we in a parallel execution state; i.e., is it possible that
    131         /// other threads are currently executing. 
     131        /// other threads are currently executing.
    132132        static bool in_parallel(void)
    133133        {
    134134# ifdef _OPENMP
    135                 return static_cast<bool>( omp_in_parallel() );
     135                return omp_in_parallel() != 0;
    136136# else
    137137                return false;
     
    220220%$$
    221221It's input value does not matter.
    222 Upon return, it is the actual number of bytes (capacity) 
     222Upon return, it is the actual number of bytes (capacity)
    223223that have been allocated for use,
    224224$codei%
     
    231231        void* %v_ptr%
    232232%$$
    233 It is the location where the $icode cap_bytes$$ of memory 
     233It is the location where the $icode cap_bytes$$ of memory
    234234that have been allocated for use begins.
    235235
     
    237237This allocation should be faster if the following conditions hold:
    238238$list number$$
    239 The memory allocated by a previous call to $code get_memory$$ 
     239The memory allocated by a previous call to $code get_memory$$
    240240is currently available for use.
    241241$lnext
    242 The current $icode min_bytes$$ is between 
     242The current $icode min_bytes$$ is between
    243243the previous $icode min_bytes$$ and previous $icode cap_bytes$$.
    244244$lend
     
    250250*/
    251251        /*!
    252         Use omp_alloc to get a specified amount of memory.
    253 
    254         If the memory allocated by a previous call to \c get_memory is now 
     252        Use omp_alloc to get a specified amount of memory.
     253
     254        If the memory allocated by a previous call to \c get_memory is now
    255255        avaialable, and \c min_bytes is between its previous value
    256256        and the previous \c cap_bytes, this memory allocation will have
     
    266266        \return
    267267        pointer to the beginning of the memory allocted for use.
    268         */
     268        */
    269269        static void* get_memory(size_t min_bytes, size_t& cap_bytes)
    270270        {       return thread_alloc::get_memory(min_bytes, cap_bytes); }
     
    304304Either the $cref/current thread/omp_get_thread_num/$$ must be the same as during
    305305the corresponding call to $cref omp_get_memory$$,
    306 or the current execution mode must be sequential 
     306or the current execution mode must be sequential
    307307(not $cref/parallel/omp_in_parallel/$$).
    308308
     
    310310If $code NDEBUG$$ is defined, $icode v_ptr$$ is not checked (this is faster).
    311311Otherwise, a list of in use pointers is searched to make sure
    312 that $icode v_ptr$$ is in the list. 
    313 
    314 $head Example$$
    315 $cref omp_alloc.cpp$$
    316 
    317 $end
    318 */
    319         /*!
    320         Return memory that was obtained by \c get_memory.
     312that $icode v_ptr$$ is in the list.
     313
     314$head Example$$
     315$cref omp_alloc.cpp$$
     316
     317$end
     318*/
     319        /*!
     320        Return memory that was obtained by \c get_memory.
    321321        If  <code>max_num_threads(0) == 1</code>,
    322322        the memory is returned to the system.
    323         Otherwise, it is retained by \c omp_alloc and available for use by 
     323        Otherwise, it is retained by \c omp_alloc and available for use by
    324324        \c get_memory for this thread.
    325325
     
    332332        or the current thread must be the same as for the corresponding call
    333333        to \c get_memory.
    334         */
     334        */
    335335        static void return_memory(void* v_ptr)
    336336        {       thread_alloc::return_memory(v_ptr); }
     
    346346$index free_available, omp_alloc$$
    347347$index omp_alloc, free_available$$
    348 Use the function $cref/thread_alloc::free_available/ta_free_available/$$ 
     348Use the function $cref/thread_alloc::free_available/ta_free_available/$$
    349349instead.
    350350
     
    353353
    354354$head Purpose$$
    355 Free memory, currently available for quick use by a specific thread, 
     355Free memory, currently available for quick use by a specific thread,
    356356for general future use.
    357357
     
    362362%$$
    363363Either $cref omp_get_thread_num$$ must be the same as $icode thread$$,
    364 or the current execution mode must be sequential 
     364or the current execution mode must be sequential
    365365(not $cref/parallel/omp_in_parallel/$$).
    366366
     
    375375        \param thread [in]
    376376        this thread that will no longer have any available memory after this call.
    377         This must either be the thread currently executing, or we must be 
     377        This must either be the thread currently executing, or we must be
    378378        in sequential (not parallel) execution mode.
    379379        */
     
    410410%$$
    411411Either $cref omp_get_thread_num$$ must be the same as $icode thread$$,
    412 or the current execution mode must be sequential 
     412or the current execution mode must be sequential
    413413(not $cref/parallel/omp_in_parallel/$$).
    414414
     
    431431        Thread for which we are determining the amount of memory
    432432        (must be < CPPAD_MAX_NUM_THREADS).
    433         Durring parallel execution, this must be the thread 
     433        Durring parallel execution, this must be the thread
    434434        that is currently executing.
    435435
     
    438438        */
    439439        static size_t inuse(size_t thread)
    440         {       return thread_alloc::inuse(thread); } 
     440        {       return thread_alloc::inuse(thread); }
    441441/* -----------------------------------------------------------------------
    442442$begin omp_available$$
     
    468468%$$
    469469Either $cref omp_get_thread_num$$ must be the same as $icode thread$$,
    470 or the current execution mode must be sequential 
     470or the current execution mode must be sequential
    471471(not $cref/parallel/omp_in_parallel/$$).
    472472
     
    489489        */
    490490        static size_t available(size_t thread)
    491         {       return thread_alloc::available(thread); } 
     491        {       return thread_alloc::available(thread); }
    492492/* -----------------------------------------------------------------------
    493493$begin omp_create_array$$
     
    508508
    509509$head Purpose$$
    510 Create a new raw array using $cref omp_alloc$$ a fast memory allocator 
     510Create a new raw array using $cref omp_alloc$$ a fast memory allocator
    511511that works well in a multi-threading OpenMP environment.
    512512
     
    528528%$$
    529529The input value of this argument does not matter.
    530 Upon return, it is the actual number of elements 
    531 in $icode array$$ 
     530Upon return, it is the actual number of elements
     531in $icode array$$
    532532($icode% size_min %<=% size_out%$$).
    533533
     
    538538%$$
    539539It is array with $icode size_out$$ elements.
    540 The default constructor for $icode Type$$ is used to initialize the 
     540The default constructor for $icode Type$$ is used to initialize the
    541541elements of $icode array$$.
    542542Note that $cref omp_delete_array$$
     
    544544
    545545$head Delta$$
    546 The amount of memory $cref omp_inuse$$ by the current thread, 
     546The amount of memory $cref omp_inuse$$ by the current thread,
    547547will increase $icode delta$$ where
    548548$codei%
     
    552552(and the allocation will be faster)
    553553if a previous allocation with $icode size_min$$ between its current value
    554 and $icode size_out$$ is available. 
    555 
    556 $head Example$$
    557 $cref omp_alloc.cpp$$
    558 
    559 $end 
     554and $icode size_out$$ is available.
     555
     556$head Example$$
     557$cref omp_alloc.cpp$$
     558
     559$end
    560560*/
    561561        /*!
     
    573573        \return
    574574        pointer to the first element of the array.
    575         The default constructor is used to initialize 
     575        The default constructor is used to initialize
    576576        all the elements of the array.
    577577
     
    601601
    602602$head Purpose$$
    603 Returns memory corresponding to a raw array 
    604 (create by $cref omp_create_array$$) to the 
     603Returns memory corresponding to a raw array
     604(create by $cref omp_create_array$$) to the
    605605$cref omp_available$$ memory pool for the current thread.
    606606
     
    626626The amount of memory $cref omp_inuse$$ will decrease by $icode delta$$,
    627627and the $cref omp_available$$ memory will increase by $icode delta$$,
    628 where $cref/delta/omp_create_array/Delta/$$ 
     628where $cref/delta/omp_create_array/Delta/$$
    629629is the same as for the corresponding call to $code create_array$$.
    630630
     
    632632$cref omp_alloc.cpp$$
    633633
    634 $end 
     634$end
    635635*/
    636636        /*!
     
    642642        \param array [in]
    643643        A value returned by \c create_array that has not yet been deleted.
    644         The \c Type destructor is used to destroy each of the elements 
     644        The \c Type destructor is used to destroy each of the elements
    645645        of the array.
    646646
     
    675675
    676676$head Purpose$$
    677 Check if memory that is currently in use is an efficient 
     677Check if memory that is currently in use is an efficient
    678678allocation for a specified number of bytes.
    679679
     
    691691        size_t %num_bytes%
    692692%$$
    693 It specifies the number of bytes of the memory allocated by $icode v_ptr$$ 
     693It specifies the number of bytes of the memory allocated by $icode v_ptr$$
    694694that we want to use.
    695695
     
    699699        bool %flag%
    700700%$$
    701 It is true, 
    702 a call to $code get_memory$$ with 
     701It is true,
     702a call to $code get_memory$$ with
    703703$cref/min_bytes/omp_get_memory/min_bytes/$$
    704704equal to $icode num_bytes$$ would result in a value for
     
    711711Either the $cref/current thread/omp_get_thread_num/$$ must be the same as during
    712712the corresponding call to $cref omp_get_memory$$,
    713 or the current execution mode must be sequential 
     713or the current execution mode must be sequential
    714714(not $cref/parallel/omp_in_parallel/$$).
    715715
     
    717717If $code NDEBUG$$ is defined, $icode v_ptr$$ is not checked (this is faster).
    718718Otherwise, a list of in use pointers is searched to make sure
    719 that $icode v_ptr$$ is in the list. 
     719that $icode v_ptr$$ is in the list.
    720720
    721721$end
     
    748748$codei%
    749749        size_t %number%
    750 %$$ 
    751 It must be greater than zero and specifies the maximum number of 
     750%$$
     751It must be greater than zero and specifies the maximum number of
    752752OpenMP threads that will be active at one time.
    753753
    754754$head Restrictions$$
    755 This function must be called before the program enters 
     755This function must be called before the program enters
    756756$cref/parallel/omp_in_parallel/$$ execution mode.
    757757
  • trunk/cppad/time_test.hpp

    r3627 r3724  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
     6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
    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
     
    5353This way individual changes can be tested in the context of the
    5454routine that they are in.
    55 On many machines, accurate timing of a very short execution 
     55On many machines, accurate timing of a very short execution
    5656sequences is not possible.
    5757In addition,
     
    5959we do not really want included in the timing.
    6060For this reason $code time_test$$
    61 automatically determines how many times to 
     61automatically determines how many times to
    6262repeat the section of the test that we wish to time.
    6363
    6464$head Include$$
    65 The file $code cppad/time_test.hpp$$ defines the 
     65The file $code cppad/time_test.hpp$$ defines the
    6666$code time_test$$ function.
    6767This file is included by $code cppad/cppad.hpp$$
    68 and it can also be included separately with out the rest of 
     68and it can also be included separately with out the rest of
    6969the $code CppAD$$ routines.
    7070
     
    7272The $code time_test$$ argument $icode test$$ is a function,
    7373or function object.
    74 In the case where $icode test_size$$ is not present, 
     74In the case where $icode test_size$$ is not present,
    7575$icode test$$ supports the syntax
    7676$codei%
    7777        %test%(%repeat%)
    7878%$$
    79 In the case where $icode test_size$$ is present, 
     79In the case where $icode test_size$$ is present,
    8080$icode test$$ supports the syntax
    8181$codei%
     
    120120$codei%
    121121        double %time%
    122 %$$ 
     122%$$
    123123and is the number of wall clock seconds that it took
    124124to execute $icode test$$ divided by the value used for $icode repeat$$.
     
    140140*/
    141141
     142# include <algorithm>
    142143# include <cstddef>
    143144# include <cmath>
     
    158159\tparam Test
    159160Either the type <code>void (*)(size_t)</code> or a function object
    160 type that supports the same syntax. 
     161type that supports the same syntax.
    161162
    162163\param test
     
    193194\tparam Test
    194195Either the type <code>void (*)(size_t, size_t)</code> or a function object
    195 type that supports the same syntax. 
     196type that supports the same syntax.
    196197
    197198\param test
    198199The function, or function object, that supports the operation
    199 <code>test(size, repeat)</code> where 
     200<code>test(size, repeat)</code> where
    200201\c is the size for this test and
    201202\c repeat is the number of times
  • trunk/example/base_alloc.hpp

    r3685 r3724  
    356356                // machine epsilon
    357357                static base_alloc epsilon(void)
    358                 {       return std::numeric_limits<base_alloc>::epsilon(); }
     358                {       return base_alloc( std::numeric_limits<double>::epsilon() ); }
    359359                // minimum positive normalized value
    360360                static base_alloc min(void)
    361                 {       return std::numeric_limits<base_alloc>::min(); }
     361                {       return base_alloc( std::numeric_limits<double>::min() ); }
    362362                // maximum finite value
    363363                static base_alloc max(void)
    364                 {       return std::numeric_limits<base_alloc>::max(); }
     364                {       return base_alloc( std::numeric_limits<double>::max() ); }
    365365        };
    366366        // deprecated machine epsilon
  • trunk/example/nan.cpp

    r2765 r3724  
    11/* $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
     
    2626$end
    2727*/
    28 
    29 // these definitions will be erased when nan.hpp is included
    30 # ifdef nan
    31 # else
    32 # define nan(z)   Error_if_this_symbol_gets_used
    33 # endif
    34 # ifdef isnan
    35 # else
    36 # define isnan(z) Error_if_this_symbol_gets_used
    37 # endif
    38 
    39 
    4028
    4129// BEGIN C++
  • trunk/multi_thread/bthread/CMakeLists.txt

    r3114 r3724  
    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#
     
    1010# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
    1111# -----------------------------------------------------------------------------
    12 # Build the multi_thread/bthread directory tests 
     12# Build the multi_thread/bthread directory tests
    1313# Inherit environment from ../CMakeList.txt
    1414
    15 # Specifies build type for this directory. Possible values are 
     15# Specifies build type for this directory. Possible values are
    1616# empty, Debug, Release, RelWithDebInfo and MinSizeRel
    1717SET(CMAKE_BUILD_TYPE RELEASE)
     
    2323#                 source1 source2 ... sourceN
    2424# )
    25 ADD_EXECUTABLE(multi_thread_bthread EXCLUDE_FROM_ALL ../thread_test.cpp
     25ADD_EXECUTABLE(multi_thread_bthread EXCLUDE_FROM_ALL ../thread_test.cpp
     26        ../../speed/src/microsoft_timer.cpp
    2627        ../multi_newton_time.cpp
    2728        ../multi_newton.cpp
     
    4748
    4849# Add the check_multi_thread_bthread target
    49 ADD_CUSTOM_TARGET(check_multi_thread_bthread 
    50         multi_thread_bthread simple_ad 
     50ADD_CUSTOM_TARGET(check_multi_thread_bthread
     51        multi_thread_bthread simple_ad
    5152        DEPENDS multi_thread_bthread
    5253)
  • trunk/multi_thread/harmonic_time.cpp

    r2506 r3724  
    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
     
    3737
    3838$head Purpose$$
    39 Runs a correctness and timing test for a multi-threaded 
    40 computation of the summation that defines the harmonic series 
     39Runs a correctness and timing test for a multi-threaded
     40computation of the summation that defines the harmonic series
    4141$latex \[
    4242        1 + 1/2 + 1/3 + ... + 1/n
     
    6161The input value of the argument does not matter.
    6262Upon return it is the number of wall clock seconds required for
    63 to compute the 
     63to compute the
    6464$cref/summation/harmonic_time.cpp/Purpose/$$.
    6565
     
    6767Is the minimum amount of wall clock time that the test should take.
    6868The number of repeats for the test will be increased until this time
    69 is reached. 
     69is reached.
    7070The reported $icode time_out$$ is the total wall clock time divided by the
    7171number of repeats.
     
    8080$codei%
    8181        1 == CppAD::thread_alloc::num_threads()
    82 %$$ 
     82%$$
    8383when $code harmonic_time$$ is called.
    8484If it is non-zero, the test is run with the multi-threading and
    8585$codei%
    8686        %num_threads% = CppAD::thread_alloc::num_threads()
    87 %$$ 
     87%$$
    8888when $code harmonic_time$$ is called.
    8989
     
    9494%$$
    9595and is greater than zero.
    96 The value $latex n$$ in the 
     96The value $latex n$$ in the
    9797$cref/summation/harmonic_time.cpp/Purpose/$$.
    98 is equal to $latex 10^6$$ times $icode mega_sum$$. 
     98is equal to $latex 10^6$$ times $icode mega_sum$$.
    9999
    100100$head Source$$
     
    112112# include <iostream>
    113113# include <cstdlib>
     114# include <algorithm>
    114115
    115116// Note there is no mention of parallel mode in the documentation for
     
    135136                }
    136137                size_t num_sum = mega_sum_ * 1000000;
    137                 bool ok = harmonic(sum_, num_sum, num_threads_); 
     138                bool ok = harmonic(sum_, num_sum, num_threads_);
    138139                if( ! ok )
    139140                {       std::cerr << "harmonic: error" << std::endl;
     
    174175        double check = 0.;
    175176        while(i)
    176                 check += 1. / double(i--); 
     177                check += 1. / double(i--);
    177178        ok &= std::fabs(sum_ - check) <= eps;
    178179
  • trunk/multi_thread/openmp/CMakeLists.txt

    r3114 r3724  
    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#
     
    1010# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
    1111# -----------------------------------------------------------------------------
    12 # Build the multi_thread/openmp directory tests 
     12# Build the multi_thread/openmp directory tests
    1313# Inherit environment from ../CMakeList.txt
    1414
    15 # Specifies build type for this directory. Possible values are 
     15# Specifies build type for this directory. Possible values are
    1616# empty, Debug, Release, RelWithDebInfo and MinSizeRel
    1717SET(CMAKE_BUILD_TYPE RELEASE)
     
    2323# so using ADD_DEFINITIONS instead.
    2424ADD_DEFINITIONS( ${OpenMP_CXX_FLAGS} )
    25  
     25
    2626# add_executable(<name> [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL]
    2727#                 source1 source2 ... sourceN
    2828# )
    29 ADD_EXECUTABLE(multi_thread_openmp EXCLUDE_FROM_ALL ../thread_test.cpp
     29ADD_EXECUTABLE(multi_thread_openmp EXCLUDE_FROM_ALL ../thread_test.cpp
     30        ../../speed/src/microsoft_timer.cpp
    3031        ../multi_newton_time.cpp
    3132        ../multi_newton.cpp
     
    4748
    4849# Add the check_multi_thread_openmp target
    49 ADD_CUSTOM_TARGET(check_multi_thread_openmp 
     50ADD_CUSTOM_TARGET(check_multi_thread_openmp
    5051        multi_thread_openmp simple_ad
    5152        DEPENDS multi_thread_openmp
  • trunk/multi_thread/openmp/a11c_openmp.cpp

    r2506 r3724  
    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
     
    6565        int n_thread = NUMBER_THREADS;   // number of threads in parallel regions
    6666        omp_set_dynamic(0);              // off dynamic thread adjust
    67         omp_set_num_threads(n_thread);   // set the number of threads 
     67        omp_set_num_threads(n_thread);   // set the number of threads
    6868
    6969        a1(n, a, b);
    7070
    7171        // check the result
    72         float eps = 100. * std::numeric_limits<float>::epsilon();
     72        float eps = float(100) * std::numeric_limits<float>::epsilon();
    7373        for(i = 1; i < n ; i++)
    74                 ok &= std::fabs( (2. * b[i] - a[i] - a[i-1]) / b[i] ) <= eps;
     74                ok &= std::fabs( (float(2) * b[i] - a[i] - a[i-1]) / b[i] ) <= eps;
    7575
    7676        delete [] a;
  • trunk/multi_thread/pthread/CMakeLists.txt

    r3617 r3724  
    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#
     
    1010# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
    1111# -----------------------------------------------------------------------------
    12 # Build the multi_thread/pthread directory tests 
     12# Build the multi_thread/pthread directory tests
    1313# Inherit environment from ../CMakeList.txt
    1414
    15 # Specifies build type for this directory. Possible values are 
     15# Specifies build type for this directory. Possible values are
    1616# empty, Debug, Release, RelWithDebInfo and MinSizeRel
    1717SET(CMAKE_BUILD_TYPE DEBUG)
     
    2323#                 source1 source2 ... sourceN
    2424# )
    25 ADD_EXECUTABLE(multi_thread_pthread EXCLUDE_FROM_ALL ../thread_test.cpp
     25ADD_EXECUTABLE(multi_thread_pthread EXCLUDE_FROM_ALL ../thread_test.cpp
     26        ../../speed/src/microsoft_timer.cpp
    2627        ../multi_newton_time.cpp
    2728        ../multi_newton.cpp
     
    4748
    4849# Add the check_multi_thread_pthread target
    49 ADD_CUSTOM_TARGET(check_multi_thread_pthread 
    50         multi_thread_pthread simple_ad 
     50ADD_CUSTOM_TARGET(check_multi_thread_pthread
     51        multi_thread_pthread simple_ad
    5152        DEPENDS multi_thread_pthread
    5253)
  • trunk/omh/whats_new/whats_new_07.omh

    r3686 r3724  
    901901
    902902$subhead 02-17$$
    903 An entry about $cref/optimizing/WishList/Optimization/$$ the operation
    904 sequence in an $cref/ADFun/FunConstruct/$$ object was added.
     903An entry about optimizing the operation
     904sequence in an $cref/ADFun/FunConstruct/$$ object was added to the
     905$cref WishList$$.
    905906$pre
    906907
  • trunk/omh/whats_new/whats_new_08.omh

    r3686 r3724  
    396396Remove computed assignment entry from wish list
    397397(it was fixed on $cref/2007-05-26/whats_new_07/05-26/$$).
    398 Add
    399 $cref/expression hashing/WishList/Optimization/Expression Hashing/$$
    400 to the wish list.
     398Add an expression hashing entry to the $cref WishList$$
     399(it has since been removed).
    401400Add Library and Scripting Languages to the wish list
    402401(this has since been fulfilled by the example $cref ad_in_c.cpp$$).
  • trunk/omh/whats_new/whats_new_13.omh

    r3710 r3724  
    157157For more details, see
    158158$cref/nesting conditional expressions/
    159 WishList/Conditional Expressions/Nesting/$$
     159WishList/Optimizing Nested Conditional Expressions/$$.
    160160
    161161$head 10-23$$
  • trunk/omh/whats_new/whats_new_15.omh

    r3721 r3724  
    5454        bool
    5555        alloc
     56        adouble
    5657$$
    5758
     
    6364The purpose of this section is to
    6465assist you in learning about changes between various versions of CppAD.
     66
     67$head 09-19$$
     68$list number$$
     69There was a bug in the $cref/numeric_limits/base_alloc.hpp/limits/$$
     70section of the example user defined base type.
     71This has been fixed.
     72$lnext
     73There were some compile and link errors when
     74running the tests using Visual Studio 2013.
     75These have been fixed.
     76$lnext
     77Many of the warnings generated by Visual Studio 2013 have been fixed.
     78$lend
     79
     80$head 09-16$$
     81The conditional expressions, $cref CondExp$$, were not working
     82for the type $code< CppAD::AD<adouble> >$$ where $code adouble$$
     83is the ADOL-C AD type.
     84This has been fixed by adding a call to
     85$cref/CPPAD_COND_EXP_REL/base_adolc.hpp/CondExpRel/$$ in
     86$code base_adolc.hpp$$.
    6587
    6688$head 09-03$$
     
    517539and was not even defined when $code NDEBUG$$ was defined.
    518540There was a resulting speed effect for this; see the wish list
    519 $cref/compare change/WishList/Optimization/Comparison Changes/$$ entry.
     541$cref/compare change/WishList/Comparison Changes and Optimization/$$ entry.
    520542
    521543$lnext
  • trunk/omh/wish_list.omh

    r3718 r3724  
    4444$section The CppAD Wish List$$
    4545
     46$head Optimize Atomic Operations$$
     47Use the current $cref atomic_option$$ setting to determine
     48which type of sparsity patterns to use for
     49$cref/dependency/dependency.cpp/$$ calculations during
     50$cref optimize$$ procedure.
     51In addition, use forward mode, instead of reverse, when it is more efficient
     52for the dependency calculations.
     53
    4654$head checkpoint$$
    4755There should be some examples and tests for both speed and memory use
     
    8593see $cref sqrt.cpp$$.
    8694
    87 $head atan2$$
    88 The $cref/atan2/Atan2/$$ function could be made faster by adding
    89 a special operator for it.
    90 
    9195$head Adolc$$
    9296Create a documentation page that shows how to convert Adolc commands to
    9397CppAD commands.
    9498
    95 $head BenderQuad$$
    96 See the $cref/problem/BenderQuad/Problem/$$ with the
    97 current $code BenderQuad$$ specifications.
    98 
    99 $head Conditional Expressions$$
    100 
    101 $subhead Nesting$$
     99$head Optimizing Nested Conditional Expressions$$
    102100If one $cref/optimizes/optimize/$$ the code
    103101$codep
     
    133131$lend
    134132
    135 $head Library$$
    136 $index compile, speed AD<double>$$
    137 $index speed, compile AD<double>$$
    138 $index AD<double>, compile speed$$
     133$head Compilation Speed$$
    139134One could build a CppAD library for use with the type $code AD<double>$$.
    140135This would speed up compilation for the most common usage where
     
    151146$cref seq_property$$.
    152147
    153 $head Optimization$$
    154 
    155 $subhead Comparison Changes$$
     148$head Comparison Changes and Optimization$$
    156149The comparison operators used to not be taped when
    157150$cref/NDEBUG/Faq/Speed/NDEBUG/$$ was defined.
     
    162155Perhaps there should be an option to skip the comparison taping.
    163156
    164 $subhead Expression Hashing$$
    165 During expression sequence $cref/optimization/optimize/$$,
    166 hash codes are used to detect expressions that have already
    167 been computed.
    168 Perhaps this should be done during the original forward mode recording.
    169 
    170 $subhead Variable Pairs$$
    171 Suppose that $icode x$$ is a variable
    172 and $codei%sin(%x%)%$$ is used in an expression.
    173 The extra expression $codei%cos(%x%)%$$ is also computed
    174 during a $cref Forward$$ calculation.
    175 This is because the derivative of the original expression
    176 is expressed in terms of the values of the other expression.
    177 In general,
    178 the representation of the derivative of an expression to order $icode p$$
    179 may include the derivative of another expression to order $icode%p%-1%$$.
    180 In our example, if only the value $codei%sin(%x%)%$$
    181 is requested, it is not necessary to compute $codei%cos(%x%)%$$.
    182 We should remove the computation of extra expressions derivatives that are
    183 not need to compute the requested derivative of the original expression.
    184 
    185157$head Preprocessor Symbols$$
    186 $index preprocessor$$
    187158Make sure all the user API preprocessor symbols are listed in
    188159the $cref preprocessor$$ section.
    189160
    190161$head Software Guidelines$$
    191 
    192 $subhead Boost$$
    193162The following is a list of some software guidelines taken from
    194163$href%http://www.boost.org/development/requirements.html#Guidelines%boost%$$.
     
    220189
    221190$head Tracing$$
    222 $index operation, sequence tracing$$
    223 $index sequence, operation tracing$$
    224 $index tracing, operation sequence$$
    225191Add tracing the operation sequence to the user API and documentation.
    226192Tracing the operation sequence is currently done by changing the CppAD
     
    231197to find all the possible tracing flags.
    232198
     199
     200$head atan2$$
     201The $cref/atan2/Atan2/$$ function could be made faster by adding
     202a special operator for it.
     203
     204
     205$head BenderQuad$$
     206See the $cref/problem/BenderQuad/Problem/$$ with the
     207current $code BenderQuad$$ specifications.
     208
    233209$end
  • trunk/speed/src/microsoft_timer.cpp

    r3223 r3724  
    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
     
    1515        Microsoft
    1616        cpp
     17        src
    1718$$
    1819
     
    2526$head Purpose$$
    2627This routine is accurate to within .02 seconds
    27 (see $cref elapsed_seconds$$ which uses this routine when 
     28(see $cref elapsed_seconds$$ which uses this routine when
    2829the preprocessor symbol $code _MSC_VER$$ is defined).
    2930It does not necessary work for time intervals that are greater than a day.
     
    3132
    3233$head s$$
    33 is a $code double$$ equal to the 
     34is a $code double$$ equal to the
    3435number of seconds since the first call to $code microsoft_timer$$.
    3536
    3637$head Linking$$
    37 The source code for this routine is located in 
    38 $code speed/microsoft_timer.cpp$$.
     38The source code for this routine is located in
     39$code speed/src/microsoft_timer.cpp$$.
    3940The preprocessor symbol $code _MSC_VER$$ must
    4041be defined, or this routine is not compiled.
  • trunk/test_more/optimize.cpp

    r3685 r3724  
    2929        // ----------------------------------------------------------------
    3030        // Test nested conditional expressions.
    31         int nested_cond_exp(void)
     31        bool nested_cond_exp(void)
    3232        {       bool ok = true;
    3333                using CppAD::AD;
     
    16901690        {       Type res = arg[0];
    16911691                for(size_t j = 0;j < arg.size(); j++)
    1692                 res = CondExpGt(res, arg[j], res, arg[j]);
     1692                res = CondExpGt(res, arg[j], res, arg[j]);
    16931693                return res;
    1694         }
     1694        }
    16951695        bool cond_exp_reverse(void)
    16961696        {       bool ok = true;
  • trunk/test_more/test_more.cpp

    r3689 r3724  
    6767extern bool Mul(void);
    6868extern bool mul_level(void);
     69extern bool mul_cond(void);
    6970extern bool mul_cskip(void);
    7071extern bool MulEq(void);
Note: See TracChangeset for help on using the changeset viewer.