# Changeset 3753

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

merge to branch: trunk
end hash code: 4d397fa0c1ba147098a173bdbbca67432066d6e8

commit 4d397fa0c1ba147098a173bdbbca67432066d6e8
Date: Tue Nov 24 08:36:55 2015 -0800

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

Date: Tue Nov 24 03:27:06 2015 -0800

Remove invisible white space.

commit 2c01af4a4f079f289040fa6bfa0a3235fc473fe9
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:
6 edited

Unmodified
 r3746 %$$head Purpose$$ If $code NDEBUG$$is not defined and head Debugging$$ If$code NDEBUG$$is not defined, and the result of a cref/forward/forward_order/$$ or $cref/reverse/reverse_any/$$calculation contains a cref nan$$,$cref Dependent$$for this function object. head Debugging$$ $head Error Message$$If this error is detected during zero order forward mode, the values of the independent variables that resulted in the code nan$$ that contains the dependent variable values.$subhead index$$The error message will contain the text codei%index = %index%$$ followed by the newline character $code '\n'$$. The value of icode index$$ is the lowest dependent variable index that has the value$code nan$$. head get_check_for_nan$$ This routine can be used to get the independent variable %$$It size must be equal to the corresponding value of cref/vector_size/check_for_nan/Debugging/vector_size/$$ $cref/vector_size/check_for_nan/Error Message/vector_size/$$in the corresponding error message. The input value of its elements does not matter. %$$ It must be the value of$cref/file_name/check_for_nan/Debugging/file_name/$$cref/file_name/check_for_nan/Error Message/file_name/$$ in the corresponding error message. $head Example$$• ## trunk/cppad/local/forward.hpp  r3749 if( check_for_nan_ ) { bool ok = true; size_t index = m; if( p == 0 ) { for(i = 0; i < m; i++) { // Visual Studio 2012, CppAD required in front of isnan ? ok &= ! CppAD::isnan( yq[ (q+1) * i + 0 ] ); if( CppAD::isnan( yq[ (q+1) * i + 0 ] ) ) { ok = false; if( index == m ) index = i; } } } if( ! ok ) { CppAD::vector x0(n); { CPPAD_ASSERT_UNKNOWN( index < m ); // CppAD::vector x0(n); for(j = 0; j < n; j++) x0[j] = taylor_[ C * ind_taddr_[j] + 0 ]; "to binary a file.\n" "vector_size = " << n << "\n" << "file_name = " << file_name << "\n"; "file_name = " << file_name << "\n" << "index = " << index << "\n"; // ss.str() returns a string object with a copy of the current // contents in the stream buffer. __LINE__, __FILE__, "! CppAD::isnan( yq[ (q+1) * i + 0 ] )", "if( CppAD::isnan( yq[ (q+1) * index + 0 ] )", msg_char_star ); • ## trunk/cppad/pow_int.hpp  r2506 /* -------------------------------------------------------------------------- CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 Bradley M. Bell CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell CppAD is distributed under multiple licenses. This distribution is under the terms of the the terms of the Eclipse Public License Version 1.0. head Syntax$$$code # include $$code # include$$ $pre $$head Purpose$$ Determines the value of the power function Determines the value of the power function$latex ${\rm pow} (x, y) = x^y$ $$for integer exponents icode n$$ for integer exponents $icode n$$using multiplication and possibly division to compute the value. The other CppAD cref pow$$ function may use logarithms and exponentiation The other CppAD$cref pow$$function may use logarithms and exponentiation to compute derivatives of the same value (which will not work if icode x$$ is less than or equal zero). $head Include$$The file code cppad/pow_int.h$$ is included by$code cppad/cppad.hpp$$but it can also be included separately with out the rest of but it can also be included separately with out the rest of the code CppAD$$ routines. Including this file defines $codei% const %Type%& %x% %$$%$$$head y$$codei% const int& %y% %$$ %$$head z$$ $table$bold Operation$$pre$$ $cnext$bold Description$$cnext bold Result Type$$ $cnext$bold Description$$cnext bold Result Type$$ $rnext$icode%Type% %a%(%i%)%$$icode%Type% %a%(%i%)%$$ $cnext construction of a$icode Type$$object from an code int$$ $cnext$icode Type$$rnext icode%a% * %b%$$ $icode%a% * %b%$$cnext binary multiplication of icode Type$$ objects$cnext $icode Type$$rnext icode%a% / %b%$$$icode%a% / %b%$$cnext binary division of icode Type$$ objects $cnext$icode Type$$head Operation Sequence$$ The $icode Type$$operation sequence used to calculate icode z$$ is The$icode Type$$operation sequence used to calculate icode z$$ is $cref/independent/glossary/Operation/Independent/$$of icode x$$. %$$The file cref pow_int.cpp$$ is an example and test of this function. is an example and test of this function. It returns true if it succeeds and false otherwise. */ namespace CppAD { namespace CppAD { template } # endif # endif • ## trunk/example/check_for_nan.cpp  r3744 } catch(std::string msg) { // check size of the independent variable vector { // get and check size of the independent variable vector string pattern = "vector_size = "; size_t start = msg.find(pattern) + pattern.size(); for(size_t i = start; msg[i] != '\n'; i++) number += msg[i]; size_t vec_size = std::atoi(number.c_str()); ok &= vec_size == 2; size_t vector_size = std::atoi(number.c_str()); ok &= vector_size == 2; // get and check first dependent varialbe index that is nan pattern = "index = "; start = msg.find(pattern) + pattern.size(); number = ""; for(size_t i = start; msg[i] != '\n'; i++) number += msg[i]; size_t index = std::atoi(number.c_str()); ok &= index == 1; // get the name of the file file_name += msg[i]; // get the independent variable vector that resulted in the nan CppAD::vector vec(vec_size); // get and check independent variable vector that resulted in the nan CppAD::vector vec(vector_size); CppAD::get_check_for_nan(vec, file_name); for(size_t i = 0; i < vec_size; i++) for(size_t i = 0; i < vector_size; i++) ok &= vec[i] == x[i]; } • ## trunk/omh/deprecated/include_deprecated.omh  r3627 CppAD is distributed under multiple licenses. This distribution is under the terms of the the terms of the Eclipse Public License Version 1.0.$head Deprecated 2006-12-17$$The following is a list of deprecated include file names and the corresponding names that should be used. The following is a list of deprecated include file names and the corresponding names that should be used. For example, if your program uses the deprecated preprocessor command codep # include %$$ will refer to the older versions of CppAD unless you preform the will refer to the older versions of CppAD unless you preform the following steps (this only needs to be done once, not for every install): $codei% sudo ln -s cppad CppAD %$$where where cref/prefix_dir/auto_tools/prefix_dir/$$ is the prefix directory corresponding to your$table $bold Deprecated$$pre$$$cnext $bold Should Use$$bold Deprecated$$$pre  $$cnext bold Should Use$$ $pre $$cnext bold Documentation$$$rnext $rnext CppAD/PowInt.h$pre  $$cnext cppad/pow_int.hpp pre$$ $cnext$cref pow_int$$rnext CppAD/RombergMul.h pre$$ $cnext cppad/romberg_mul.hpp$pre  $$cnext cref RombergMul$$
 r3749 assist you in learning about changes between various versions of CppAD. $head 11-24$$list number$$ The$code check_for_nan$$output now includes the first dependent variable cref/index/check_for_nan/Error Message/index/$$ that is $code nan$$in its error message. lnext Change the cref/deprecated include/include_deprecated/$$ reference$code pow_int.h$$to code pow_int.hpp$$ in \$cref pow_int$$. lend head 11-14$$ There was a bug in the new