[std-interval] Reply to Steve C.: More on exceptions versus flags

R. Baker Kearfott rbk at louisiana.edu
Sun Oct 8 11:35:54 PDT 2006

At 08:20 AM 10/8/2006 -0700, Steve Clamage wrote:
>Sylvain Pion wrote:
>> Steve Clamage wrote:
>>>  >>Dr John Pryce <j.d.pryce at ntlworld.com> writes:
>>>  >
>>>  > Throwing exceptions was shot down for speed and
>>>  > stack-destroying reasons, ...
>>> I don't see how that situation differs from the solution using a 
>>> global flag. The stack frames between the point of error and the point 
>>> where you check the flag are still lost.
>> I don't follow.  Affecting a value to a global flag does not destroy
>> anything.  Maybe considering examples would make things clearer:
>> interval f(interval a, interval b, interval c, interval d)
>> {
>>   return sqrt(a+b) + sqrt(c+d);
>> }
>> If sqrt() throws, then I cannot get the return value of f.
>OK, I see. You don't object to the stack-destroying property, you object 
>to the possible need to have try-catch blocks throughout the code.
>If sqrt did not throw an exception to report an error, I suppose it 
>would return some Interval equivalent of NaN. For sake of argument, 
>let's call it "iNaN", since I believe this point is still under discussion.

Others, please correct me if I have missed the point or the relevant
portion of the proposed standard, but I don't think the interval
"exceptions" would be the same as a "NaN".  To refocus, let's consider
the case:


In many instances (e.g. in some contexts in constraint propagation), it
is appropriate to return [0,1], while in others, the fact that part of
the argument is out of domain needs to be noted.  My understanding is
that throwing an exception in the first case may be too inefficient.

Thus, the result isn't simply a "NaN."  

A similar situation occurs with 1/[-1,2], etc.

My understanding is that interval constraint propagation is used
increasingly in such important applications as commercial
supply chain software.  Cases where the out of domain condition needs
to be noted deal with automatic theorem proving, as well as in certain
places in global optimization codes.



R. Baker Kearfott,    rbk at louisiana.edu   (337) 482-5346 (fax)
(337) 482-5270 (work)                     (337) 993-1827 (home)
URL: http://interval.louisiana.edu/kearfott.html
Department of Mathematics, University of Louisiana at Lafayette
(Room 217 Maxim D. Doucet Hall, 1403 Johnston Street)
Box 4-1010, Lafayette, LA 70504-1010, USA

More information about the Std-interval mailing list