$Id: check_for_nan.omh 3214 2014-03-18 20:50:38Z bradbell $ /* -------------------------------------------------------------------------- CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell CppAD is distributed under multiple licenses. This distribution is under the terms of the Eclipse Public License Version 1.0. A copy of this license is included in the COPYING file of this distribution. Please visit http://www.coin-or.org/CppAD/ for information on other licenses. -------------------------------------------------------------------------- */ $begin check_for_nan$$ $spell Cpp const bool $$ $section Check an ADFun Object For Nan$$ $index nan, check ADFun$$ $index check, nan in ADFun$$ $index ADFun, check nan$$. $head Syntax$$ $codei%f%.check_for_nan(%b%) %$$ $icode%b% = %f%.check_for_nan() %$$ $head Purpose$$ 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$$, CppAD halts with an error message. This can be suppressed using $code check_for_nan$$. $head f$$ For the syntax where $icode b$$ is an argument, $icode f$$ has prototype $codei% ADFun<%Base%> %f% %$$ (see $codei%ADFun<%Base%>%$$ $cref/constructor/FunConstruct/$$). For the syntax where $icode b$$ is the result, $icode f$$ has prototype $codei% const ADFun<%Base%> %f% %$$ $head b$$ This argument or result has prototype $codei% bool %b% %$$ Future calls to $icode%f%.Forward%$$ will (will not) check for $code nan$$. depending on if $icode b$$ is true (false). $head Default$$ The value for this setting after construction of $icode f$$) is true. The value of this setting is not affected by calling $cref Dependent$$ for this function object. $head Example$$ $children% example/check_for_nan.cpp %$$ The file $cref check_for_nan.cpp$$ contains an example and test of these operations. It returns true if it succeeds and false otherwise. $end