[CppAD] signal for domain violation errors

Brad Bell bradbell at seanet.com
Wed Mar 11 11:35:43 EDT 2009


Brad Bell wrote:
> CppAD detects certain usage erros and error from an unknow source and 
> calls an error handler when this happens. You can replace the error 
> handler with your own; see
>    http://www.coin-or.org/CppAD/Doc/errorhandler.xml
>
> As for nans and inf, CppAD does not control if an exception is thrown 
> or not. In other words, if you do not specify that an exception should 
> be thrown on nan, CppAD will just compute away and the results may 
> have nan of inf in them. Note that the C++ standard allows for a 
> compiler to have a signalling nan, but it is not required to have one. 
> See section
>    18.2.1.1 Template class numeric_limits
> of the standard where the following values appear
>    static const bool has_quiet_NaN;
>    static const bool has_signaling_NaN;
>
>
> Stefan Vigerske wrote:
>> Hi,
>>
>> how does CppAD signal when there was an evaluation error, i.e., a
>> function or its derivative is not defined at the point where it is
>> evaluated.
>> E.g., when I have a sqrt(x), I first evaluate it with x=1 and let CppAD
>> record this.
>> What happens when I do forward sweep to evaluate this function at x=-1?
>>
>> Or what happens when I evaluate at x=0 and then ask for the Jacobian at
>> the same point?
>>
>> Do I need to check the results for nan's and inf's or is there an
>> exception thrown? In the former case, will such a check always work also
>> when compiled in optimized mode (some compilers seem to be not exact on
>> this in optimized mode, e.g., when -mp is used with intel compilers)?
>>
>> Thanks,
>> Stefan
>>
>>   
>
>



More information about the CppAD mailing list