changed all appearances of MPFI and MPFI by \mpfr and \mpfi

This commit is contained in:
Luis Peñaranda 2010-03-16 14:02:58 +00:00
parent 922cd70e79
commit 94f3caaf94
3 changed files with 39 additions and 41 deletions

View File

@ -111,7 +111,7 @@ In addition, it is possible to directly use the C++ number types provided by
necessary functions to make these classes compliant to the \cgal\ number type necessary functions to make these classes compliant to the \cgal\ number type
requirements. requirements.
To use these classes, \gmp\ and \textsc{Mpfr}\ must be installed. To use these classes, \gmp\ and \mpfr\ must be installed.
\section[Number Types Provided by LEDA] {Number Types Provided by \leda} \section[Number Types Provided by LEDA] {Number Types Provided by \leda}
@ -201,7 +201,7 @@ is implemented on top of \ccc{Gmpfr}, the global flags and the default
precision are inherited from the \ccc{Gmpfr} interface. See precision are inherited from the \ccc{Gmpfr} interface. See
\cite{cgal:r-mpfi} and the \ccc{Gmpfi} reference manual for details. \cite{cgal:r-mpfi} and the \ccc{Gmpfi} reference manual for details.
To use the \ccc{Gmpfi} class, \textsc{Mpfi}\ must be installed. To use the \ccc{Gmpfi} class, \mpfi\ must be installed.
\section{User-supplied Number Types} \section{User-supplied Number Types}

View File

@ -4,7 +4,7 @@
\ccDefinition \ccDefinition
An object of the class \ccc{Gmpfi} is a closed interval, whith An object of the class \ccc{Gmpfi} is a closed interval, whith
endpoints represented as MPFR floating-point numbers. An interval can endpoints represented as \mpfr\ floating-point numbers. An interval can
have finite or infinite endpoints and its meaning is straightforward. have finite or infinite endpoints and its meaning is straightforward.
It can also have one (or both) NaN endpoint(s): this indicates that an It can also have one (or both) NaN endpoint(s): this indicates that an
invalid operation has been performed and that the resulting interval invalid operation has been performed and that the resulting interval
@ -32,8 +32,8 @@ and \verb-long double-.
\ccCreation \ccCreation
All the constructors accept an optional last argument: a precision All the constructors accept an optional last argument: a precision
(a \ccc{Precision_type}, which can be used to specify the precision (a \ccc{Precision_type}, which can be used to specify the precision of
of the Gmpfr endpoints. If none is specified, the default precision the \ccc{Gmpfr} endpoints. If none is specified, the default precision
will be used. As the endpoints are represented with a fixed number of will be used. As the endpoints are represented with a fixed number of
bits, they may need to be rounded. In this case, the number from which bits, they may need to be rounded. In this case, the number from which
the \ccc{Gmpfi} was constructed is guaranteed to be included in the the \ccc{Gmpfi} was constructed is guaranteed to be included in the
@ -49,18 +49,18 @@ constructed interval.
%-------------------------------------------------- %--------------------------------------------------
% \ccConstructor{Gmpfi(mpfi_srcptr p);} % \ccConstructor{Gmpfi(mpfi_srcptr p);}
% {creates an MPFI interval, initialized with the value of % {creates a \ccc{Gmpfi} interval, initialized with the value of
% \ccstyle{p}, a MPFI number used in a C implementation. The data % \ccstyle{p}, a \mpfi\ number used in a C implementation. The data
% structure containing \ccc{p} will not be cleared after object's % structure containing \ccc{p} will not be cleared after object's
% destruction.} % destruction.}
%-------------------------------------------------- %--------------------------------------------------
\ccConstructor{template <class T> \ccConstructor{template <class T>
Gmpfi(const T& t,Precision_type p=get_default_precision());} Gmpfi(const T& t,Precision_type p=get_default_precision());}
{creates a \ccc{Gmpfi} initialized with the value of \ccc{t}. {creates a \ccc{Gmpfi} initialized with the value of \ccc{t}.
\ccc{T} is \ccc{Gmpfr}, \ccc{Gmpq}, or any type from which \ccc{T} is \ccc{Gmpfr}, \ccc{Gmpq}, or any type from which
\ccc{Gmpfr} can be constructed from. The rounding of the \ccc{Gmpfr} can be constructed from. The rounding of the
endpoints will guarantee that \ccc{t} is included in \ccVar.} endpoints will guarantee that \ccc{t} is included in \ccVar.}
\ccConstructor{Gmpfi(const Gmpfr &left, \ccConstructor{Gmpfi(const Gmpfr &left,
const Gmpfr &right, const Gmpfr &right,
@ -273,7 +273,7 @@ of comparisons:
% the numbers in interval \ccc{y}, \ccc{indeterminate} if % the numbers in interval \ccc{y}, \ccc{indeterminate} if
% \ccVar~contains the squares of some numbers in \ccc{y} but not % \ccVar~contains the squares of some numbers in \ccc{y} but not
% of all of them, and \ccc{false} otherwise.} % of all of them, and \ccc{false} otherwise.}
%-------------------------------------------------- %--------------------------------------------------
%-------------------------------------------------- %--------------------------------------------------
% \ccMethod{Uncertain<bool> divides(const Gmpfi &n,Gmpfi &c, % \ccMethod{Uncertain<bool> divides(const Gmpfi &n,Gmpfi &c,
@ -281,7 +281,7 @@ of comparisons:
% {Returns \ccVar \ccc{.divides(n)}. If it is \ccc{true}, sets % {Returns \ccVar \ccc{.divides(n)}. If it is \ccc{true}, sets
% \ccc{c} such that \( \ccc{n} = \ccVar \times \ccc{c} \), with % \ccc{c} such that \( \ccc{n} = \ccVar \times \ccc{c} \), with
% precision \ccc{p}.} % precision \ccc{p}.}
%-------------------------------------------------- %--------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -309,7 +309,5 @@ of comparisons:
\ccRefIdfierPage{RealEmbeddable}\\ \ccRefIdfierPage{RealEmbeddable}\\
\ccRefIdfierPage{FieldWithKthRoot}\\ \ccRefIdfierPage{FieldWithKthRoot}\\
\end{ccRefClass} \end{ccRefClass}
\ccDefGlobalScope{CGAL::} \ccDefGlobalScope{CGAL::}
% vim: tabstop=8: softtabstop=8: smarttab: shiftwidth=8: expandtab

View File

@ -4,13 +4,13 @@
\ccDefinition \ccDefinition
An object of the class \ccc{Gmpfr} is a fixed precision floating-point An object of the class \ccc{Gmpfr} is a fixed precision floating-point
number, based on the MPFR library. This type is inexact, due to the fact number, based on the \mpfr\ library. This type is inexact, due to the fact
that the mantissa of each number is represented by a fixed amount of bits that the mantissa of each number is represented by a fixed amount of bits
(this amount is called \emph{precision}). If an operation needs more bits (this amount is called \emph{precision}). If an operation needs more bits
than the precision of the result number, the results are rounded following than the precision of the result number, the results are rounded following
different possible criteria (called \emph{rounding modes}). different possible criteria (called \emph{rounding modes}).
Currently, MPFR supports four rounding modes: round to nearest, Currently, \mpfr\ supports four rounding modes: round to nearest,
round toward zero, round down (or toward \(-\infty\)) and round up round toward zero, round down (or toward \(-\infty\)) and round up
(or toward \(+\infty\)). When not specified explicitly, the (or toward \(+\infty\)). When not specified explicitly, the
operations use the default rounding mode, which is in practice a operations use the default rounding mode, which is in practice a
@ -46,41 +46,41 @@ This type is \ccc{ImplicitInteroperable} with \ccc{Gmpz}, \verb-long-,
%-------------------------------------------------- %--------------------------------------------------
% \ccConstructor{Gmpfr(mpfr_srcptr p);} % \ccConstructor{Gmpfr(mpfr_srcptr p);}
% {Creates a MPFR number, initialized with the value of \ccc{p}, % {Creates a \mpfr\ number, initialized with the value of \ccc{p},
% a MPFR number used in a C implementation. The data structure % a \mpfr\ number used in a C implementation. The data structure
% containing \ccc{p} will not be cleared after object's % containing \ccc{p} will not be cleared after object's
% destruction.} % destruction.}
%-------------------------------------------------- %--------------------------------------------------
\ccConstructor{Gmpfr(long si);} \ccConstructor{Gmpfr(long si);}
{Creates a MPFR number, initialized with the value of \ccc{si}.} {Creates \ccc{Gmpfr}, initialized with the value of \ccc{si}.}
\ccConstructor{Gmpfr(unsigned long ui);} \ccConstructor{Gmpfr(unsigned long ui);}
{Creates a MPFR number, initialized with the value of \ccc{ui}.} {Creates a \ccc{Gmpfr}, initialized with the value of \ccc{ui}.}
\ccConstructor{Gmpfr(int i);} \ccConstructor{Gmpfr(int i);}
{Creates a MPFR number, initialized with the value of \ccc{i}.} {Creates a \ccc{Gmpfr}, initialized with the value of \ccc{i}.}
\ccConstructor{Gmpfr(double d);} \ccConstructor{Gmpfr(double d);}
{Creates a MPFR number, initialized with the value of \ccc{d}.} {Creates a \ccc{Gmpfr}, initialized with the value of \ccc{d}.}
\ccConstructor{Gmpfr(long double ld);} \ccConstructor{Gmpfr(long double ld);}
{Creates a MPFR number, initialized with the value of \ccc{ld}.} {Creates a \ccc{Gmpfr}, initialized with the value of \ccc{ld}.}
\ccConstructor{Gmpfr(const Gmpz &z);} \ccConstructor{Gmpfr(const Gmpz &z);}
{Creates a MPFR number, initialized with the value of \ccc{z}.} {Creates a \ccc{Gmpfr}, initialized with the value of \ccc{z}.}
\ccConstructor{Gmpfr(const Gmpzf &zf);} \ccConstructor{Gmpfr(const Gmpzf &zf);}
{Creates a MPFR number, initialized with the value of \ccc{zf}.} {Creates a \ccc{Gmpfr}, initialized with the value of \ccc{zf}.}
\ccConstructor{Gmpfr(std::pair<Gmpz,long> ie);} \ccConstructor{Gmpfr(std::pair<Gmpz,long> ie);}
{Creates a MPFR number, initialized with the value of {Creates a \ccc{Gmpfr}, initialized with the value of
\( ie.first \times 2^{ie.second} \) .} \( ie.first \times 2^{ie.second} \) .}
Note that all constructors can be called with two optional parameters. Note that all constructors can be called with two optional parameters.
One can specify as second parameter the rounding mode desired for One can specify as second parameter the rounding mode desired for
the conversion from the source number and as a third parameter the the conversion from the source number and as a third parameter the
precision with which this MPFR number will be created. If only one precision with which this \ccc{Gmpfr} will be created. If only one
optional parameter is specified, it can be either the rounding mode optional parameter is specified, it can be either the rounding mode
or the precision. If no optional parameters are specified, the or the precision. If no optional parameters are specified, the
precision of the created object is chosen in such a way that the precision of the created object is chosen in such a way that the
@ -116,25 +116,25 @@ floating-point number that is equal or smaller than to \verb-z-.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Each Gmpfr object has a precision associated to it. The precision is the Each Gmpfr object has a precision associated to it. The precision is the
amount of bits needed to represent the mantissa. MPFR has a default amount of bits needed to represent the mantissa. \mpfr\ has a default
precision value, which can be controlled by static functions of the Gmpfr precision value, which can be controlled by static functions of the Gmpfr
class (in practice, this default value is a variable local to each class (in practice, this default value is a variable local to each
execution thread). There are also functions to get and set the precision of execution thread). There are also functions to get and set the precision of
each Gmpfr object. each Gmpfr object.
\ccFunction{static Precision_type get_default_precision();} \ccFunction{static Precision_type get_default_precision();}
{This returns the current precision used in MPFR creation {This returns the current precision used in \ccc{Gmpfr}
by default.} creation by default.}
\ccFunction{static Precision_type set_default_precision(Precision_type p);} \ccFunction{static Precision_type set_default_precision(Precision_type p);}
{This function sets the default MPFR precision to p, and returns {This function sets the default \mpfr\ precision to p, and returns
the old one.} the old one.}
\ccMethod{Precision_type get_precision()const;} \ccMethod{Precision_type get_precision()const;}
{Returns the precision of \ccVar.} {Returns the precision of \ccVar.}
\ccMethod{Gmpfr round(Precision_type p, std::float_round_style r)const;} \ccMethod{Gmpfr round(Precision_type p, std::float_round_style r)const;}
{Returns the value of the number, rounded with precision \ccc{p} {Returns the value of \ccVar, rounded with precision \ccc{p}
in the direction \ccc{r}.} in the direction \ccc{r}.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -142,11 +142,11 @@ each Gmpfr object.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ccFunction{static std::float_round_style get_default_rndmode();} \ccFunction{static std::float_round_style get_default_rndmode();}
{This function returns the current rounding mode used by MPFR.} {This function returns the current rounding mode used by \mpfr.}
\ccFunction{static std::float_round_style \ccFunction{static std::float_round_style
set_default_rndmode(std::float_round_style r);} set_default_rndmode(std::float_round_style r);}
{This function sets the MPFR rounding mode to \ccc{r} and returns {This function sets the \mpfr\ rounding mode to \ccc{r} and returns
the old one.} the old one.}
@ -154,7 +154,7 @@ each Gmpfr object.
%% inexact flags handling functions %% inexact flags handling functions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MPFR provides some flags to know whether performed operations were exact \mpfr\ provides some flags to know whether performed operations were exact
or not, or they incurred in overflow or underflow, if the exponent is or not, or they incurred in overflow or underflow, if the exponent is
out of range, or the result was \ccc{NaN} (not-a-number). One can clear the out of range, or the result was \ccc{NaN} (not-a-number). One can clear the
flags before a set of operations and inspect them afterward, in order to flags before a set of operations and inspect them afterward, in order to
@ -162,7 +162,7 @@ see if something unexpected happened during the operations. The static
functions used to handle flags are: functions used to handle flags are:
\ccFunction{static void clear_flags();} \ccFunction{static void clear_flags();}
{Clears all the flags set by MPFR, (they are not cleared {Clears all the flags set by \mpfr (they are not cleared
automatically).} automatically).}
\ccFunction{static bool underflow_flag();} \ccFunction{static bool underflow_flag();}
@ -179,7 +179,7 @@ functions used to handle flags are:
\ccFunction{static bool erange_flag();} \ccFunction{static bool erange_flag();}
{Returns \ccc{true} iff a range error occurred. Such an exception {Returns \ccc{true} iff a range error occurred. Such an exception
occurs when some function which does not return an MPFR number occurs when some function which does not return a \ccc{Gmpfr}
has an invalid result. For example, this flag will be set if has an invalid result. For example, this flag will be set if
one of the operands of a comparison is \ccc{NaN}.} one of the operands of a comparison is \ccc{NaN}.}
@ -353,7 +353,7 @@ the compared numbers is \ccc{NaN}, the \ccc{erange} flag is set.
\ccImplementation \ccImplementation
\ccc{Gmpfr}s are reference counted. Since the MPFR library can be compiled \ccc{Gmpfr}s are reference counted. Since the \mpfr\ library can be compiled
to be thread-safe, this interface is designed to keep the thread-safety. to be thread-safe, this interface is designed to keep the thread-safety.
\ccSeeAlso \ccSeeAlso