
Le mercredi 07 décembre 2005 à 11:21 -0500, David Abrahams a écrit :
The static functions empty and whole produce the corresponding intervals.
"Produce the corresponding intervals" is almost content-free. It's pretty easy to guess what the empty interval must be ([0,0] I presume), but to someone not already versed in interval arithmetic, guessing at the meaning of "whole" is a lot harder. What does that mean?
Because intervals are subsets of a given set, that is not as content-free as you seem to think. The documentation means that empty() generates the empty subset and whole() generates the subset that is the whole set. Maybe the documentation should stress that something empty does not contain any element and that the whole set contains all the elements. In particular, [0,0] is not empty since it contains 0. If you want to express these intervals as pair of bounds [l,u], for the empty subset there must be no x such that l <= x <= u (by having !(l <= u) for example), and for the whole set, any x must verify l <= x <= u (by having l = -infinity and u = +infinity for example). But these representations are implementation-defined, and for an UDT they may even be user-defined. This is why the representations are not directly described in the documentation. Best regards, Guillaume