cgal/Modular_arithmetic/doc_tex/Modular_arithmetic/main.tex

35 lines
1.5 KiB
TeX

\cleardoublepage
\ccUserChapter{Modular Arithmetic\label{chap:modular_arithmetic}}
\ccChapterAuthor{Michael Hemmer}
\input{Modular_arithmetic/PkgDescription.tex}
\section{Introduction}
Modular arithmetic is a fundamental tool in modern algebra systems. In conjunction with the Chinese remainder theorem it serves as the workhorse in several algorithms computing the gcd, resultant etc. Moreover, it can serve as a very efficient filter, since it is often possible to exclude that some value is zero by computing its modular correspondent with respect to one prime only.
This package introduces a type \ccc{CGAL::Modular}
representing a finite field over some prime.
The prime can be changed at runtime.
Moreover, the package introduces \ccc{CGAL::Modular_traits<T>}
providing a mapping from some algebraic structure \ccc{T} into an algebraic
structure that is based on the type \ccc{CGAL::Modular}.
For scalar types, e.g. Integers, this mapping is just the canonical homomorphism
into the type \ccc{CGAL::Modular}.
For compound types, e.g. Polynomials, the mapping is applied to the
coefficients of the compound type.
\section{Software Design}
The class \ccc{CGAL::Modular_traits<T>} is designed such that the concept
\ccc{Modularizable} can be considered as optional, i.e.,
\ccc{CGAL::Modular_traits<T>} provides a tag that can be used for dispatching.
\subsection{Examples}
In the following example the modular arithmetic is used as a filter.
\ccIncludeExampleCode{Modular_arithmetic/modular_filter.cpp}