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 @@
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 @@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).
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.
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.
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 @@ 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 @@ 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.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 @@
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
(x op
- y), then true), then true
!(x op
- y), then false), then false
<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.
certain: this comparison is equivalent to the default
@@ -122,7 +122,7 @@ lexicographic: the lexicographic order (the lower bounds
are first compared, and if it is not enough to know the result, the upper
bounds are then compared). This order does not have a meaning in interval
- arithmetic. However, since it is the natural total order on pair of
+ arithmetic. However, since it is the natural total order on pairs of
(totally ordered) numbers, it may be handy in some cases.set: the set inclusion partial order. This time, an
diff --git a/doc/examples.htm b/doc/examples.htm
index 81400c8..3b41a4a 100644
--- a/doc/examples.htm
+++ b/doc/examples.htm
@@ -17,7 +17,7 @@ This example shows how to design a function which takes a polynomial and a value and returns the sign of this polynomial at this point. This - function is a filter: if the answer is not guaranteed, the functions says + function is a filter: if the answer is not guaranteed, the function says so. The reason of using a filter rather than a simple evaluation function is: computations with floating-point numbers will incur approximations and it can be enough to change the sign of the polynomial. So, in order to @@ -107,7 +107,7 @@
In libs/numeric/interval/test/ and
libs/numeric/interval/examples/ are some test and example
- programs.. The examples illustrate a few uses of intervals. For a general
+ programs. The examples illustrate a few uses of intervals. For a general
description and considerations on using this library, and some potential
domains of application, please read this mini-guide.
io.cpp shows some stream input and output operators for intervals - .The wide variety of possibilities explains why the library do not +
io.cpp shows some stream input and output operators for intervals. + The wide variety of possibilities explains why the library does not implement i/o operators and they are left to the user.
newton-raphson.cpp is an implementation of a specialized version diff --git a/doc/guide.htm b/doc/guide.htm index 5c30aa5..375f92a 100644 --- a/doc/guide.htm +++ b/doc/guide.htm @@ -13,14 +13,14 @@
First of all, you need to select your base type. In order to obtain an +
First of all, you need to select your base type. In order to obtain a useful interval type, the numbers should respect some requirements. Please refer to this page in order to see them. When your base type is robust enough, you can go to the next step: the choice of the policies.
As you should already know if you did not come to this page by accident,
- the interval class expect a policies argument describing the
+ the interval class expects a policies argument describing the
rounding and checking
policies. The first thing to do is to verify if the default policies are or
are not adapted to your case. If your base type is not float,
@@ -31,7 +31,7 @@
The default policies define an interval type that performs precise
computations (for float, double, long
- double), detects invalid numbers and throws exception each times an
+ double), detects invalid numbers and throws an exception each times an
empty interval is created. This is a brief description and you should refer
to the corresponding sections for a more precise description of the default
policies. Unless you need some special behavior, this default type is
@@ -51,12 +51,12 @@
boost::interval<double> is probably what you need. The
computations are precise, and they may be fast if enclosed in a protected
rounding mode block (see the performance
- section). The comparison are "certain"; it is probably the most used type
+ section). The comparisons are "certain"; it is probably the most used type
of comparison, and the other comparisons are still accessible by the
- explicit comparison functions. The checking forbid empty interval; they are
- not needed since there would be an empty interval at end of the computation
+ explicit comparison functions. The checking forbids empty intervals; they are
+ not needed since there would be an empty interval at the end of the computation
if an empty interval is created during the computation, and no root would
- be inside. The checking also forbid invalid numbers (NaN for floating-point
+ be inside. The checking also forbids invalid numbers (NaN for floating-point
numbers). It can be a minor performance hit if you only use exact
floating-point constants (which are clearly not NaNs); however, if
performance really does matter, you will probably use a good compiler which
@@ -101,7 +101,7 @@ Such a property is not limited to functions with only one argument. @@ -153,10 +153,10 @@
Secondly, the computations must be exact or provide some rounding methods (for instance, toward minus or plus infinity) if we want to - guarantee the inclusion property. Note that we also may explicitely specify + guarantee the inclusion property. Note that we also may explicitly specify no rounding, for instance if the base number type is exact, i.e. the result of a mathematical operation is always computed and represented without loss - of precision. If the number type is not exact, we may still explicitely + of precision. If the number type is not exact, we may still explicitly specify no rounding, with the obvious consequence that the inclusion property is no longer guaranteed.
@@ -211,11 +211,11 @@Since any of these solution has a clearly defined semantics, it is not +
Since any of these solutions has a clearly defined semantics, it is not clear that we should enforce either of them. For this reason, the default - behavior consists to mimic the real comparisons by throwing an exception in - the indeterminate case. Other behaviors can be selected bu using specific - comparison namespace. There is also a bunch of explicitely named comparison + behavior consists in mimicking the real comparisons by throwing an exception in + the indeterminate case. Other behaviors can be selected by using specific + comparison namespace. There is also a bunch of explicitly named comparison functions. See comparisons pages for further details.
@@ -248,7 +248,7 @@For some functions which take several parameters of type
interval<T>, all combinations of argument types
T and interval<T> which contain at least
- one interval<T>, are considered in order to avoid a
+ one interval<T> are considered in order to avoid a
conversion from the arguments of type T to a singleton of type
interval<T>. This is done for efficiency reasons (the
fact that an argument is a singleton sometimes renders some tests
@@ -523,7 +523,7 @@
+ - * /
The operators / and /= will try to produce an
empty interval if the denominator is exactly zero. If the denominator
contains zero (but not only zero), the result will be the smallest interval
- containing the set of division results; so one of its bound will be
+ containing the set of division results; so one of its bounds will be
infinite, but it may not be the whole interval.
lower upper median
@@ -630,14 +630,14 @@ sqrt log exp sin
The function fmod(interval x, interval y) expects the lower
bound of y to be strictly positive and returns an interval
- z such as 0 <= z.lower() < y.upper() and
- such as z is a superset of x-n*y (with
+ z such that 0 <= z.lower() < y.upper() and
+ such that z is a superset of x-n*y (with
n being an integer). So, if the two arguments are positive
singletons, this function fmod(interval, interval) will behave
like the traditional function fmod(double, double).
Please note that fmod does not respect the inclusion
- property of arithmetic interval. For example, the result of
+ property of interval arithmetic. For example, the result of
fmod([13,17],[7,8]) should be [0,8] (since it must contain
[0,3] and [5,8]). But this answer is not really useful when the purpose is
to restrict an interval in order to compute a periodic function. It is the
@@ -654,7 +654,7 @@
Some constants are hidden in the
boost::numeric::interval_lib namespace. They need to be
- explicitely templated by the interval type. The functions are
+ explicitly templated by the interval type. The functions are
pi<I>(), pi_half<I>() and
pi_twice<I>(), and they return an object of interval
type I. Their respective values are π, π/2 and
@@ -827,7 +827,7 @@
Another misleading interpretation of the comparison is: you cannot always expect [a,b] < [c,d] to be !([a,b] >= [c,d]) since the comparison is not necessarily total. Equality and less comparison should be - seen as two distincts relational operators. However the default comparison + seen as two distinct relational operators. However the default comparison operators do respect this property since they throw an exception whenever [a,b] and [c,d] overlap.
@@ -841,7 +841,7 @@square(x), x-x and 0, etc. So the main cause of
wide intervals is that interval arithmetic does not identify different
occurrences of the same variable. So, whenever possible, the user has to
- rewrite the formulas to eliminate multiple occurences of the same variable.
+ rewrite the formulas to eliminate multiple occurrences of the same variable.
For example, square(x)-2*x is far less precise than
square(x-1)-1.
@@ -914,7 +914,7 @@ Specialization of std::less. Since the
operator < depends on the comparison namespace locally
chosen by the user, it is not possible to correctly specialize
- std::less. So you have to explicitely provide such a class to
+ std::less. So you have to explicitly provide such a class to
all the algorithms and templates that could require it (for example,
std::map).
2*x.
However, the library does not provide them by default because the
conversion from int to the base number type is not always
- correct (think about the conversion from a 32bit integer to a single
+ correct (think about the conversion from a 32-bit integer to a single
precision floating-point number). So the functions have been put in a
- separate header and the user needs to include them explicitely if she wants
+ separate header and the user needs to include them explicitly if she wants
to benefit from these mixed operators. Another point, there is no mixed
comparison operators due to the technical way they are defined.
diff --git a/doc/numbers.htm b/doc/numbers.htm
index 45a1c7b..84dbced 100644
--- a/doc/numbers.htm
+++ b/doc/numbers.htm
@@ -14,7 +14,7 @@
What we call "number" is the base type of the interval
- class. The interval library expect a lot of properties from this base type
+ class. The interval library expects a lot of properties from this base type
in order to respect the inclusion property. All these properties are
already detailed in the other sections of this documentation; but we will
try to summarize them here.
complex<T> will not be a
good candidate for the base type; if you need the inclusion property of
- interval property, you should use complex< interval<T>
+ interval arithmetic, you should use complex< interval<T>
> in place of interval< complex<T> >
(but unfortunately, complex only provides specialization).
@@ -129,7 +129,7 @@ Rounding
Constants
In order for the trigonometric functions to correctly work, the library
- need to know the value of the π constant (and also π/2 and 2π).
+ needs to know the value of the π constant (and also π/2 and 2π).
Since these constants may not be representable in the base type, the
library does not have to know the exact value: a lower bound and an upper
bound are enough. If these values are not provided by the user, the default
@@ -142,7 +142,7 @@
Operators and conversions
defined for the base type. The rounding policy defines a lot of functions
used by the interval library. So the arithmetic operators do not need to be
defined for the base type (unless required by one of the predefined
- classes). However, there is an exception: the unary minus need to be
+ classes). However, there is an exception: the unary minus needs to be
defined. Moreover, this operator should only provide exact results; it is
the reason why the rounding policy does not provide some negation
functions.
diff --git a/doc/rounding.htm b/doc/rounding.htm
index 26e4d90..ccb1745 100644
--- a/doc/rounding.htm
+++ b/doc/rounding.htm
@@ -96,7 +96,7 @@ Requirements
important semantic requirement: they are responsible for setting and
resetting the rounding modes of the computation on T. For instance, if T is
a standard floating point type and floating point computation is performed
- according to the Standard IEEE 754, the constructor can save the current
+ according to the standard IEEE 754, the constructor can save the current
rounding state, each _up (resp. _down) function
will round up (resp. down), and the destructor will restore the saved
rounding state. Indeed this is the behavior of the default rounding
@@ -115,7 +115,7 @@ Requirements
must round down the value and the second one must round it up.
The type unprotected_rounding allows to remove all
- controls. For reasons why one might to do this, see the protection paragraph below.
Overview of the provided classes
@@ -346,7 +346,7 @@ Transcendental functions
valid values. For example, cos_down always returns -1. In this
way, we do verify the inclusion property for the default implementation,
even if this has strictly no value for the user. In order to have useful
- values, another policy should be used explicitely, which will most likely
+ values, another policy should be used explicitly, which will most likely
lead to a violation of the inclusion property. In this way, we ensure that
the violation is clearly pointed out to the user who then knows what he
stands against. This class could have been used as the default
@@ -468,7 +468,7 @@ Speeding up consecutive operations
sets the floating point environment. This protection is done by the
constructor and destructor of the rounding policy.
- Les us now consider the case of two consecutive interval additions:
+
Let us now consider the case of two consecutive interval additions:
[a,b] + [c,d] + [e,f]. The
generated code should look like:
@@ -514,10 +514,10 @@ Speeding up consecutive operations
Example
- Here is an example of Horner's scheme to compute the value of a polynom.
+
Here is an example of Horner's scheme to compute the value of a polynomial.
The rounding mode switches are disabled for the whole computation.
-// I is an interval class, the polynom is a simple array
+// I is an interval class, the polynomial is a simple array
template<class I>
I horner(const I& x, const I p[], int n) {
@@ -564,7 +564,7 @@ Extended Registers
done with double registers, or double computations with long double
registers). Consequently, many problems can arise.
- The first one is due to to the extended precision of the mantissa. The
+
The first one is due to the extended precision of the mantissa. The
rounding is also done on this extended precision. And consequently, we
still have down(a+b) = -up(-a-b) in the
extended registers. But back to the standard precision, we now have
diff --git a/examples/horner.cpp b/examples/horner.cpp
index dfae289..589dcef 100644
--- a/examples/horner.cpp
+++ b/examples/horner.cpp
@@ -11,7 +11,7 @@
#include
#include
-// I is an interval class, the polynom is a simple array
+// I is an interval class, the polynomial is a simple array
template
I horner(const I& x, const I p[], int n) {
diff --git a/examples/io.cpp b/examples/io.cpp
index de4df49..889fa46 100644
--- a/examples/io.cpp
+++ b/examples/io.cpp
@@ -1,5 +1,5 @@
/* Boost examples/io.cpp
- * show some exampleso of i/o operators
+ * show some examples of i/o operators
* thanks to all the people who commented on this point, particularly on
* the Boost mailing-list
*
diff --git a/include/boost/numeric/interval/io.hpp b/include/boost/numeric/interval/io.hpp
index dc4179e..c91e392 100644
--- a/include/boost/numeric/interval/io.hpp
+++ b/include/boost/numeric/interval/io.hpp
@@ -4,7 +4,7 @@
* implementation of the output operator. It is
* provided for test programs that aren't even
* interested in the precision of the results.
- * A real progam should define its own operators
+ * A real program should define its own operators
* and never include this header.
*
* Copyright 2003 Guillaume Melquiond