diff --git a/doc/checking.htm b/doc/checking.htm index c8af504..307c76a 100644 --- a/doc/checking.htm +++ b/doc/checking.htm @@ -22,10 +22,10 @@

Checking policies

is a NaN). What to do in such a case? First, we could say that the second argument can never be an invalid number. Second, we could also say such a situation can arise but is forbidden. Third, we could allow such values and - generate an empty interval when encountered. And there is many other + generate an empty interval when encountered. And there are many other possibilities.

-

It is the reason why such a policy is used: there is a lot of +

It is the reason why such a policy is used: there are a lot of interesting behaviors and it would be sad to arbitrarily select one of these.

@@ -56,19 +56,19 @@

Requirements

value, such a value can be used.

Next comes nan. This function is used each time a function - need to return a value of type T but is unable to compute it. + needs to return a value of type T but is unable to compute it. It only happens when one of the arguments of the function is invalid. For example, if you ask what the median value of an empty interval is, nan will be used. But please remember: lower and upper directly return the value stocked in the interval; so, if the interval is empty, lower will not answer by a call to checking::nan (but will return the - same value than checking::empty_lower could return).

+ same value as checking::empty_lower could return).

empty_lower and empty_upper respectively return the lower and upper bound of the empty interval. There is no - requirements for empty_lower and empty_upper to - return the same value than checking::nan. For example, if the + requirement for empty_lower and empty_upper to + return the same value as checking::nan. For example, if the type T does not have any invalid value, the empty_ functions can return the [1;0] interval.

@@ -76,7 +76,7 @@

Requirements

invalid or not. is_empty tests if the interval formed by the two arguments is empty or not. Such tests will generally be at the beginning of each function which involves an argument of type - T. If one of the inputs is declared invalid, the the function + T. If one of the inputs is declared invalid, the function will try to produce an invalid value or an input interval.

Synopsis

@@ -115,10 +115,10 @@

Predefined classes

empty_upper; and a basic test is used for is_nan (it is x!=x). If T does not have quiet NaNs, then nan is an assert(false), the empty interval is - [1,0], and is_nan always return false. As for + [1,0], and is_nan always returns false. As for nan, pos_inf returns numeric_limits::infinity() if possible, or is an - assert(false) otherwise. neg_inf returns the + assert(false) otherwise. neg_inf returns the opposite. Finally, is_empty(T l,T u) is always defined by !(l<=u).

@@ -171,7 +171,7 @@

Customizing your own checking policy

the conversion at the first encountered problem. So empty_lower and empty_upper need to return suitable values in order to define an empty interval (you can use an upper - bound which is not greater or equal than the lower bound for example); and + bound which is not greater or equal to the lower bound for example); and is_empty must be able to distinguish empty intervals from the valid intervals.

@@ -227,7 +227,7 @@

Some examples

  • If you do not mind having undefined results when an empty interval or an interval number is produced, your best bet is to create your own policy by overloading checking_base and modifying - is_nan et is_empty in order for them to always + is_nan and is_empty in order for them to always return false. It is probably the fastest checking policy available; however, it suffers from its deficient security.
  • diff --git a/doc/comparisons.htm b/doc/comparisons.htm index e084d7b..ff6c4e3 100644 --- a/doc/comparisons.htm +++ b/doc/comparisons.htm @@ -14,14 +14,14 @@

    Comparisons

    As was said before, the definition of the comparison operators induces a - slight problem. There are many ways to define them, depending of the return + slight problem. There are many ways to define them, depending on the return type or the expected order. It is the reason why the meaning of the operators is not fixed once and for all.

    The way the operators are defined could have been influenced by a policy, as it is already the case for the rounding and the checking. - However, comparisons are more an external property of the the class rather - than an internal one. They are meant to be locally modified, independantly + However, comparisons are more an external property of the class rather + than an internal one. They are meant to be locally modified, independently of the type of the intervals.

    The operators <, <=, >, @@ -30,7 +30,7 @@

    Comparisons

    type. However, due to technical limitations, this base type can only be the second argument; so the operators are unfortunately not fully symmetric. The return type is not always bool, since some interesting - results can be achieved by using a tri-state return type. So here is the + results can be achieved by using a tri-state return type. So here are the common signatures of the operators:

     template<class T, class Policies1, class Policies2>
    @@ -44,9 +44,9 @@ 

    vided comparisons

    Default comparison

    -

    If nothing is specified, the meaning of the comparison operators are an +

    If nothing is specified, the meaning of the comparison operators is an extension of the operator on the base type. More precisely, if one of the - argument is invalid or empty, an exception is thrown. If the arguments are + arguments is invalid or empty, an exception is thrown. If the arguments are valid, the following rules are applied to determine the result of [a,b] op [c,d] (just consider c == d if the second argument is of type @@ -55,11 +55,11 @@

    Default comparison

    @@ -107,7 +107,7 @@

    Other comparisons

    their respective header files under <boost/numeric/interval/compare/...>. And as for the default comparison, the operators will generally complain by throwing an - exception if feed by invalid values.

    + exception if fed by invalid values.