diff --git a/.gitattributes b/.gitattributes index ece6ccd78f5..ad95c0a37b8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,13 +14,16 @@ Algebraic_foundations/doc_tex/Algebraic_foundations_ref/AlgebraicStructureTraits Algebraic_foundations/doc_tex/Algebraic_foundations_ref/AlgebraicStructureTraits_Sqrt.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/AlgebraicStructureTraits_Square.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/AlgebraicStructureTraits_UnitPart.tex -text +Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Coercion_traits.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/EuclideanRing.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Euclidean_ring_tag.tex -text +Algebraic_foundations/doc_tex/Algebraic_foundations_ref/ExplicitInteroperable.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Field.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithSqrt.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Field_tag.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Field_with_sqrt_tag.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FromSmallIntConstructible.tex -text +Algebraic_foundations/doc_tex/Algebraic_foundations_ref/ImplicitInteroperable.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/IntegralDomain.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/IntegralDomainWithoutDiv.tex -text Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Integral_domain_tag.tex -text diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Coercion_traits.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Coercion_traits.tex new file mode 100644 index 00000000000..68dd673da1a --- /dev/null +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Coercion_traits.tex @@ -0,0 +1,33 @@ +\begin{ccRefClass}{Coercion_traits} + +\ccDefinition + +An instance of \ccClassTemplateName\ refelcts the type coercion of the types +{\sc A} and {\sc B}, it is symmetric in the two template arguments. + +\ccInclude{CGAL/Coercion_traits.h} + +\ccTypes +%======= + +%\ccThreeToTwo + +\ccNestedType{Explicit_interoperable} + { Tag indicating whether the two types A and B are a model of \ccc{ExplicitInteroperable} \\ + This is either \ccc{CGAL::Tag_true} or \ccc{CGAL::Tag_false}. } +\ccNestedType{Implicit_interoperable} + { Tag indicating whether the two types A and B are a model of \ccc{ImplicitInteroperable} \\ + This is either \ccc{CGAL::Tag_true} or \ccc{CGAL::Tag_false}. } + +\ccNestedType{RET} + {The coercion type of {\sc A} and {\sc B}. \\ + In case A and B are not \ccc{ExplicitInteroperable} this is undefined. } +\ccNestedType{Cast} + {A model of the \ccc{AdaptableFunctor} concept, providing the conversion of {\sc A} or {\sc B} to {\sc RET}. \\ + In case A and B are not \ccc{ExplicitInteroperable} this is undefined. } + + +\ccSeeAlso +\ccRefConceptPage{UFDomain} \\ +\ccRefConceptPage{AlgebraicStructureTraits}\\ +\end{ccRefClass} \ No newline at end of file diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/ExplicitInteroperable.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/ExplicitInteroperable.tex new file mode 100644 index 00000000000..e8bfeb186d2 --- /dev/null +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/ExplicitInteroperable.tex @@ -0,0 +1,18 @@ +\begin{ccRefConcept}{ExplicitInteroperable} + +\ccDefinition + +Two types A and B are a model of the \ccc{ExplicitInteroperable} concept, +if it is possible to derive a superior type for A and B, such that both +types are embeddable into this type. +This type is \ccc{Coercion_traits::RET}. + +In this case \ccc{Coercion_traits::Explicit_interoperable} +is \ccc{Tag_true}. + + +\ccSeeAlso +\ccRefIdfierPage{Coercion_traits}\\ +\ccRefIdfierPage{ImplicitInteroperable}\\ + +\end{ccRefConcept} diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/ImplicitInteroperable.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/ImplicitInteroperable.tex new file mode 100644 index 00000000000..72a1946ed9c --- /dev/null +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/ImplicitInteroperable.tex @@ -0,0 +1,23 @@ +\begin{ccRefConcept}{ImplicitInteroperable} + +\ccDefinition + +Two types A and B are a model of the \ccc{ImplicitInteroperable} concept, +in case there is a superior type, such that binary arithmetic operations +involing A and B result in this type. +This type is \ccc{Coercion_traits::RET}. + +The supported binary operations are exactly the ones provided by +\ccc{Coercion_traits::RET} itself. + +In this case \ccc{Coercion_traits::Implicit_interoperable} +is \ccc{Tag_true}. + +\ccRefines + \ccc{ExplicitInteroperable} + +\ccSeeAlso +\ccRefIdfierPage{Coercion_traits}\\ +\ccRefIdfierPage{ExplicitInteroperable}\\ + +\end{ccRefConcept} diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/intro.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/intro.tex index 2a04c762a44..51f2a57fd3b 100755 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/intro.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/intro.tex @@ -121,3 +121,10 @@ Question: moved it to a global place? \ccRefIdfierPage{to_double}\\ \ccRefIdfierPage{to_interval}\\ + +\subsection*{Interoparbility of Types} +\subsubsection*{Concepts} +\ccRefConceptPage{ExplicitInteroperable}\\ +\ccRefConceptPage{InplicitInteroperable}\\ +\subsubsection*{Classes} +\ccRefIdfierPage{Coercion_traits}\\ diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/main.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/main.tex index 1c64d7d5ae0..0276349e784 100755 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/main.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/main.tex @@ -74,4 +74,10 @@ \input{Algebraic_foundations_ref/is_negative.tex} \input{Algebraic_foundations_ref/compare.tex} \input{Algebraic_foundations_ref/to_double.tex} -\input{Algebraic_foundations_ref/to_interval.tex} \ No newline at end of file +\input{Algebraic_foundations_ref/to_interval.tex} + +%Coercion_traits +%concepts: +\input{Algebraic_foundations_ref/ExplicitInteroperable.tex} +\input{Algebraic_foundations_ref/ImplicitInteroperable.tex} +\input{Algebraic_foundations_ref/Coercion_traits.tex} \ No newline at end of file