Changeset 3753


Ignore:
Timestamp:
Nov 24, 2015 11:39:04 AM (5 years ago)
Author:
bradbell
Message:

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: 33fdadb9e550612e5ec560e58bf6b832f326328e
end hash code: 4d397fa0c1ba147098a173bdbbca67432066d6e8

commit 4d397fa0c1ba147098a173bdbbca67432066d6e8
Author: Brad Bell <bradbell@…>
Date: Tue Nov 24 08:36:55 2015 -0800

proj_desc.py: automatically sets values in conf/projDesc.xml.

commit 8ad118641ad376acf422c8b2ccfb9d5232fecb2f
Author: Brad Bell <bradbell@…>
Date: Tue Nov 24 03:27:06 2015 -0800

Remove invisible white space.

commit 2c01af4a4f079f289040fa6bfa0a3235fc473fe9
Author: Brad Bell <bradbell@…>
Date: Tue Nov 24 03:26:35 2015 -0800

  1. Add the dependent variable index of first nan to check_for_nan message.
  2. fix pow_int include syntax.
Location:
trunk
Files:
1 added
6 edited

Legend:

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

    r3746 r3753  
    3333%$$
    3434
    35 $head Purpose$$
    36 If $code NDEBUG$$ is not defined and
     35$head Debugging$$
     36If $code NDEBUG$$ is not defined, and
    3737the result of a $cref/forward/forward_order/$$ or $cref/reverse/reverse_any/$$
    3838calculation contains a  $cref nan$$,
     
    6565$cref Dependent$$ for this function object.
    6666
    67 $head Debugging$$
     67$head Error Message$$
    6868If this error is detected during zero order forward mode,
    6969the values of the independent variables that resulted in the $code nan$$
     
    8686that contains the dependent variable values.
    8787
     88$subhead index$$
     89The error message will contain the text
     90$codei%index = %index%$$ followed by the newline character $code '\n'$$.
     91The value of $icode index$$ is the lowest dependent variable index
     92that has the value $code nan$$.
     93
    8894$head get_check_for_nan$$
    8995This routine can be used to get the independent variable
     
    96102%$$
    97103It size must be equal to the corresponding value of
    98 $cref/vector_size/check_for_nan/Debugging/vector_size/$$
     104$cref/vector_size/check_for_nan/Error Message/vector_size/$$
    99105in the corresponding error message.
    100106The input value of its elements does not matter.
     
    112118%$$
    113119It must be the value of
    114 $cref/file_name/check_for_nan/Debugging/file_name/$$
     120$cref/file_name/check_for_nan/Error Message/file_name/$$
    115121in the corresponding error message.
    116 
    117122
    118123$head Example$$
  • trunk/cppad/local/forward.hpp

    r3749 r3753  
    187187        if( check_for_nan_ )
    188188        {       bool ok = true;
     189                size_t index = m;
    189190                if( p == 0 )
    190191                {       for(i = 0; i < m; i++)
    191192                        {       // Visual Studio 2012, CppAD required in front of isnan ?
    192                                 ok &= ! CppAD::isnan( yq[ (q+1) * i + 0 ] );
     193                                if( CppAD::isnan( yq[ (q+1) * i + 0 ] ) )
     194                                {       ok    = false;
     195                                        if( index == m )
     196                                                index = i;
     197                                }
    193198                        }
    194199                }
    195200                if( ! ok )
    196                 {       CppAD::vector<Base> x0(n);
     201                {       CPPAD_ASSERT_UNKNOWN( index < m );
     202                        //
     203                        CppAD::vector<Base> x0(n);
    197204                        for(j = 0; j < n; j++)
    198205                                x0[j] = taylor_[ C * ind_taddr_[j] + 0 ];
     
    205212                        "to binary a file.\n"
    206213                        "vector_size = " << n << "\n" <<
    207                         "file_name = " << file_name << "\n";
     214                        "file_name = " << file_name << "\n" <<
     215                        "index = " << index << "\n";
    208216                        // ss.str() returns a string object with a copy of the current
    209217                        // contents in the stream buffer.
     
    216224                                __LINE__,
    217225                                __FILE__,
    218                                 "! CppAD::isnan( yq[ (q+1) * i + 0 ] )",
     226                                "if( CppAD::isnan( yq[ (q+1) * index + 0 ] )",
    219227                                msg_char_star
    220228                        );
  • trunk/cppad/pow_int.hpp

    r2506 r3753  
    44
    55/* --------------------------------------------------------------------------
    6 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 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
     
    3131
    3232$head Syntax$$
    33 $code # include <cppad/pow_int.h>$$
     33$code # include <cppad/pow_int.hpp>$$
    3434$pre
    3535$$
     
    4040
    4141$head Purpose$$
    42 Determines the value of the power function 
     42Determines the value of the power function
    4343$latex \[
    4444        {\rm pow} (x, y) = x^y
    4545\] $$
    46 for integer exponents $icode n$$ 
     46for integer exponents $icode n$$
    4747using multiplication and possibly division to compute the value.
    48 The other CppAD $cref pow$$ function may use logarithms and exponentiation 
     48The other CppAD $cref pow$$ function may use logarithms and exponentiation
    4949to compute derivatives of the same value
    5050(which will not work if $icode x$$ is less than or equal zero).
     
    5252$head Include$$
    5353The file $code cppad/pow_int.h$$ is included by $code cppad/cppad.hpp$$
    54 but it can also be included separately with out the rest of 
     54but it can also be included separately with out the rest of
    5555the $code CppAD$$ routines.
    5656Including this file defines
     
    6161$codei%
    6262        const %Type%& %x%
    63 %$$ 
     63%$$
    6464
    6565$head y$$
     
    6767$codei%
    6868        const int& %y%
    69 %$$ 
     69%$$
    7070
    7171$head z$$
     
    8181$table
    8282$bold Operation$$  $pre  $$
    83         $cnext $bold Description$$ 
    84         $cnext $bold Result Type$$ 
     83        $cnext $bold Description$$
     84        $cnext $bold Result Type$$
    8585$rnext
    86 $icode%Type% %a%(%i%)%$$ 
     86$icode%Type% %a%(%i%)%$$
    8787        $cnext construction of a $icode Type$$ object from an $code int$$
    8888        $cnext $icode Type$$
    8989$rnext
    90 $icode%a% * %b%$$ 
     90$icode%a% * %b%$$
    9191        $cnext binary multiplication of $icode Type$$ objects
    9292        $cnext $icode Type$$
    9393$rnext
    94 $icode%a% / %b%$$ 
     94$icode%a% / %b%$$
    9595        $cnext binary division of $icode Type$$ objects
    9696        $cnext $icode Type$$
     
    9898
    9999$head Operation Sequence$$
    100 The $icode Type$$ operation sequence used to calculate $icode z$$ is 
     100The $icode Type$$ operation sequence used to calculate $icode z$$ is
    101101$cref/independent/glossary/Operation/Independent/$$
    102102of $icode x$$.
     
    107107%$$
    108108The file $cref pow_int.cpp$$
    109 is an example and test of this function.   
     109is an example and test of this function.
    110110It returns true if it succeeds and false otherwise.
    111111
     
    115115*/
    116116
    117 namespace CppAD { 
     117namespace CppAD {
    118118
    119119        template <class Type>
     
    143143}
    144144
    145 # endif 
     145# endif
  • trunk/example/check_for_nan.cpp

    r3744 r3753  
    7373        }
    7474        catch(std::string msg)
    75         {       // check size of the independent variable vector
     75        {
     76                // get and check size of the independent variable vector
    7677                string pattern = "vector_size = ";
    7778                size_t start   = msg.find(pattern) + pattern.size();
     
    7980                for(size_t i = start; msg[i] != '\n'; i++)
    8081                        number += msg[i];
    81                 size_t vec_size = std::atoi(number.c_str());
    82                 ok &= vec_size == 2;
     82                size_t vector_size = std::atoi(number.c_str());
     83                ok &= vector_size == 2;
     84
     85                // get and check first dependent varialbe index that is nan
     86                pattern = "index = ";
     87                start   = msg.find(pattern) + pattern.size();
     88                number  = "";
     89                for(size_t i = start; msg[i] != '\n'; i++)
     90                        number += msg[i];
     91                size_t index = std::atoi(number.c_str());
     92                ok &= index == 1;
    8393
    8494                // get the name of the file
     
    8999                        file_name += msg[i];
    90100
    91                 // get the independent variable vector that resulted in the nan
    92                 CppAD::vector<double> vec(vec_size);
     101                // get and check independent variable vector that resulted in the nan
     102                CppAD::vector<double> vec(vector_size);
    93103                CppAD::get_check_for_nan(vec, file_name);
    94                 for(size_t i = 0; i < vec_size; i++)
     104                for(size_t i = 0; i < vector_size; i++)
    95105                        ok &= vec[i] == x[i];
    96106        }
  • trunk/omh/deprecated/include_deprecated.omh

    r3627 r3753  
    44
    55CppAD is distributed under multiple licenses. This distribution is under
    6 the terms of the 
     6the terms of the
    77                    Eclipse Public License Version 1.0.
    88
     
    3333
    3434$head Deprecated 2006-12-17$$
    35 The following is a list of deprecated include file names 
    36 and the corresponding names that should be used. 
     35The following is a list of deprecated include file names
     36and the corresponding names that should be used.
    3737For example, if your program uses the deprecated preprocessor command
    3838$codep
     
    5050        # include <CppAD/%name%.h>
    5151%$$
    52 will refer to the older versions of CppAD unless you preform the 
     52will refer to the older versions of CppAD unless you preform the
    5353following steps (this only needs to be done once, not for every install):
    5454$codei%
     
    5757        sudo ln -s cppad CppAD
    5858%$$
    59 where 
     59where
    6060$cref/prefix_dir/auto_tools/prefix_dir/$$
    6161is the prefix directory corresponding to your
     
    6565
    6666$table
    67 $bold Deprecated$$         $pre  $$ $cnext $bold Should Use$$   
     67$bold Deprecated$$         $pre  $$ $cnext $bold Should Use$$
    6868        $pre  $$ $cnext $bold Documentation$$
    6969$rnext
     
    121121$rnext
    122122
     123CppAD/PowInt.h             $pre  $$ $cnext cppad/pow_int.hpp
     124        $pre  $$ $cnext $cref pow_int$$
     125$rnext
     126
    123127CppAD/RombergMul.h         $pre  $$ $cnext cppad/romberg_mul.hpp
    124128        $pre  $$ $cnext $cref RombergMul$$
  • trunk/omh/whats_new/whats_new_15.omh

    r3749 r3753  
    7676assist you in learning about changes between various versions of CppAD.
    7777
     78$head 11-24$$
     79$list number$$
     80The $code check_for_nan$$ output now includes the first dependent
     81variable
     82$cref/index/check_for_nan/Error Message/index/$$
     83that is $code nan$$ in its error message.
     84$lnext
     85Change the
     86$cref/deprecated include/include_deprecated/$$ reference $code pow_int.h$$
     87to $code pow_int.hpp$$ in $cref pow_int$$.
     88$lend
     89
    7890$head 11-14$$
    7991There was a bug in the new
Note: See TracChangeset for help on using the changeset viewer.