mirror of https://github.com/CGAL/cgal
Modular_traits::Modular_image_inv -> Modular_image_representative
This commit is contained in:
parent
ccf81d34ec
commit
cf7e170ec8
|
|
@ -2499,7 +2499,7 @@ Modular_arithmetic/doc_tex/Modular_arithmetic/PkgDescription.tex -text
|
|||
Modular_arithmetic/doc_tex/Modular_arithmetic/main.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/ModularTraits_ModularImageInverse.tex -text
|
||||
Modular_arithmetic/doc_tex/Modular_arithmetic_ref/ModularTraits_ModularImageRepresentative.tex -text
|
||||
Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Modular_traits.tex -text
|
||||
Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Modularizable.tex -text
|
||||
Modular_arithmetic/doc_tex/Modular_arithmetic_ref/Residue.tex -text
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ void test_CR_for(const NT& f){
|
|||
typedef CGAL::Modular_traits<NT> MT;
|
||||
typedef typename CGAL::Modular_traits<NT>::Residue_type MNT;
|
||||
typename MT::Modular_image modular_image;
|
||||
typename MT::Modular_image_inv modular_image_inv;
|
||||
typename MT::Modular_image_representative modular_image_representative;
|
||||
|
||||
|
||||
typedef CGAL::Chinese_remainder_traits<NT> CRT;
|
||||
|
|
@ -98,7 +98,7 @@ void test_CR_for(const NT& f){
|
|||
// init chinese remainder
|
||||
q = current_prime = CGAL::CGALi::primes[prime_index];
|
||||
CGAL::Residue::set_current_prime(current_prime);
|
||||
g_old = modular_image_inv(modular_image(f));
|
||||
g_old = modular_image_representative(modular_image(f));
|
||||
pq= p = q;
|
||||
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ void test_CR_for(const NT& f){
|
|||
CGAL::Residue::set_current_prime(current_prime);
|
||||
p = current_prime;
|
||||
|
||||
chinese_remainder(q,g_old,p,modular_image_inv(modular_image(f)),pq,g);
|
||||
chinese_remainder(q,g_old,p,modular_image_representative(modular_image(f)),pq,g);
|
||||
|
||||
try{
|
||||
test = g != g_old;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ 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} }
|
||||
\ccNestedType{Modular_image_representative}
|
||||
{A model of \ccc{ModularTraits::ModularImageRepresentative} }
|
||||
|
||||
\ccHasModels
|
||||
\ccRefIdfierPage{CGAL::Modular_traits<T>}\\
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
\begin{ccRefFunctionObjectConcept}{ModularTraits::ModularImageInverse}
|
||||
|
||||
\ccDefinition
|
||||
|
||||
This \ccc{AdaptableUnaryFunction} implements a $right inverse$ of the
|
||||
homomorphism $\varphi$, which is implemented by \ccc{ModularTraits::ModularImage}.
|
||||
|
||||
\ccTypes
|
||||
\ccTypedef{typedef ModularTraits::Type result_type;}{}
|
||||
\ccTypedef{typedef ModularTraits::Residue_type argument_type;}{}
|
||||
|
||||
\ccCreationVariable{fo}
|
||||
|
||||
\ccMethod{
|
||||
result_type
|
||||
operator()(const argument_type &x);}{
|
||||
computes $\varphi^{-1}(x)$.
|
||||
}
|
||||
|
||||
\ccRefines
|
||||
\ccc{AdaptableUnaryFunction}
|
||||
|
||||
\ccSeeAlso
|
||||
\ccRefConceptPage{ModularTraits}
|
||||
|
||||
\end{ccRefFunctionObjectConcept}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
\begin{ccRefFunctionObjectConcept}{ModularTraits::ModularImageRepresentative}
|
||||
|
||||
\ccDefinition
|
||||
|
||||
This \ccc{AdaptableUnaryFunction} returns a representative in the original type of a given modular image. More precisely, it implements the $right inverse$ of a proper restriction of the homomorphism $\varphi$, which is implemented by \ccc{ModularTraits::ModularImage}.
|
||||
|
||||
\ccTypes
|
||||
\ccTypedef{typedef ModularTraits::Type result_type;}{}
|
||||
\ccTypedef{typedef ModularTraits::Residue_type argument_type;}{}
|
||||
|
||||
\ccCreationVariable{fo}
|
||||
|
||||
\ccMethod{
|
||||
result_type
|
||||
operator()(const argument_type &x);}{
|
||||
computes $\varphi^{-1}(x)$.
|
||||
}
|
||||
|
||||
\ccRefines
|
||||
\ccc{AdaptableUnaryFunction}
|
||||
|
||||
\ccSeeAlso
|
||||
\ccRefConceptPage{ModularTraits}
|
||||
|
||||
\end{ccRefFunctionObjectConcept}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
\ccRefConceptPage{Modularizable}\\
|
||||
\ccRefConceptPage{ModularTraits}\\
|
||||
\ccRefConceptPage{ModularTraits::ModularImage}\\
|
||||
\ccRefConceptPage{ModularTraits::ModularImageInverse}\\
|
||||
\ccRefConceptPage{ModularTraits::ModularImageRepresentative}\\
|
||||
|
||||
\subsection*{Types}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
\input{Modular_arithmetic_ref/Modularizable}
|
||||
\input{Modular_arithmetic_ref/ModularTraits}
|
||||
\input{Modular_arithmetic_ref/ModularTraits_ModularImage}
|
||||
\input{Modular_arithmetic_ref/ModularTraits_ModularImageInverse}
|
||||
\input{Modular_arithmetic_ref/ModularTraits_ModularImageRepresentative}
|
||||
\input{Modular_arithmetic_ref/Modular_traits}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public:
|
|||
typedef ::CGAL::Tag_false Is_modularizable;
|
||||
typedef ::CGAL::Null_functor Residue_type;
|
||||
typedef ::CGAL::Null_functor Modular_image;
|
||||
typedef ::CGAL::Null_functor Modular_image_inv;
|
||||
typedef ::CGAL::Null_functor Modular_image_representative;
|
||||
};
|
||||
|
||||
template <class NT>
|
||||
|
|
@ -74,7 +74,7 @@ public:
|
|||
return Residue_type(i);
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return x.get_value();
|
||||
}
|
||||
|
|
@ -98,7 +98,7 @@ public:
|
|||
return Residue_type(i);
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return NT(x.get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,14 +46,14 @@ void test_modular_traits(){
|
|||
typedef CGAL::Modular_traits<TESTT> MT;
|
||||
typedef typename MT::Residue_type Residue_type;
|
||||
typedef typename MT::Modular_image Modular_image;
|
||||
typedef typename MT::Modular_image_inv Modular_image_inv;
|
||||
typedef typename MT::Modular_image_representative Modular_image_representative;
|
||||
typedef typename MT::Is_modularizable Is_modularizable;
|
||||
typedef typename MT::NT NT;
|
||||
|
||||
assert(
|
||||
!(::boost::is_same<CGAL::Null_functor,Modular_image>::value));
|
||||
assert(
|
||||
!(::boost::is_same<CGAL::Null_functor,Modular_image_inv>::value));
|
||||
!(::boost::is_same<CGAL::Null_functor,Modular_image_representative>::value));
|
||||
assert(
|
||||
(::boost::is_same<CGAL::Tag_true,Is_modularizable>::value));
|
||||
assert(
|
||||
|
|
@ -69,8 +69,8 @@ void test_modular_traits(){
|
|||
assert(modular_image(TESTT(22)) == Residue_type(1));
|
||||
assert(modular_image(TESTT(777777722)) == Residue_type(1));
|
||||
|
||||
Modular_image_inv modular_image_inv;
|
||||
assert(modular_image_inv(modular_image(TESTT(20)))
|
||||
Modular_image_representative modular_image_representative;
|
||||
assert(modular_image_representative(modular_image(TESTT(20)))
|
||||
== TESTT(-1));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class Modular_traits< ::CORE::BigInt > {
|
|||
return Residue_type(mi);
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return NT(x.get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public:
|
|||
return num/den;
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return NT(x.get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ public:
|
|||
return num_m / den_m;
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return NT(x.get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ class Modular_traits< Gmpz > {
|
|||
return CGAL::Residue(int(mpz_get_si(tmp_1.mpz())));
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return NT(x.get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1362,7 +1362,7 @@ public:
|
|||
typedef ::CGAL::Tag_false Is_modularizable;
|
||||
typedef ::CGAL::Null_functor Residue_type;
|
||||
typedef ::CGAL::Null_functor Modular_image;
|
||||
typedef ::CGAL::Null_functor Modular_image_inv;
|
||||
typedef ::CGAL::Null_functor Modular_image_representative;
|
||||
};
|
||||
|
||||
template< typename ET >
|
||||
|
|
@ -1379,10 +1379,10 @@ public:
|
|||
return modular_image(a.exact());
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
typename MT_ET::Modular_image_inv modular_image_inv;
|
||||
return NT(modular_image_inv(x));
|
||||
typename MT_ET::Modular_image_representative modular_image_representative;
|
||||
return NT(modular_image_representative(x));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -880,7 +880,7 @@ struct Quotient_modular_traits_base{
|
|||
typedef ::CGAL::Tag_false Is_modularizable;
|
||||
typedef ::CGAL::Null_functor Residue_type;
|
||||
typedef ::CGAL::Null_functor Modular_image;
|
||||
typedef ::CGAL::Null_functor Modular_image_inv;
|
||||
typedef ::CGAL::Null_functor Modular_image_representative;
|
||||
};
|
||||
|
||||
template<typename RT>
|
||||
|
|
@ -899,7 +899,7 @@ public:
|
|||
return num / den;
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return NT(x.get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,10 +59,10 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& a){
|
||||
typename MT_ROOT::Modular_image_inv mod_image_inv_root;
|
||||
typename MT_COEFF::Modular_image_inv mod_image_inv_coeff;
|
||||
typename MT_ROOT::Modular_image_representative mod_image_inv_root;
|
||||
typename MT_COEFF::Modular_image_representative mod_image_inv_coeff;
|
||||
|
||||
if(a.is_extended()){
|
||||
return NT(
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ class Modular_traits< ::leda::integer > {
|
|||
return Residue_type ((a%NT(MOD::get_current_prime())).to_long());
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return NT(x.get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ public:
|
|||
return num/den;
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return NT(x.get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ public:
|
|||
return num_m/den_m;
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return NT(x.get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ public:
|
|||
return CGAL::Residue(int(mpz_get_si(tmp.get_mpz_t())));
|
||||
}
|
||||
};
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& x){
|
||||
return NT(x.get_value());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,12 +54,12 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
struct Modular_image_inv{
|
||||
struct Modular_image_representative{
|
||||
NT operator()(const Residue_type& p) const {
|
||||
std::vector<COEFF> V;
|
||||
typename Mtr::Modular_image_inv modular_image_inv;
|
||||
typename Mtr::Modular_image_representative modular_image_representative;
|
||||
for(int i=0; i<=p.degree();i++)
|
||||
V.push_back(modular_image_inv(p[i]));
|
||||
V.push_back(modular_image_representative(p[i]));
|
||||
return NT(V.begin(),V.end());
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ Polynomial<NT> modular_gcd_utcf_algorithm_M(
|
|||
// try chinese remainder
|
||||
|
||||
// std::cout <<" chinese remainder round :" << n << std::endl;
|
||||
typename CGAL::Modular_traits<Poly>::Modular_image_inv inv_map;
|
||||
typename CGAL::Modular_traits<Poly>::Modular_image_representative inv_map;
|
||||
if(n == 1){
|
||||
// init chinese remainder
|
||||
q = CGAL::Residue::get_current_prime(); // implicit !
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ Polynomial<NT> modular_gcd_utcf_dfai(
|
|||
|
||||
// --------------------------------------
|
||||
// try chinese remainder
|
||||
typename CGAL::Modular_traits<Poly>::Modular_image_inv inv_map;
|
||||
typename CGAL::Modular_traits<Poly>::Modular_image_representative inv_map;
|
||||
if(n == 1){
|
||||
// init chinese remainder
|
||||
q = CGAL::Residue::get_current_prime(); // implicit !
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ Polynomial<NT> modular_gcd_utcf_pure_wang(
|
|||
|
||||
// --------------------------------------
|
||||
// try chinese remainder
|
||||
typename CGAL::Modular_traits<Poly>::Modular_image_inv inv_map;
|
||||
typename CGAL::Modular_traits<Poly>::Modular_image_representative inv_map;
|
||||
|
||||
if(n == 1){
|
||||
// init chinese remainder and wang
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ Polynomial<NT> modular_gcd_utcf_with_wang(
|
|||
n++; // increase number of lucky primes
|
||||
}
|
||||
|
||||
typename CGAL::Modular_traits<Poly>::Modular_image_inv inv_map;
|
||||
typename CGAL::Modular_traits<Poly>::Modular_image_representative inv_map;
|
||||
|
||||
|
||||
// ----------------------------- Chinese Remainder ---------------------
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ Coeff resultant_modularize(
|
|||
typedef typename CGAL::Modular_traits<Scalar>::Residue_type MScalar;
|
||||
|
||||
typename CRT::Chinese_remainder chinese_remainder;
|
||||
typename CGAL::Modular_traits<Coeff>::Modular_image_inv inv_map;
|
||||
typename CGAL::Modular_traits<Coeff>::Modular_image_representative inv_map;
|
||||
|
||||
|
||||
typename PT::Degree_vector degree_vector;
|
||||
|
|
|
|||
Loading…
Reference in New Issue