diff --git a/.gitattributes b/.gitattributes index 052b0e6afb3..53334b34d9f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1397,6 +1397,13 @@ Modifier/doc_tex/Modifier/idraw/modifier.eps -text svneol=unset#application/post Modifier/doc_tex/Modifier/idraw/modifier.pdf -text svneol=unset#application/pdf Modifier/doc_tex/Modifier/modifier.gif -text svneol=unset#image/gif Modifier/doc_tex/Modifier/modifier_small.gif -text svneol=unset#image/gif +Modular_arithmetic/doc_tex/Modular_arithmetic/main.tex -text +Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Modular.tex -text +Modular_arithmetic/doc_tex/Modular_arithmetic_ref/ModularTraits.tex -text +Modular_arithmetic/doc_tex/Modular_arithmetic_ref/ModularTraits_ModularImage.tex -text +Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Modularizable.tex -text +Modular_arithmetic/doc_tex/Modular_arithmetic_ref/intro.tex -text +Modular_arithmetic/doc_tex/Modular_arithmetic_ref/main.tex -text Modular_arithmetic/test/Modular_arithmetic/Modular_traits.C -text Nef_2/demo/Nef_2/filtered_homogeneous_data/complex.nef -text svneol=native#application/octet-stream Nef_2/demo/Nef_2/filtered_homogeneous_data/symmdif.nef -text svneol=native#application/octet-stream diff --git a/Modular_arithmetic/doc_tex/Modular_arithmetic/main.tex b/Modular_arithmetic/doc_tex/Modular_arithmetic/main.tex new file mode 100644 index 00000000000..4ba86316d85 --- /dev/null +++ b/Modular_arithmetic/doc_tex/Modular_arithmetic/main.tex @@ -0,0 +1,4 @@ +\cleardoublepage +\ccUserChapter{Modular Arithmetic} +\label{chap:modular_arithmetic} +\ccChapterAuthor{Michael Hemmer} \ No newline at end of file diff --git a/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Modular.tex b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Modular.tex new file mode 100644 index 00000000000..991b93256e1 --- /dev/null +++ b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Modular.tex @@ -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} diff --git a/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/ModularTraits.tex b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/ModularTraits.tex new file mode 100644 index 00000000000..0bc3222e5a9 --- /dev/null +++ b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/ModularTraits.tex @@ -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} diff --git a/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/ModularTraits_ModularImage.tex b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/ModularTraits_ModularImage.tex new file mode 100644 index 00000000000..a7248bccd80 --- /dev/null +++ b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/ModularTraits_ModularImage.tex @@ -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} \ No newline at end of file diff --git a/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Modularizable.tex b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Modularizable.tex new file mode 100644 index 00000000000..f50901a973e --- /dev/null +++ b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Modularizable.tex @@ -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}, +being a model of \ccc{ModularTraits}. + +\ccSeeAlso +\ccRefIdfierPage{Modular}\\ +\ccRefIdfierPage{ModularTraits}\\ + +\end{ccRefConcept} \ No newline at end of file diff --git a/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/intro.tex b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/intro.tex new file mode 100644 index 00000000000..26f9ad8ede4 --- /dev/null +++ b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/intro.tex @@ -0,0 +1,5 @@ +\section{Classified Reference Pages} + +\subsection*{Types} + + \ No newline at end of file diff --git a/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/main.tex b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/main.tex new file mode 100644 index 00000000000..48a09e9f076 --- /dev/null +++ b/Modular_arithmetic/doc_tex/Modular_arithmetic_ref/main.tex @@ -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} +