diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Is_valid_functor.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Is_valid_functor.tex new file mode 100644 index 00000000000..aef7a0abd9f --- /dev/null +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Is_valid_functor.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunctionObjectClass}{Is_valid} + +\ccDefinition + +Not all values of a type need to be valid. The function object +class \ccRefName\ checks this. \\ + +For example, an expression like +\ccStyle{NT(0)/NT(0)} can result in an invalid number. +Routines may have as a precondition that all values are valid. + +\ccInclude{CGAL/utils_classes.h} + + +\ccIsModel +\ccRefConceptPage{AdaptableFunctor} + +\ccCreationVariable{operator()} +\ccMethod{bool operator()(const T& x);} +{returns if the argument is valid.} + +\end{ccRefFunctionObjectClass} \ No newline at end of file diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Max_functor.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Max_functor.tex new file mode 100644 index 00000000000..16aa13dc627 --- /dev/null +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Max_functor.tex @@ -0,0 +1,29 @@ +\begin{ccRefFunctionObjectClass}{Max} + +\ccDefinition + +The function object class \ccRefName\ returns the larger of two values. +The default value for \ccc{Compare} is \ccc{std::less}.\\ + +Note that \ccc{T} must be a model of \ccc{LessThanComparable} +in case \ccc{std::less} is used. + +\ccInclude{CGAL/utils_classes.h} + +\ccIsModel +\ccRefConceptPage{AdaptableFunctor} + +\ccCreation +\ccCreationVariable{max} +\ccConstructor{Max();}{ default constructor. } +\ccGlue +\ccConstructor{Max(Compare c);} + {The constructed object will use \ccc{c} to compare the arguments. } + +\ccOperations +\ccCreationVariable{operator()} +\ccMethod{T operator()(const T& x, const T& y);} +{returns the larger of \ccc{x} and \ccc{y}, +with respect to the order induced by \ccc{Compare}. } + +\end{ccRefFunctionObjectClass} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Min_functor.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Min_functor.tex new file mode 100644 index 00000000000..a46087425eb --- /dev/null +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Min_functor.tex @@ -0,0 +1,29 @@ +\begin{ccRefFunctionObjectClass}{Min} + +\ccDefinition + +The function object class \ccRefName\ returns the smaller of two values. +The default value for \ccc{Compare} is \ccc{std::less}.\\ + +Note that \ccc{T} must be a model of \ccc{LessThanComparable} +in case \ccc{std::less} is used. + +\ccInclude{CGAL/utils_classes.h} + +\ccIsModel +\ccRefConceptPage{AdaptableFunctor} + +\ccCreation +\ccCreationVariable{min} +\ccConstructor{Min();}{ default constructor. } +\ccGlue +\ccConstructor{Min(Compare c);} + {The constructed object will use \ccc{c} to compare the arguments. } + +\ccOperations +\ccCreationVariable{operator()} +\ccMethod{T operator()(const T& x, const T& y);} +{returns the larger of \ccc{x} and \ccc{y}, +with respect to the order induced by \ccc{Compare}. } + +\end{ccRefFunctionObjectClass} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/intro.tex b/Number_types/doc_tex/NumberTypeSupport_ref/intro.tex index 54296e77256..e33591d6591 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/intro.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/intro.tex @@ -56,4 +56,11 @@ \ccRefIdfierPage{CGAL::Root_of_traits_2}\\ \ccRefIdfierPage{CGAL::make_root_of_2}\\ +\subsection*{Utilities} +\ccRefIdfierPage{Min}\\ +\ccRefIdfierPage{Max}\\ +\ccRefIdfierPage{Is_valid}\\ +\ccRefIdfierPage{min}\\ +\ccRefIdfierPage{max}\\ +\ccRefIdfierPage{is_valid}\\ %% EOF \ No newline at end of file diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/is_valid.tex b/Number_types/doc_tex/NumberTypeSupport_ref/is_valid.tex new file mode 100644 index 00000000000..082cac2a6ea --- /dev/null +++ b/Number_types/doc_tex/NumberTypeSupport_ref/is_valid.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunction}{is_valid} + +\ccDefinition + +Not all values of a type need to be valid. +The function \ccRefName\ returns whether the argument is valid. + +\ccInclude{CGAL/utils.h} + +\ccFunction{bool is_valid(const T& x);}{} + +\ccSeeAlso + +\ccRefIdfierPage{Is_valid}\\ + +\end{ccRefFunction} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/main.tex b/Number_types/doc_tex/NumberTypeSupport_ref/main.tex index b91cf44cf58..0880e580166 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/main.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/main.tex @@ -32,6 +32,14 @@ \input{NumberTypeSupport_ref/Number_type_checker.tex} \input{NumberTypeSupport_ref/Sqrt_extension.tex} +%functors +\input{NumberTypeSupport_ref/Max_functor.tex} +\input{NumberTypeSupport_ref/Min_functor.tex} +\input{NumberTypeSupport_ref/Is_valid_functor.tex} +%functions +\input{NumberTypeSupport_ref/max.tex} +\input{NumberTypeSupport_ref/min.tex} +\input{NumberTypeSupport_ref/is_valid.tex} \input{NumberTypeSupport_ref/Rational_traits.tex } \input{NumberTypeSupport_ref/simplest_rational_in_interval.tex } diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/max.tex b/Number_types/doc_tex/NumberTypeSupport_ref/max.tex new file mode 100644 index 00000000000..6196ee656a5 --- /dev/null +++ b/Number_types/doc_tex/NumberTypeSupport_ref/max.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunction}{max} + +\ccDefinition + +The function \ccRefName\ returns the larger of two values. + +\ccInclude{CGAL/utils.h} + +\ccFunction{T max(const T& x, const T& y);}{} + +\ccRefIdfierPage{Max}\\ + +\end{ccRefFunction} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/min.tex b/Number_types/doc_tex/NumberTypeSupport_ref/min.tex new file mode 100644 index 00000000000..149348b30ee --- /dev/null +++ b/Number_types/doc_tex/NumberTypeSupport_ref/min.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunction}{min} + +\ccDefinition + +The function \ccRefName\ returns the smaller of two values. + +\ccInclude{CGAL/utils.h} + +\ccFunction{T min(const T& x, const T& y);}{} + +\ccSeeAlso + +\ccRefIdfierPage{Min}\\ + +\end{ccRefFunction}