initial doc

This commit is contained in:
Michael Hemmer
2007-03-26 16:31:33 +00:00
parent d10a950784
commit e89fb16ade
8 changed files with 186 additions and 0 deletions
@@ -0,0 +1,71 @@
\begin{ccRefClass} {Modular}
\label{Modular}
\def\ccTagOperatorLayout{\ccFalse}
\ccDefinition
The class \ccRefName\ represents a finite field $\Z{/p\Z}$,
for some prime number $p$. \\
The prime number $p$ is stored in a static member variable.
The class provides static member functions to change this value.
{\bf Note that changing the prime invalidates already existing objects
of this type.}
However, already existing objects do not lose their value with respect to the
old prime and can be reused after restoring the old prime.
Since the type is base on double
arithmetic the prime is restricted to values less than $2^{26}$.
The initial value of $p$ is 67111067.
\ccInclude{CGAL/Modular.h}
\ccIsModel
\ccc{Field}\\
\ccCreation
\ccCreationVariable{x}
\ccConstructor{Modular();}
{introduces a variable \ccVar, which is initalized with zero;}
\ccGlue
\ccConstructor{Modular(const Modular& m);}
{copy constructor;}
\ccGlue
\ccConstructor{Modular(int i);}
{intorduces a variable \ccVar, which is initalized with $i \% p$;}
\ccGlue
\ccConstructor{Modular(long i);}
{intorduces a variable \ccVar, which is initalized with $i \% p$;}
\ccOperations
\ccMethod{static int set_current_prime(int p);}{
Static member function;\\
sets current prime to the given value and returns the old prime. }
\ccGlue
\ccMethod{static int get_current_prime();}{
Static member function;\\
returns the value of the current prime.
}
\ccGlue
\ccMethod{int get_value() const;}{
Returns the value of \ccVar.
}
\ccFunction{Modular operator+(const Modular&a);}{}\ccGlue
\ccFunction{Modular operator-(const Modular&a);}{}\ccGlue
\ccFunction{Modular operator+(const Modular&a,const Modular& b);}{}\ccGlue
\ccFunction{Modular operator-(const Modular&a,const Modular& b);}{}\ccGlue
\ccFunction{Modular operator*(const Modular&a,const Modular& b);}{}\ccGlue
\ccFunction{Modular operator/(const Modular&a,const Modular& b);}{}\ccGlue
\ccMethod{Modular & operator+=(const Modular& a);}{}\ccGlue
\ccMethod{Modular & operator-=(const Modular& a);}{}\ccGlue
\ccMethod{Modular & operator*=(const Modular& a);}{}\ccGlue
\ccMethod{Modular & operator/=(const Modular& a);}{}\ccGlue
\end{ccRefClass}
@@ -0,0 +1,42 @@
\begin{ccRefConcept}{ModularTraits}
\ccDefinition
A model of \ccc{ModularTraits} is associated to specific \ccc{Type}.
In case this type is \ccc{Modularizable}, this is indicated by the
and reflects the properties of this type with respect
to the concept \ccc{Modular}.
\ccTypes
A model of \ccc{ModularTraits} is supposed to provide:\\
\ccNestedType{Type }{The associated type.}
\ccGlue
\ccNestedType{Is_modularizable}{
Tag indicating whether the associated type is modularizable. \\
This is either \ccc{CGAL::Tag_true} or \ccc{CGAL::Tag_false}. }
\ccGlue
\ccNestedType{Modular_type}{
The type of the modular image. \\
In case the type is not \ccc{Modularizable} this is undefined.
}
\ccHeading{Functors}
In case the associated type is \ccc{Modularizable} all functors are provided.\\
In case a functor is not provided, it is set to \ccc{CGAL::Null_functor}.
\ccNestedType{Modular_image}{A model of \ccc{ModularTraits::ModularImage} }
\ccGlue
\ccNestedType{Modular_image_inverse}{A model of \ccc{ModularTraits::ModularImageInverse} }
\ccHasModels
\ccRefIdfierPage{Modular_traits}\\
\end{ccRefConcept}
@@ -0,0 +1,28 @@
\begin{ccRefFunctionObjectConcept}{ModularTraits::ModularImage}
\ccDefinition
This \ccc{AdaptableUnaryFunction} computes the modular image of the given value
with respect to the homomorphism $\varphi$ from the \ccc{ModularTraits::Type} into
\ccc{ModularTraits::Modular_type}.
The homomorphism preserves the mapping of \ccc{int} into both types
, i.e., $\varphi(Type(i)) == Modular\_type(i)$.
\ccTypes
\ccTypedef{typedef ModularTraits::Modular_type result_type;}{}
\ccTypedef{typedef ModularTraits::Modular_type argument_type;}{}
\ccCreationVariable{fo}
\ccMethod{
result_type
operator()(const argument_type &);}{
computes $\varphi(x)$.
}
\ccRefines
\ccc{AdaptableUnaryFunction}
\end{ccRefFunctionObjectConcept}
@@ -0,0 +1,18 @@
\begin{ccRefConcept}{Modularizable}
\ccDefinition
An algebraic structure is called \ccRefName, if there is an suitable mapping into
an algebraic structure, which is based on the type \ccc{CGAL::Modular}.
For scalar types, e.g. Integers, this mapping is just the kanonical homomorphism
into the type \ccc{CGAL::Modular}. For compount types, e.g. Polynomials,
the mapping is applied to the coefficient of the compount type.
The mapping is provided via \ccc{CGAL::Modular_traits<Modularizable>},
being a model of \ccc{ModularTraits}.
\ccSeeAlso
\ccRefIdfierPage{Modular}\\
\ccRefIdfierPage{ModularTraits}\\
\end{ccRefConcept}
@@ -0,0 +1,5 @@
\section{Classified Reference Pages}
\subsection*{Types}
@@ -0,0 +1,11 @@
\ccRefChapter{Modular Arithmetic }
\label{chap:modular_arithmetic_ref}
\ccChapterAuthor{Michael Hemmer}
\input{Modular_arithmetic_ref/intro}
\input{Modular_arithmetic_ref/Modular}
\input{Modular_arithmetic_ref/Modularizable}
\input{Modular_arithmetic_ref/ModularTraits}
\input{Modular_arithmetic_ref/ModularTraits_ModularImage}