mirror of https://github.com/CGAL/cgal
Use new layout
This commit is contained in:
parent
f40c0f16f7
commit
c80da3b032
|
|
@ -112,7 +112,7 @@ Algebraic_foundations/doc/Algebraic_foundations/Concepts/RealEmbeddableTraits.h
|
||||||
Algebraic_foundations/doc/Algebraic_foundations/Concepts/RingNumberType.h -text
|
Algebraic_foundations/doc/Algebraic_foundations/Concepts/RingNumberType.h -text
|
||||||
Algebraic_foundations/doc/Algebraic_foundations/Concepts/UniqueFactorizationDomain.h -text
|
Algebraic_foundations/doc/Algebraic_foundations/Concepts/UniqueFactorizationDomain.h -text
|
||||||
Algebraic_foundations/doc/Algebraic_foundations/Concepts/Unique_factorization_domain_tag.h -text
|
Algebraic_foundations/doc/Algebraic_foundations/Concepts/Unique_factorization_domain_tag.h -text
|
||||||
Algebraic_foundations/doc/Algebraic_foundations/PkgDescription.txt -text
|
Algebraic_foundations/doc/Algebraic_foundations/PackageDescription.txt -text
|
||||||
Algebraic_foundations/doc/Algebraic_foundations/fig/AlgebraicConceptHierarchy.gif -text svneol=unset#image/gif
|
Algebraic_foundations/doc/Algebraic_foundations/fig/AlgebraicConceptHierarchy.gif -text svneol=unset#image/gif
|
||||||
Algebraic_foundations/doc/Algebraic_foundations/fig/Algebraic_foundations2.png -text svneol=unset#image/png
|
Algebraic_foundations/doc/Algebraic_foundations/fig/Algebraic_foundations2.png -text svneol=unset#image/png
|
||||||
Algebraic_foundations/doc_tex/Algebraic_foundations/Algebraic_foundations.png -text
|
Algebraic_foundations/doc_tex/Algebraic_foundations/Algebraic_foundations.png -text
|
||||||
|
|
@ -3285,10 +3285,12 @@ Modifier/doc_tex/Modifier/modifier.gif -text svneol=unset#image/gif
|
||||||
Modifier/doc_tex/Modifier/modifier_small.gif -text svneol=unset#image/gif
|
Modifier/doc_tex/Modifier/modifier_small.gif -text svneol=unset#image/gif
|
||||||
Modular_arithmetic/doc/Modular_arithmetic/CGAL/Modular_traits.h -text
|
Modular_arithmetic/doc/Modular_arithmetic/CGAL/Modular_traits.h -text
|
||||||
Modular_arithmetic/doc/Modular_arithmetic/CGAL/Residue.h -text
|
Modular_arithmetic/doc/Modular_arithmetic/CGAL/Residue.h -text
|
||||||
|
Modular_arithmetic/doc/Modular_arithmetic/Concepts/ModularTraits--ModularImage.h -text
|
||||||
|
Modular_arithmetic/doc/Modular_arithmetic/Concepts/ModularTraits--ModularImageRepresentative.h -text
|
||||||
Modular_arithmetic/doc/Modular_arithmetic/Concepts/ModularTraits.h -text
|
Modular_arithmetic/doc/Modular_arithmetic/Concepts/ModularTraits.h -text
|
||||||
Modular_arithmetic/doc/Modular_arithmetic/Concepts/Modularizable.h -text
|
Modular_arithmetic/doc/Modular_arithmetic/Concepts/Modularizable.h -text
|
||||||
Modular_arithmetic/doc/Modular_arithmetic/Modular_arithmetic.txt -text
|
Modular_arithmetic/doc/Modular_arithmetic/Modular_arithmetic.txt -text
|
||||||
Modular_arithmetic/doc/Modular_arithmetic/PkgDescription.txt -text
|
Modular_arithmetic/doc/Modular_arithmetic/PackageDescription.txt -text
|
||||||
Modular_arithmetic/doc/Modular_arithmetic/fig/Modular_arithmetic.png -text svneol=unset#image/png
|
Modular_arithmetic/doc/Modular_arithmetic/fig/Modular_arithmetic.png -text svneol=unset#image/png
|
||||||
Modular_arithmetic/doc_tex/Modular_arithmetic/Modular_arithmetic.png -text
|
Modular_arithmetic/doc_tex/Modular_arithmetic/Modular_arithmetic.png -text
|
||||||
Modular_arithmetic/doc_tex/Modular_arithmetic/PkgDescription.tex -text
|
Modular_arithmetic/doc_tex/Modular_arithmetic/PkgDescription.tex -text
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
/*!
|
/*!
|
||||||
\mainpage ChapterAlgebraicFoundations Algebraic Foundations
|
\mainpage Algebraic Foundations
|
||||||
\authors Michael Hemmer
|
\authors Michael Hemmer
|
||||||
|
|
||||||
# Introduction #
|
# Introduction #
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
/*!
|
||||||
|
\addtogroup PkgAlgebraicFoundations
|
||||||
|
\todo check generated documentation
|
||||||
|
\PkgDescriptionBegin{Algebraic Foundations}
|
||||||
|
\PkgPicture{Algebraic_foundations2.png}
|
||||||
|
\PkgAuthor{Michael Hemmer}
|
||||||
|
\PkgDesc{This package defines what algebra means for \cgal, in terms of concepts, classes and functions. The main features are: (i) explicit concepts for interoperability of types (ii) separation between algebraic types (not necessarily embeddable into the reals), and number types (embeddable into the reals).}
|
||||||
|
\PkgSince{3.3}
|
||||||
|
\cgalbib{cgal:h-af-12}
|
||||||
|
\license{ \ref licensesLGPL}
|
||||||
|
\PkgDescriptionEnd
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
/*!
|
|
||||||
\addtogroup PkgAlgebraicFoundations Algebraic Foundations
|
|
||||||
<table cellpadding="2" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td colspan="2"><h1>Algebraic Foundations</h1></td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2">\image html fig/Algebraic_foundations2.png "" </td>
|
|
||||||
<td>
|
|
||||||
\par Michael Hemmer
|
|
||||||
|
|
||||||
\par "" This package defines what algebra means for \cgal, in terms of concepts, classes and functions. The main features are: (i) explicit concepts for interoperability of types (ii) separation between algebraic types (not necessarily embeddable into the reals), and number types (embeddable into the reals).
|
|
||||||
|
|
||||||
\since \cgal 3.3
|
|
||||||
|
|
||||||
\cgalbib{cgal:h-af-12}
|
|
||||||
|
|
||||||
\license{ \ref licensesLGPL "LGPL" }
|
|
||||||
|
|
||||||
\par Resources:
|
|
||||||
\ref ChapterAlgebraicFoundations "User Manual"
|
|
||||||
</td>
|
|
||||||
</table>
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
\page user_chapter_2D_Meshes 2D Conforming Triangulations and Meshes
|
\mainpage 2D Conforming Triangulations and Meshes
|
||||||
\author Laurent Rineau
|
\author Laurent Rineau
|
||||||
|
|
||||||
This package implements Shewchuk's algorithm \cite s-mgdsa-00 to construct
|
This package implements Shewchuk's algorithm \cite s-mgdsa-00 to construct
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,7 @@ selection mark without spoiling the correctness of the Minkowski sum.
|
||||||
The function `minkowski_sum_3()` should be used with the
|
The function `minkowski_sum_3()` should be used with the
|
||||||
::Exact_predicates_exact_constructions_kernel, which often is
|
::Exact_predicates_exact_constructions_kernel, which often is
|
||||||
the most efficient choice and allows floating-point input. Consult
|
the most efficient choice and allows floating-point input. Consult
|
||||||
Section \anchor sectionNef_3IO for more details.
|
Section \ref sectionNef_3IO for more details.
|
||||||
|
|
||||||
The following example code illustrates the usage of the function
|
The following example code illustrates the usage of the function
|
||||||
`minkowski_sum_3()`. Note that either input polyhedra will be
|
`minkowski_sum_3()`. Note that either input polyhedra will be
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,20 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
/// \ingroup PkgModularArithmetic
|
|
||||||
///
|
/*!
|
||||||
/// An instance of `Modular_traits` is a model of `ModularTraits`,
|
\ingroup PkgModularArithmetic
|
||||||
/// where `T` is the associated type.
|
|
||||||
///
|
An instance of `Modular_traits` is a model of `ModularTraits`,
|
||||||
/// \models ::ModularTraits
|
where <span class="textsc">T</span> is the associated type.
|
||||||
|
|
||||||
|
\models ::ModularTraits
|
||||||
|
|
||||||
|
*/
|
||||||
template< typename T >
|
template< typename T >
|
||||||
class Modular_traits {
|
class Modular_traits {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
}; /* class Modular_traits */
|
/// @}
|
||||||
} /* namespace CGAL */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}; /* end Modular_traits */
|
||||||
|
} /* end namespace CGAL */
|
||||||
|
|
|
||||||
|
|
@ -1,163 +1,162 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
/// \ingroup PkgModularArithmetic
|
|
||||||
///
|
/*!
|
||||||
/// The class `Residue` represents a finite field \f$Z/pZ\f$, for some
|
\ingroup PkgModularArithmetic
|
||||||
/// prime number \f$p\f$. The prime number \f$p\f$ is stored in a
|
|
||||||
/// static member variable. The class provides static member
|
\anchor Residue
|
||||||
/// functions to change this value. <B>Note that changing the prime
|
|
||||||
/// invalidates already existing objects of this type.</B>
|
The class `Residue` represents a finite field \f$ \Z{/p\Z}\f$,
|
||||||
///
|
for some prime number \f$ p\f$.
|
||||||
/// However, already existing objects do not lose their value with respect to the
|
|
||||||
/// old prime and can be reused after restoring the old prime.
|
The prime number \f$ p\f$ is stored in a static member variable.
|
||||||
/// Since the type is based on double
|
The class provides static member functions to change this value.
|
||||||
/// arithmetic the prime is restricted to values less than \f$2^{26}\f$.
|
<B>Note that changing the prime invalidates already existing objects
|
||||||
/// The initial value of \f$p\f$ is \f$67111067\f$.
|
of this type.</B>
|
||||||
///
|
However, already existing objects do not lose their value with respect to the
|
||||||
/// Please note that the implementation of class `CGAL::Residue` requires a mantissa
|
old prime and can be reused after restoring the old prime.
|
||||||
/// precision according to the IEEE Standard for Floating-Point Arithmetic (IEEE 754).
|
Since the type is based on double
|
||||||
/// However, on some processors the traditional FPU uses an extended precision. Hence, it
|
arithmetic the prime is restricted to values less than \f$ 2^{26}\f$.
|
||||||
/// is indispensable that the proper mantissa length is enforced before performing
|
The initial value of \f$ p\f$ is 67111067.
|
||||||
/// any arithmetic operations. Moreover, it is required that numbers are rounded to the
|
|
||||||
/// next nearest value. This can be ensured using `CGAL::Protect_FPU_rounding` with
|
Please note that the implementation of class `CGAL::Residue` requires a mantissa
|
||||||
/// `CGAL_FE_TONEAREST`, which also enforces the required precision as a side effect.
|
precision according to the IEEE Standard for Floating-Point Arithmetic (IEEE 754).
|
||||||
///
|
However, on some processors the traditional FPU uses an extended precision. Hence, it
|
||||||
/// In case the flag `CGAL_HAS_THREADS` is undefined the prime is just
|
is indispensable that the proper mantissa length is enforced before performing
|
||||||
/// stored in a static member of the class, that is, `Residue` is not
|
any arithmetic operations. Moreover, it is required that numbers are rounded to the
|
||||||
/// thread-safe in this case. In case `CGAL_HAS_THREADS` the
|
next nearest value. This can be ensured using `CGAL::Protect_FPU_rounding` with
|
||||||
/// implementation of the class is thread safe using
|
`CGAL_FE_TONEAREST`, which also enforces the required precision as a side effect.
|
||||||
/// `boost::thread_specific_ptr`. However, this may cause some
|
|
||||||
/// performance penalty. Hence, it may be advisable to configure
|
In case the flag `CGAL_HAS_THREADS`
|
||||||
/// `CGAL` with `CGAL_HAS_NO_THREADS`.
|
is undefined the prime is just stored in a static member
|
||||||
///
|
of the class, that is, `Residue` is not thread-safe in this case.
|
||||||
/// \models ::Field
|
In case `CGAL_HAS_THREADS`
|
||||||
|
the implementation of the class is thread safe using
|
||||||
|
`boost::thread_specific_ptr`. However, this may cause some performance
|
||||||
|
penalty. Hence, it may be advisable to configure `CGAL` with
|
||||||
|
`CGAL_HAS_NO_THREADS`.
|
||||||
|
|
||||||
|
\models ::Field
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
class Residue {
|
class Residue {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// \name Creation
|
/// \name Creation
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
introduces a variable `x`, which is initialized with zero;
|
introduces a variable `x`, which is initialized with zero;
|
||||||
*/
|
*/
|
||||||
Residue();
|
Residue();
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Creation
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
copy constructor;
|
copy constructor;
|
||||||
*/
|
*/
|
||||||
Residue(const Residue& m);
|
Residue(const Residue& m);
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Creation
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
introduces a variable `x`, which is initialized with \f$i \mod p\f$;
|
introduces a variable `x`, which is initialized with \f$ i \% p\f$;
|
||||||
*/
|
*/
|
||||||
Residue(int i);
|
Residue(int i);
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Creation
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
introduces a variable `x`, which is initialized with \f$i \mod p\f$;
|
introduces a variable `x`, which is initialized with \f$ i \% p\f$;
|
||||||
*/
|
*/
|
||||||
Residue(long i);
|
Residue(long i);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// \name Operations
|
/// \name Operations
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
sets current prime to the given value and returns the old prime.
|
|
||||||
|
Static member function;
|
||||||
|
|
||||||
|
sets current prime to the given value and returns the old prime.
|
||||||
*/
|
*/
|
||||||
static int set_current_prime(int p);
|
static int set_current_prime(int p);
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Operations
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
returns the value of the current prime.
|
|
||||||
|
Static member function;
|
||||||
|
|
||||||
|
returns the value of the current prime.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
static int get_current_prime();
|
static int get_current_prime();
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Operations
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
Returns the unique representative of `x`within the range \f$[-p/2,p/2]\f$, where \f$p\f$ is the current prime.
|
|
||||||
|
Returns the unique representative of `x`within the range
|
||||||
|
\f$ [-p/2,p/2]\f$, where \f$ p\f$ is the current prime.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
int get_value() const;
|
int get_value() const;
|
||||||
|
|
||||||
///
|
/*!
|
||||||
///
|
|
||||||
|
*/
|
||||||
Residue operator+(Residue a);
|
Residue operator+(Residue a);
|
||||||
|
|
||||||
///
|
/*!
|
||||||
///
|
|
||||||
|
*/
|
||||||
Residue operator-(Residue a);
|
Residue operator-(Residue a);
|
||||||
|
|
||||||
///
|
/*!
|
||||||
///
|
|
||||||
|
*/
|
||||||
Residue operator+(Residue a,Residue b);
|
Residue operator+(Residue a,Residue b);
|
||||||
|
|
||||||
///
|
/*!
|
||||||
///
|
|
||||||
|
*/
|
||||||
Residue operator-(Residue a,Residue b);
|
Residue operator-(Residue a,Residue b);
|
||||||
|
|
||||||
///
|
/*!
|
||||||
///
|
|
||||||
|
*/
|
||||||
Residue operator*(Residue a,Residue b);
|
Residue operator*(Residue a,Residue b);
|
||||||
|
|
||||||
///
|
/*!
|
||||||
///
|
|
||||||
|
*/
|
||||||
Residue operator/(Residue a,Residue b);
|
Residue operator/(Residue a,Residue b);
|
||||||
|
|
||||||
/// \name Operations
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
*/
|
*/
|
||||||
Residue & operator+=(Residue a);
|
Residue & operator+=(Residue a);
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Operations
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
*/
|
*/
|
||||||
Residue & operator-=(Residue a);
|
Residue & operator-=(Residue a);
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Operations
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
*/
|
*/
|
||||||
Residue & operator*=(Residue a);
|
Residue & operator*=(Residue a);
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Operations
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
*/
|
*/
|
||||||
Residue & operator/=(Residue a);
|
Residue & operator/=(Residue a);
|
||||||
/// @}
|
|
||||||
|
|
||||||
///
|
/*!
|
||||||
///
|
|
||||||
|
*/
|
||||||
Residue operator==(Residue a,Residue b);
|
Residue operator==(Residue a,Residue b);
|
||||||
|
|
||||||
///
|
/*!
|
||||||
///
|
|
||||||
|
*/
|
||||||
Residue operator!=(Residue a,Residue b);
|
Residue operator!=(Residue a,Residue b);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
}; /* end Residue */
|
||||||
}; /* class Residue */
|
} /* end namespace CGAL */
|
||||||
} /* namespace CGAL */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup PkgModularArithmeticConcepts
|
||||||
|
\cgalconcept
|
||||||
|
|
||||||
|
This `AdaptableUnaryFunction` computes the modular image of the given value
|
||||||
|
with respect to a homomorphism \f$ \varphi\f$ from the
|
||||||
|
`ModularTraits::Type` into the `ModularTraits::Residue_type`.
|
||||||
|
|
||||||
|
The homomorphism preserves the mapping of `int` into both types
|
||||||
|
, i.e., \f$ \varphi(Type(i)) == Residue\_type(i)\f$.
|
||||||
|
|
||||||
|
\refines ::AdaptableUnaryFunction
|
||||||
|
|
||||||
|
\sa `ModularTraits`
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ModularTraits::ModularImage {
|
||||||
|
public:
|
||||||
|
|
||||||
|
/// \name Types
|
||||||
|
/// @{
|
||||||
|
|
||||||
|
/*!
|
||||||
|
|
||||||
|
*/
|
||||||
|
typedef ModularTraits::Residue_type result_type;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
|
||||||
|
*/
|
||||||
|
typedef ModularTraits::Type argument_type;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
|
||||||
|
computes \f$ \varphi(x)\f$.
|
||||||
|
|
||||||
|
*/
|
||||||
|
result_type
|
||||||
|
operator()(const argument_type & x);
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
|
||||||
|
}; /* end ModularTraits::ModularImage */
|
||||||
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup PkgModularArithmeticConcepts
|
||||||
|
\cgalconcept
|
||||||
|
|
||||||
|
This `AdaptableUnaryFunction` returns a representative in the original type of a given modular image. More precisely, it implements the \f$ right inverse\f$ of a proper restriction of the homomorphism \f$ \varphi\f$, which is implemented by `ModularTraits::ModularImage`.
|
||||||
|
|
||||||
|
\refines ::AdaptableUnaryFunction
|
||||||
|
|
||||||
|
\sa `ModularTraits`
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ModularTraits::ModularImageRepresentative {
|
||||||
|
public:
|
||||||
|
|
||||||
|
/// \name Types
|
||||||
|
/// @{
|
||||||
|
|
||||||
|
/*!
|
||||||
|
|
||||||
|
*/
|
||||||
|
typedef ModularTraits::Type result_type;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
|
||||||
|
*/
|
||||||
|
typedef ModularTraits::Residue_type argument_type;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
|
||||||
|
computes \f$ \varphi^{-1}(x)\f$.
|
||||||
|
|
||||||
|
*/
|
||||||
|
result_type
|
||||||
|
operator()(const argument_type &x);
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
|
||||||
|
}; /* end ModularTraits::ModularImageRepresentative */
|
||||||
|
|
||||||
|
|
@ -1,152 +1,68 @@
|
||||||
/// \ingroup PkgModularArithmeticConcepts
|
|
||||||
///
|
/*!
|
||||||
/// A model of `ModularTraits` is associated to a specific `Type`.
|
\ingroup PkgModularArithmeticConcepts
|
||||||
/// In case this associated type is `Modularizable`, this is indicated by the
|
\cgalconcept
|
||||||
/// boolean tag `Is_modularizable`. The mapping into the `Residue_type` is
|
|
||||||
/// provided by the functor `Modular_image`.
|
A model of `ModularTraits` is associated to a specific `Type`.
|
||||||
///
|
In case this associated type is `Modularizable`, this is indicated by the
|
||||||
/// A model of `ModularTraits` is supposed to provide:
|
boolean tag `Is_modularizable`. The mapping into the `Residue_type` is
|
||||||
///
|
provided by the functor `Modular_image`.
|
||||||
/// \hasModel CGAL::Modular_traits
|
|
||||||
///
|
\hasModel CGAL::Modular_traits<T>
|
||||||
/// \sa `CGAL::Residue`
|
|
||||||
/// \sa `Modularizable`
|
\sa `CGAL::Residue`
|
||||||
///
|
\sa `Modularizable`
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
class ModularTraits {
|
class ModularTraits {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// \ingroup PkgModularArithmeticConcepts
|
|
||||||
///
|
|
||||||
/// This `AdaptableUnaryFunction` computes the modular image of the given value
|
|
||||||
/// with respect to a homomorphism \f$\phi\f$ from the
|
|
||||||
/// `ModularTraits::Type` into the `ModularTraits::Residue_type`.
|
|
||||||
/// The homomorphism preserves the mapping of `int` into both types
|
|
||||||
/// , i.e., \f$\phi(Type(i)) == Residue_type(i)\f$.
|
|
||||||
///
|
|
||||||
/// \refines ::AdaptableUnaryFunction
|
|
||||||
///
|
|
||||||
/// \sa `ModularTraits`
|
|
||||||
class ModularImage {
|
|
||||||
public:
|
|
||||||
|
|
||||||
/// \name Types
|
/// \name Types
|
||||||
|
/// A model of `ModularTraits` is supposed to provide:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
The associated type.
|
||||||
*/
|
|
||||||
typedef ModularTraits::Residue_type result_type;
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
/*!
|
|
||||||
|
|
||||||
*/
|
|
||||||
typedef ModularTraits::Type argument_type;
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
/*!
|
|
||||||
computes \f$\phi(x)\f$.
|
|
||||||
*/
|
|
||||||
|
|
||||||
result_type
|
|
||||||
operator()(const argument_type & x);
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
}; /* concept ModularTraits::ModularImage */
|
|
||||||
|
|
||||||
/// \ingroup PkgModularArithmeticConcepts
|
|
||||||
///
|
|
||||||
/// This `AdaptableUnaryFunction` returns a representative in the
|
|
||||||
/// original type of a given modular image. More precisely, it
|
|
||||||
/// implements the \f$right inverse\f$ of a proper restriction of the
|
|
||||||
/// homomorphism \f$\phi\f$, which is implemented by
|
|
||||||
/// `ModularTraits::ModularImage`.
|
|
||||||
///
|
|
||||||
///
|
|
||||||
/// \refines ::AdaptableUnaryFunction
|
|
||||||
/// \sa `ModularTraits`
|
|
||||||
///
|
|
||||||
class ModularImageRepresentative {
|
|
||||||
public:
|
|
||||||
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
/*!
|
|
||||||
|
|
||||||
*/
|
|
||||||
typedef ModularTraits::Type result_type;
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
/*!
|
|
||||||
|
|
||||||
*/
|
|
||||||
typedef ModularTraits::Residue_type argument_type;
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
/*!
|
|
||||||
computes \f$\phi^{-1}(x)\f$.
|
|
||||||
*/
|
|
||||||
result_type
|
|
||||||
operator()(const argument_type &x);
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
}; /* concept ModularTraits::ModularImageRepresentative */
|
|
||||||
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
/*!
|
|
||||||
The associated type.
|
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Type ;
|
typedef Hidden_type Type ;
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
Tag indicating whether the associated type is modularizable.
|
Tag indicating whether the associated type is modularizable.
|
||||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
|
||||||
|
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Is_modularizable;
|
typedef Hidden_type Is_modularizable;
|
||||||
/// @}
|
|
||||||
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
The type of the modular image.
|
The type of the modular image.
|
||||||
In case the type is not `Modularizable` this is undefined.
|
|
||||||
|
In case the type is not `Modularizable` this is undefined.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Residue_type;
|
typedef Hidden_type Residue_type;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// \name Functors
|
/// \name Functors
|
||||||
/// In case the associated type is `Modularizable` all functors are provided.
|
/// In case the associated type is `Modularizable` all functors are
|
||||||
/// In case a functor is not provided, it is set to `CGAL::Null_functor`.
|
/// provided. In case a functor is not provided, it is set to
|
||||||
|
/// `CGAL::Null_functor`.
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
A model of `ModularTraits::ModularImage`
|
A model of `ModularTraits::ModularImage`
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Modular_image;
|
typedef Hidden_type Modular_image;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
A model of `ModularTraits::ModularImageRepresentative`
|
A model of `ModularTraits::ModularImageRepresentative`
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Modular_image_representative;
|
typedef Hidden_type Modular_image_representative;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
}; /* concept ModularTraits */
|
}; /* end ModularTraits */
|
||||||
///
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1,45 @@
|
||||||
/// \ingroup PkgModularArithmeticConcepts
|
|
||||||
/// Definition
|
/*!
|
||||||
/// --------------
|
\ingroup PkgModularArithmeticConcepts
|
||||||
///
|
\cgalconcept
|
||||||
/// An algebraic structure is called `Modularizable`, if there is a suitable mapping
|
|
||||||
/// into an algebraic structure which is based on the type `CGAL::Residue`.
|
An algebraic structure is called `Modularizable`, if there is a suitable mapping
|
||||||
/// For scalar types, e.g. Integers, this mapping is just the canonical homomorphism
|
into an algebraic structure which is based on the type `CGAL::Residue`.
|
||||||
/// into the type `CGAL::Residue` with respect to the current prime.
|
For scalar types, e.g. Integers, this mapping is just the canonical homomorphism
|
||||||
/// For compound types, e.g. Polynomials,
|
into the type `CGAL::Residue` with respect to the current prime.
|
||||||
/// the mapping is applied to the coefficients of the compound type.
|
For compound types, e.g. Polynomials,
|
||||||
/// The mapping is provided via `CGAL::Modular_traits<Modularizable>`,
|
the mapping is applied to the coefficients of the compound type.
|
||||||
/// being a model of `ModularTraits`.
|
|
||||||
/// Note that types representing rationals, or types which do have some notion
|
The mapping is provided via `CGAL::Modular_traits<Modularizable>`,
|
||||||
/// of denominator, are not `Modularizable`.
|
being a model of `ModularTraits`.
|
||||||
/// This is due to the fact that the denominator may be zero modulo the prime,
|
|
||||||
/// which can not be represented.
|
Note that types representing rationals, or types which do have some notion
|
||||||
///
|
of denominator, are not `Modularizable`.
|
||||||
///
|
This is due to the fact that the denominator may be zero modulo the prime,
|
||||||
/// Has Models
|
which can not be represented.
|
||||||
/// --------------
|
|
||||||
///
|
\hasModel int
|
||||||
/// `int`
|
\hasModel long
|
||||||
/// `long`
|
\hasModel CORE::BigInt
|
||||||
/// `CORE::BigInt`
|
\hasModel CGAL::Gmpz
|
||||||
/// `CGAL::Gmpz`
|
\hasModel leda::integer
|
||||||
/// `leda::integer`
|
\hasModel mpz_class
|
||||||
/// `mpz_class`
|
|
||||||
/// The following types are `Modularizable` iff their template arguments are.
|
The following types are `Modularizable` iff their template arguments are.
|
||||||
/// `CGAL::Lazy_exact_nt<NT>`
|
|
||||||
/// `CGAL::Sqrt_extension<NT,ROOT>`
|
\hasModel CGAL::Lazy_exact_nt<NT>
|
||||||
/// `CGAL::Polynomial<Coeff>`
|
\hasModel CGAL::Sqrt_extension<NT,ROOT>
|
||||||
/// See Also
|
\hasModel CGAL::Polynomial<Coeff>
|
||||||
/// --------------
|
|
||||||
/// `CGAL::Residue`
|
\sa `CGAL::Residue`
|
||||||
/// `CGAL::Modular_traits<T>`
|
\sa `CGAL::Modular_traits<T>`
|
||||||
///
|
|
||||||
/// }; /* concept Modularizable */
|
*/
|
||||||
|
|
||||||
class Modularizable {
|
class Modularizable {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
}; /* concept Modularizable */
|
/// @}
|
||||||
///
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}; /* end Modularizable */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
/*!
|
/*!
|
||||||
\page chap:modular_arithmetic Modular Arithmetic
|
|
||||||
|
\mainpage Modular Arithmetic
|
||||||
|
|
||||||
\authors Michael Hemmer and Sylvain Pion
|
\authors Michael Hemmer and Sylvain Pion
|
||||||
\par Reference Manual:
|
|
||||||
\ref PkgModularArithmetic
|
|
||||||
|
|
||||||
# Introduction #
|
# Introduction #
|
||||||
|
|
||||||
|
|
@ -15,17 +16,16 @@ possible to exclude that some value is zero by computing its modular
|
||||||
correspondent with respect to one prime only.
|
correspondent with respect to one prime only.
|
||||||
|
|
||||||
First of all, this package introduces a type `CGAL::Residue`.
|
First of all, this package introduces a type `CGAL::Residue`.
|
||||||
It represents \f$Z_/pZ\f$ for some prime \f$p\f$.
|
It represents \f$ \Z_{/p\Z}\f$ for some prime \f$ p\f$.
|
||||||
The prime number \f$p\f$ is stored in a static member variable.
|
The prime number \f$ p\f$ is stored in a static member variable.
|
||||||
The class provides static member functions to change this value.
|
The class provides static member functions to change this value.
|
||||||
<B>Note that changing the prime invalidates already existing objects
|
<B>Note that changing the prime invalidates already existing objects
|
||||||
of this type.</B>
|
of this type.</B>
|
||||||
|
|
||||||
However, already existing objects do not lose their value with respect to the
|
However, already existing objects do not lose their value with respect to the
|
||||||
old prime and can be reused after restoring the old prime.
|
old prime and can be reused after restoring the old prime.
|
||||||
Since the type is based on double
|
Since the type is based on double
|
||||||
arithmetic the prime is restricted to values less than \f$2^26\f$.
|
arithmetic the prime is restricted to values less than \f$ 2^{26}\f$.
|
||||||
The initial value of \f$p\f$ is 67111067.
|
The initial value of \f$ p\f$ is 67111067.
|
||||||
|
|
||||||
Please note that the implementation of class `CGAL::Residue` requires a mantissa
|
Please note that the implementation of class `CGAL::Residue` requires a mantissa
|
||||||
precision according to the IEEE Standard for Floating-Point Arithmetic (IEEE 754).
|
precision according to the IEEE Standard for Floating-Point Arithmetic (IEEE 754).
|
||||||
|
|
@ -35,9 +35,7 @@ any arithmetic operations. Moreover, it is required that numbers are rounded to
|
||||||
next nearest value. This can be ensured using `CGAL::Protect_FPU_rounding` with
|
next nearest value. This can be ensured using `CGAL::Protect_FPU_rounding` with
|
||||||
`CGAL_FE_TONEAREST`, which also enforces the required precision as a side effect.
|
`CGAL_FE_TONEAREST`, which also enforces the required precision as a side effect.
|
||||||
|
|
||||||
\beginadvanced
|
\advanced In case the flag `CGAL_HAS_THREADS`
|
||||||
|
|
||||||
In case the flag `CGAL_HAS_THREADS`
|
|
||||||
is undefined the prime is just stored in a static member
|
is undefined the prime is just stored in a static member
|
||||||
of the class, that is, `CGAL::Residue` is not thread-safe in this case.
|
of the class, that is, `CGAL::Residue` is not thread-safe in this case.
|
||||||
In case `CGAL_HAS_THREADS`
|
In case `CGAL_HAS_THREADS`
|
||||||
|
|
@ -46,15 +44,12 @@ the implementation of the class is thread safe using
|
||||||
penalty. Hence, it may be advisable to configure \cgal with
|
penalty. Hence, it may be advisable to configure \cgal with
|
||||||
`CGAL_HAS_NO_THREADS`.
|
`CGAL_HAS_NO_THREADS`.
|
||||||
|
|
||||||
\endadvanced
|
|
||||||
|
|
||||||
Moreover, the package introduces the concept `Modularizable`.
|
Moreover, the package introduces the concept `Modularizable`.
|
||||||
An algebraic structure `T` is considered as `Modularizable` if there
|
An algebraic structure `T` is considered as `Modularizable` if there
|
||||||
is a mapping from `T` into an algebraic structure that is based on
|
is a mapping from `T` into an algebraic structure that is based on
|
||||||
the type `CGAL::Residue`.
|
the type `CGAL::Residue`.
|
||||||
|
|
||||||
For scalar types, e.g. Integers, this mapping is just the canonical
|
For scalar types, e.g. Integers, this mapping is just the canonical
|
||||||
homomorphism into \f$Z_/pZ\f$ represented by `CGAL::Residue`.
|
homomorphism into \f$ \Z_{/p\Z}\f$ represented by `CGAL::Residue`.
|
||||||
For compound types, e.g. Polynomials, the mapping is applied to the
|
For compound types, e.g. Polynomials, the mapping is applied to the
|
||||||
coefficients of the compound type.
|
coefficients of the compound type.
|
||||||
The mapping is provided by the class `CGAL::Modular_traits<T>`.
|
The mapping is provided by the class `CGAL::Modular_traits<T>`.
|
||||||
|
|
@ -65,15 +60,16 @@ The class `CGAL::Modular_traits<T>` is designed such that the concept
|
||||||
## Example ##
|
## Example ##
|
||||||
|
|
||||||
In the following example modular arithmetic is used as a filter.
|
In the following example modular arithmetic is used as a filter.
|
||||||
\cgalexample{Modular_arithmetic/modular_filter.cpp}
|
\cgalexample{modular_filter.cpp}
|
||||||
|
|
||||||
# Design and Implementation History #
|
# Design and Implementation History #
|
||||||
|
|
||||||
The class `CGAL::Residue` is based on the C-code of Sylvain Pion et. al.
|
The class `CGAL::Residue` is based on the C-code of Sylvain Pion et. al.
|
||||||
as it was presented in \cite bepp-sdrns-99.
|
as it was presented in \cite bepp-sdrns-99.
|
||||||
|
|
||||||
The remaining part of the package is the result of the integration process
|
The remaining part of the package is the result of the integration process
|
||||||
of the NumeriX library of <span class="textsc">Exacus</span> \cite beh-eeeafcs-05 into \cgal.
|
of the NumeriX library of <span class="textsc">Exacus</span> \cite beh+-eeeafcs-05 into \cgal.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
} // namespace CGAL
|
} /* namespace CGAL */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
|
||||||
|
|
||||||
|
/// \defgroup PkgModularArithmetic Modular Arithmetic
|
||||||
|
/// \defgroup PkgModularArithmeticConcepts Concepts
|
||||||
|
/// \ingroup PkgModularArithmetic
|
||||||
|
/*!
|
||||||
|
\addtogroup PkgModularArithmetic
|
||||||
|
\todo check generated documentation
|
||||||
|
\PkgDescriptionBegin{Modular Arithmetic }
|
||||||
|
\PkgPicture{Modular_arithmetic.png}
|
||||||
|
\PkgAuthor{Michael Hemmer and Sylvain Pion}
|
||||||
|
\PkgDesc{This package provides arithmetic over finite fields. The provided tools are in particular useful for filters based on modular arithmetic and algorithms based on Chinese remainder. }
|
||||||
|
\PkgSince{3.4}
|
||||||
|
\cgalbib{ cgal:h-ma-12 }
|
||||||
|
\license{ \ref licensesLGPL }
|
||||||
|
\PkgDescriptionEnd
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
/// \defgroup PkgModularArithmetic Modular Arithmetic
|
|
||||||
/// \defgroup PkgModularArithmeticConcepts Concepts
|
|
||||||
/// \ingroup PkgModularArithmetic
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\addtogroup PkgModularArithmetic
|
|
||||||
<table cellpadding="2" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td colspan="2"><h1>Modular Arithmetic </h1></td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2">\image html Modular_arithmetic.png "" </td>
|
|
||||||
<td>
|
|
||||||
\par Michael Hemmer
|
|
||||||
|
|
||||||
\par "" This package provides arithmetic over finite fields. The provided tools are in particular useful for filters based on modular arithmetic and algorithms based on Chinese remainder.
|
|
||||||
|
|
||||||
\since \cgal 3.4
|
|
||||||
|
|
||||||
\cgalbib{cgal:h-ma-12}
|
|
||||||
|
|
||||||
\license{ \ref licensesLGPL "LGPL" }
|
|
||||||
|
|
||||||
\par Resources:
|
|
||||||
\ref chap:modular_arithmetic "User Manual"
|
|
||||||
</td>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
# Classified Reference Pages #
|
|
||||||
|
|
||||||
## Concepts ##
|
|
||||||
|
|
||||||
- `Modularizable`
|
|
||||||
- `ModularTraits`
|
|
||||||
- `ModularTraits::ModularImage`
|
|
||||||
- `ModularTraits::ModularImageRepresentative`
|
|
||||||
|
|
||||||
## Types ##
|
|
||||||
|
|
||||||
- `CGAL::Residue`
|
|
||||||
- `CGAL::Modular_traits<T>`
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue