diff --git a/.gitattributes b/.gitattributes index 04e75572f79..da48c3c0b24 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2918,7 +2918,6 @@ Polynomial/include/CGAL/Polynomial/hgdelta_update.h -text Polynomial/include/CGAL/Polynomial/may_have_common_factor.h -text Polynomial/include/CGAL/Polynomial/modular_filter.h -text Polynomial/include/CGAL/Polynomial/resultant.h -text -Polynomial/include/CGAL/Polynomial/square_free_factorization.h -text Polynomial/include/CGAL/Polynomial/square_free_factorize.h -text Polynomial/include/CGAL/Polynomial/sturm_habicht_sequence.h -text Polynomial/include/CGAL/Polynomial/subresultants.h -text diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2.h index 00537e6e2d2..17d2f5219c0 100755 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2.h @@ -726,7 +726,7 @@ public: OutputIterator1 fit, OutputIterator2 mit ) const { typename Polynomial_traits_2:: - Square_free_factorization_up_to_constant_factor factorize; + Square_free_factorize_up_to_constant_factor factorize; std::vector factors; int n_factors = factorize(ca.polynomial_2(), @@ -863,7 +863,7 @@ public: typedef Decompose_2 Make_square_free_2; //! Algebraic name - typedef Decompose_2 Square_free_factorization; + typedef Decompose_2 Square_free_factorize; //! Algebraic name typedef Decompose_2 Make_coprime_2; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_1.h index e4880afa637..41b6e0e5899 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_1.h @@ -207,10 +207,10 @@ public: }; - struct Square_free_factorization_1 { + struct Square_free_factorize_1 { template< class OutputIterator> OutputIterator operator()( const Polynomial_1& p, OutputIterator it) const { - typename PT_1::Square_free_factorization_up_to_constant_factor sqff; + typename PT_1::Square_free_factorize_up_to_constant_factor sqff; return sqff(p,it); } }; @@ -227,8 +227,8 @@ public: construct_is_square_free_1_object); CGAL_ALGEBRAIC_KERNEL_1_PRED(Make_square_free_1, construct_make_square_free_1_object); - CGAL_ALGEBRAIC_KERNEL_1_PRED(Square_free_factorization_1, - construct_square_free_factorization_1_object); + CGAL_ALGEBRAIC_KERNEL_1_PRED(Square_free_factorize_1, + construct_square_free_factorize_1_object); CGAL_ALGEBRAIC_KERNEL_1_PRED(Is_coprime_1, construct_is_coprime_1_object); CGAL_ALGEBRAIC_KERNEL_1_PRED(Make_coprime_1, diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_roots.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_roots.h index d559494e25b..2dea4f76839 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_roots.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Real_roots.h @@ -156,7 +156,7 @@ int operator()(const Polynomial& poly, std::list sqffac; std::list facmul; - filtered_square_free_factorization_utcf(poly, + filtered_square_free_factorize_utcf(poly, std::back_inserter(sqffac), std::back_inserter(facmul)); @@ -266,7 +266,7 @@ int operator()( const Polynomial& poly, std::list sqffac; std::list facmul; - filtered_square_free_factorization_utcf(poly, + filtered_square_free_factorize_utcf(poly, std::back_inserter(sqffac), std::back_inserter(facmul)); diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h index c43ceabb1f9..9ad63a6a1ca 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h @@ -133,12 +133,12 @@ void test_algebraic_kernel_1() { Polynomial_1 g, q1, q2; make_coprime_1( poly1, poly2, g, q1, q2 ); - // Test AK::Square_free_factorization_1... - typename AK::Square_free_factorization_1 square_free_factorization_1 - = AK().construct_square_free_factorization_1_object(); + // Test AK::Square_free_factorize_1... + typename AK::Square_free_factorize_1 square_free_factorize_1 + = AK().construct_square_free_factorize_1_object(); std::vector > fac_mult_pairs; - square_free_factorization_1( poly1, std::back_inserter(fac_mult_pairs) ); + square_free_factorize_1( poly1, std::back_inserter(fac_mult_pairs) ); //////////////////////////////////////////////////////////////////////////// diff --git a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h index da3ab87440d..74b205fa925 100644 --- a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h +++ b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h @@ -1302,7 +1302,7 @@ public: typedef Has_finite_number_of_intersections_2 Is_coprime_2; typedef Decompose_2 Make_square_free_2; - typedef Decompose_2 Square_free_factorization; + typedef Decompose_2 Square_free_factorize; typedef Decompose_2 Make_coprime_2; //! \brief computes the derivative w.r.t. the first (innermost) variable diff --git a/Manual/doc_tex/Manual/geom.bib b/Manual/doc_tex/Manual/geom.bib index b0f5ba563ad..4eda28d1b13 100644 --- a/Manual/doc_tex/Manual/geom.bib +++ b/Manual/doc_tex/Manual/geom.bib @@ -151737,4 +151737,10 @@ amplification and suppression of local contrast. Contains C code." , update = "98.03 bibrelex" } - +@book{gg-mca-99 +, key = Gathen +, author = {Joachim von zur Gathen and J{\"u}rgen Gerhard} +, title = "Modern Computer Algebra" +, publisher = "Cambridge University Press" +, year = 1999 +} \ No newline at end of file diff --git a/Polynomial/doc_tex/Polynomial_ref/PolynomialToolBox_d.tex b/Polynomial/doc_tex/Polynomial_ref/PolynomialToolBox_d.tex index 4ecd27c90f4..40733a2c0f2 100644 --- a/Polynomial/doc_tex/Polynomial_ref/PolynomialToolBox_d.tex +++ b/Polynomial/doc_tex/Polynomial_ref/PolynomialToolBox_d.tex @@ -52,7 +52,7 @@ In case a functor is not provided it is set to \ccc{CGAL::Null_functor}. %unary operations \ccNestedType{Make_square_free} { A model of \ccc{PolynomialTraits_d::MakeSquareFree}.}\ccGlue -\ccNestedType{Square_free_factorization} +\ccNestedType{Square_free_factorize} { In case \ccc{PolynomialTraits::Polynomial_d} is not a model of \ccc{UniqueFactorizationDomain}, this is of type \ccc{CGAL::Null_type}, otherwise this is a model of \ccc{PolynomialTraits_d::SquareFreeFactorize}.} @@ -77,7 +77,7 @@ is not a model of \ccc{UniqueFactorizationDomain}, this is of type \ccc{CGAL::Nu \ccNestedType{Content_up_to_constant_factor} { A model of \ccc{PolynomialTraits_d::ContentUpToConstantFactor}.} \ccGlue -\ccNestedType{Square_free_factorization_up_to_constant_factor} +\ccNestedType{Square_free_factorize_up_to_constant_factor} { A model of \ccc{PolynomialTraits_d::SquareFreeFactorizeUpToConstantFactor}.} %resultant diff --git a/Polynomial/doc_tex/Polynomial_ref/PolynomialTraits_d.tex b/Polynomial/doc_tex/Polynomial_ref/PolynomialTraits_d.tex index cdd0fd4ce7b..9538c1ccce0 100644 --- a/Polynomial/doc_tex/Polynomial_ref/PolynomialTraits_d.tex +++ b/Polynomial/doc_tex/Polynomial_ref/PolynomialTraits_d.tex @@ -144,7 +144,7 @@ In case a functor is not provided it is set to \ccc{CGAL::Null_functor}. %unary operations \ccNestedType{Make_square_free} { A model of \ccc{PolynomialTraits_d::MakeSquareFree}.}\ccGlue -\ccNestedType{Square_free_factorization} +\ccNestedType{Square_free_factorize} { In case \ccc{PolynomialTraits::Polynomial_d} is not a model of \ccc{UniqueFactorizationDomain}, this is of type \ccc{CGAL::Null_type}, otherwise this is a model of \ccc{PolynomialTraits_d::SquareFreeFactorize}.} @@ -169,7 +169,7 @@ is not a model of \ccc{UniqueFactorizationDomain}, this is of type \ccc{CGAL::Nu \ccNestedType{Content_up_to_constant_factor} { A model of \ccc{PolynomialTraits_d::ContentUpToConstantFactor}.} \ccGlue -\ccNestedType{Square_free_factorization_up_to_constant_factor} +\ccNestedType{Square_free_factorize_up_to_constant_factor} { A model of \ccc{PolynomialTraits_d::SquareFreeFactorizeUpToConstantFactor}.} %resultant diff --git a/Polynomial/include/CGAL/Polynomial/fwd.h b/Polynomial/include/CGAL/Polynomial/fwd.h index 653c701f1ec..df81b7741fa 100644 --- a/Polynomial/include/CGAL/Polynomial/fwd.h +++ b/Polynomial/include/CGAL/Polynomial/fwd.h @@ -56,19 +56,19 @@ template inline Polynomial gcd_utcf_modularizable_algebra_( const template inline NT content_utcf_(const Polynomial&); template -inline int filtered_square_free_factorization( Polynomial, OutputIterator1, OutputIterator2); +inline int filtered_square_free_factorize( Polynomial, OutputIterator1, OutputIterator2); template -inline int filtered_square_free_factorization_utcf( const Polynomial&, OutputIterator1, OutputIterator2); +inline int filtered_square_free_factorize_utcf( const Polynomial&, OutputIterator1, OutputIterator2); template -inline int square_free_factorization_utcf(const Polynomial&, OutputIterator1, OutputIterator2); +inline int square_free_factorize_utcf(const Polynomial&, OutputIterator1, OutputIterator2); template -inline int square_free_factorization_utcf_for_regular_polynomial(const Polynomial&, OutputIterator1, OutputIterator2); +inline int square_free_factorize_utcf_for_regular_polynomial(const Polynomial&, OutputIterator1, OutputIterator2); template -inline int square_free_factorization(const Polynomial&, OutputIterator1, OutputIterator2); +inline int square_free_factorize(const Polynomial&, OutputIterator1, OutputIterator2); template -inline int square_free_factorization_for_regular_polynomial(const Polynomial&, OutputIterator1, OutputIterator2); +inline int square_free_factorize_for_regular_polynomial(const Polynomial&, OutputIterator1, OutputIterator2); template inline bool may_have_multiple_factor( const Polynomial&); template inline bool may_have_common_factor(const Polynomial&,const Polynomial&); diff --git a/Polynomial/include/CGAL/Polynomial/square_free_factorization.h b/Polynomial/include/CGAL/Polynomial/square_free_factorization.h deleted file mode 100644 index 7ec1ddeb210..00000000000 --- a/Polynomial/include/CGAL/Polynomial/square_free_factorization.h +++ /dev/null @@ -1,350 +0,0 @@ -// TODO: Add licence -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL:$ -// $Id: $ -// -// Author(s) : -// -// ============================================================================ -#ifndef CGAL_POLYNOMIAL_SQUARE_FREE_FACTORIZATION_H -#define CGAL_POLYNOMIAL_SQUARE_FREE_FACTORIZATION_H - -#include -#include -#include -#include - -CGAL_BEGIN_NAMESPACE -namespace CGALi { - -// square-free factorization -// -// the implementation uses two dispatches: -// a) first look at the coefficient's algebra type -// b) if the algebra type is of the concept field, try to decompose -// the same holds for square-free factorization up to constant factors (utcf) -// -// sqff -------> algebra type ? ----field-----> decomposable ? -// | A | | -// UFD | no yes -// | | | | -// V | | -// Yun's algo <---------------------- | -// A | -// | | | -// UFD | V -// | | decompose and use -// sqff_utcf --> algebra_type ? ----field-- sqff_utcf with numerator -// | -// integral domain -// | -// V -// Yun's algo (utcf) - -template -inline int square_free_factorization(const IC&, OutputIterator1, OutputIterator2){ - return 0; -} -template -inline int square_free_factorization_for_regular_polynomial(const IC&, OutputIterator1, OutputIterator2){ - return 0; -} - -template -inline int square_free_factorization(const Polynomial&, OutputIterator1, OutputIterator2); -template -inline int square_free_factorization_for_regular_polynomial(const Polynomial&, OutputIterator1, OutputIterator2); -template -inline int square_free_factorization_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, CGAL::Tag_true); -template -inline int square_free_factorization_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, CGAL::Tag_false); -template -inline int square_free_factorization_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, Integral_domain_tag); -template -inline int square_free_factorization_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, Unique_factorization_domain_tag); - - - - -template -inline int square_free_factorization -(const Polynomial& poly, OutputIterator1 factors, OutputIterator2 multiplicities) -{ - typedef Polynomial POLY; - typedef Polynomial_traits_d< POLY > PT; - typedef typename PT::Univariate_content_up_to_constant_factor Ucont_utcf; - typedef typename PT::Integral_division_up_to_constant_factor Idiv_utcf; - - if (typename PT::Total_degree()(poly) == 0){return 0;} - - Coeff ucont_utcf = Ucont_utcf()(poly); - POLY regular_poly = Idiv_utcf()(poly,ucont_utcf); - - int result = square_free_factorization_for_regular_polynomial( - regular_poly, factors, multiplicities); - - if (typename PT::Total_degree()(ucont_utcf) > 0){ - typedef std::vector< Coeff > Factors_uc; - typedef std::vector< int > Multiplicities_uc; - Factors_uc factors_uc; - Multiplicities_uc multiplicities_uc; - result += square_free_factorization( ucont_utcf, - std::back_inserter(factors_uc), - std::back_inserter(multiplicities_uc) ); - - for( typename Factors_uc::iterator it = factors_uc.begin(); - it != factors_uc.end(); ++it ){ - *factors++ = POLY(*it); - } - for( Multiplicities_uc::iterator it = multiplicities_uc.begin(); - it != multiplicities_uc.end(); ++it ){ - *multiplicities++ = (*it); - } - } - return result; -} - -template -inline int square_free_factorization_for_regular_polynomial -(const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities){ - typedef Polynomial POLY; - typedef typename CGAL::Fraction_traits::Is_fraction Is_fraction; - return square_free_factorization_for_regular_polynomial_(p,factors,multiplicities,Is_fraction()); -} - -template -inline int square_free_factorization_for_regular_polynomial_ -(const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities, CGAL::Tag_true){ - - typedef Polynomial POLY; - typedef Polynomial_traits_d< POLY > PT; - typedef Fraction_traits FT; - - typename FT::Numerator_type num; - typename FT::Denominator_type denom; - typename FT::Decompose()(p,num,denom); - - std::vector ifacs; - int result = square_free_factorization_for_regular_polynomial(num,std::back_inserter(ifacs),multiplicities); - - typedef typename std::vector::iterator Iterator; - denom = typename FT::Denominator_type(1); - for ( Iterator it = ifacs.begin(); it != ifacs.end(); ++it) { - POLY q = typename FT::Compose()(*it, denom); - *factors++ = typename PT::Canonicalize()(q); - } - - return result; -} - -template -inline int square_free_factorization_for_regular_polynomial_ -(const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities, CGAL::Tag_false){ - typedef Polynomial POLY; - typedef typename Algebraic_structure_traits::Algebraic_category Algebraic_category; - return square_free_factorization_for_regular_polynomial_(p,factors,multiplicities,Algebraic_category()); -} - -template -inline int square_free_factorization_for_regular_polynomial_ -(const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities, Integral_domain_tag){ - // Yun's Square-Free Factorization - // see [Geddes et al, 1992], Algorithm 8.2 - - typedef Polynomial POLY; - typedef Polynomial_traits_d PT; - typedef typename Polynomial_traits_d::Innermost_coefficient_type IC; - typename Polynomial_traits_d::Innermost_leading_coefficient ilcoeff; - //typename Polynomial_traits_d::Innermost_coefficient_to_polynomial ictp; - typename Polynomial_traits_d::Innermost_coefficient_begin begin; - typename Polynomial_traits_d::Innermost_coefficient_end end; - typename Algebraic_extension_traits::Denominator_for_algebraic_integers dfai; - typename Algebraic_extension_traits::Normalization_factor nfac; - typename Scalar_factor_traits::Scalar_factor sfac; - typename Scalar_factor_traits::Scalar_div sdiv; - typedef typename Scalar_factor_traits::Scalar Scalar; - - - if (typename PT::Total_degree()(p) == 0) return 0; - - POLY a = canonicalize_polynomial(p); - POLY b = diff(a); - POLY c = CGAL::CGALi::gcd_utcf(a, b); - - if (c == Coeff(1)) { - *factors = a; - *multiplicities = 1; - return 1; - } - - int i = 1, n = 0; - - // extending both polynomials a and b by the denominator for algebraic - // integers, which comes out from c=gcd(a,b), such that a and b are - // divisible by c - IC lcoeff = ilcoeff(c); - IC denom = dfai(begin(c), end(c)); - lcoeff *= denom * nfac(denom); - POLY w = (a * POLY(lcoeff)) / c; - POLY y = (b * POLY(lcoeff)) / c; - - // extracting a common scalar factor out of w=a/c and y=b/c simultaneously, - // such that the parts in z=y-w' are canceled out as they should - Scalar sfactor = sfac(y,sfac(w)); - sdiv(w, sfactor); - sdiv(y, sfactor); - - POLY z = y - diff(w); - POLY g; - - while (!z.is_zero()) { - g = CGAL::CGALi::gcd_utcf(w, z); - if (g.degree() > 0) { - *factors++ = g; - *multiplicities++ = i; - n++; - } - i++; - lcoeff = ilcoeff(g); // same as above - denom =dfai(begin(c), end(c)); - lcoeff *= denom * nfac(denom); - w = (w * POLY(lcoeff)) / g; - y = (z * POLY(lcoeff)) / g; - Scalar sfactor = sfac(y,sfac(w)); - sdiv(w, sfactor); - sdiv(y, sfactor); - - z = y - diff(w); - } - - *factors = w; - *multiplicities++ = i; - n++; - - return n; -} - -template -inline int square_free_factorization_for_regular_polynomial_ -(const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities, Unique_factorization_domain_tag){ - // Yun's Square-Free Factorization - // see [Geddes et al, 1992], Algorithm 8.2 - /* - @inproceedings{y-osfda-76, - author = {David Y.Y. Yun}, - title = {On square-free decomposition algorithms}, - booktitle = {SYMSAC '76: Proceedings of the third ACM symposium on Symbolic - and algebraic computation}, - year = {1976}, - pages = {26--35}, - location = {Yorktown Heights, New York, United States}, - doi = {http://doi.acm.org/10.1145/800205.806320}, - publisher = {ACM Press}, - address = {New York, NY, USA}, - } - */ - - typedef Polynomial POLY; - typedef Polynomial_traits_d PT; - - if (typename PT::Total_degree()(p) == 0) return 0; - POLY a = canonicalize_polynomial(p); - - POLY b = diff(a); - POLY c = CGAL::gcd(a, b); - - if (c == Coeff(1)) { - *factors = a; - *multiplicities = 1; - return 1; - } - - int i = 1, n = 0; - POLY w = a/c, y = b/c, z = y - diff(w), g; - while (!z.is_zero()) { - g = CGAL::gcd(w, z); - if (g.degree() > 0) { - *factors++ = g; - *multiplicities++ = i; - n++; - } - i++; - w /= g; - y = z/g; - z = y - diff(w); - } - *factors = w; - *multiplicities++ = i; - n++; - - return n; -} - - - - -// square-free factorization utcf - -template -inline int square_free_factorization_utcf -(const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities) -{ - return square_free_factorization(p,factors,multiplicities); -} - -template -inline int square_free_factorization_utcf_for_regular_polynomial -(const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities) -{ - return square_free_factorization_for_regular_polynomial(p,factors,multiplicities); -} - - - - -// filtered square-free factorization - -// ### filtered versions #### - -/*! \brief As NiX::square_free_factorization, but filtered by - * NiX::may_have_multiple_root - * - * Use this function if the polynomial might be square free. - */ -template -inline -int filtered_square_free_factorization( - Polynomial p, - OutputIterator1 factors, - OutputIterator2 multiplicities) -{ - if(CGAL::CGALi::may_have_multiple_factor(p)){ - return CGALi::square_free_factorization(p, factors, multiplicities); - }else{ - *factors++ = canonicalize_polynomial(p); - *multiplicities++ = 1; - return 1; - } -} - -/*! \brief As NiX::square_free_factorization_utcf, but filtered by - * NiX::may_have_multiple_root - * - * Use this function if the polynomial might be square free. - */ -template -inline -int filtered_square_free_factorization_utcf( const Polynomial& p, - OutputIterator1 factors, - OutputIterator2 multiplicities) -{ - return filtered_square_free_factorization(p,factors,multiplicities); -} - -} // namespace CGALi -CGAL_END_NAMESPACE - -#endif // CGAL_POLYNOMIAL_SQUARE_FREE_FACTORIZATION_H diff --git a/Polynomial/include/CGAL/Polynomial/square_free_factorize.h b/Polynomial/include/CGAL/Polynomial/square_free_factorize.h index 7ec1ddeb210..0e8fffb34ec 100644 --- a/Polynomial/include/CGAL/Polynomial/square_free_factorize.h +++ b/Polynomial/include/CGAL/Polynomial/square_free_factorize.h @@ -45,32 +45,32 @@ namespace CGALi { // Yun's algo (utcf) template -inline int square_free_factorization(const IC&, OutputIterator1, OutputIterator2){ +inline int square_free_factorize(const IC&, OutputIterator1, OutputIterator2){ return 0; } template -inline int square_free_factorization_for_regular_polynomial(const IC&, OutputIterator1, OutputIterator2){ +inline int square_free_factorize_for_regular_polynomial(const IC&, OutputIterator1, OutputIterator2){ return 0; } template -inline int square_free_factorization(const Polynomial&, OutputIterator1, OutputIterator2); +inline int square_free_factorize(const Polynomial&, OutputIterator1, OutputIterator2); template -inline int square_free_factorization_for_regular_polynomial(const Polynomial&, OutputIterator1, OutputIterator2); +inline int square_free_factorize_for_regular_polynomial(const Polynomial&, OutputIterator1, OutputIterator2); template -inline int square_free_factorization_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, CGAL::Tag_true); +inline int square_free_factorize_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, CGAL::Tag_true); template -inline int square_free_factorization_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, CGAL::Tag_false); +inline int square_free_factorize_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, CGAL::Tag_false); template -inline int square_free_factorization_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, Integral_domain_tag); +inline int square_free_factorize_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, Integral_domain_tag); template -inline int square_free_factorization_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, Unique_factorization_domain_tag); +inline int square_free_factorize_for_regular_polynomial_(const Polynomial&, OutputIterator1, OutputIterator2, Unique_factorization_domain_tag); template -inline int square_free_factorization +inline int square_free_factorize (const Polynomial& poly, OutputIterator1 factors, OutputIterator2 multiplicities) { typedef Polynomial POLY; @@ -83,7 +83,7 @@ inline int square_free_factorization Coeff ucont_utcf = Ucont_utcf()(poly); POLY regular_poly = Idiv_utcf()(poly,ucont_utcf); - int result = square_free_factorization_for_regular_polynomial( + int result = square_free_factorize_for_regular_polynomial( regular_poly, factors, multiplicities); if (typename PT::Total_degree()(ucont_utcf) > 0){ @@ -91,7 +91,7 @@ inline int square_free_factorization typedef std::vector< int > Multiplicities_uc; Factors_uc factors_uc; Multiplicities_uc multiplicities_uc; - result += square_free_factorization( ucont_utcf, + result += square_free_factorize( ucont_utcf, std::back_inserter(factors_uc), std::back_inserter(multiplicities_uc) ); @@ -108,15 +108,15 @@ inline int square_free_factorization } template -inline int square_free_factorization_for_regular_polynomial +inline int square_free_factorize_for_regular_polynomial (const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities){ typedef Polynomial POLY; typedef typename CGAL::Fraction_traits::Is_fraction Is_fraction; - return square_free_factorization_for_regular_polynomial_(p,factors,multiplicities,Is_fraction()); + return square_free_factorize_for_regular_polynomial_(p,factors,multiplicities,Is_fraction()); } template -inline int square_free_factorization_for_regular_polynomial_ +inline int square_free_factorize_for_regular_polynomial_ (const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities, CGAL::Tag_true){ typedef Polynomial POLY; @@ -128,7 +128,7 @@ inline int square_free_factorization_for_regular_polynomial_ typename FT::Decompose()(p,num,denom); std::vector ifacs; - int result = square_free_factorization_for_regular_polynomial(num,std::back_inserter(ifacs),multiplicities); + int result = square_free_factorize_for_regular_polynomial(num,std::back_inserter(ifacs),multiplicities); typedef typename std::vector::iterator Iterator; denom = typename FT::Denominator_type(1); @@ -141,15 +141,15 @@ inline int square_free_factorization_for_regular_polynomial_ } template -inline int square_free_factorization_for_regular_polynomial_ +inline int square_free_factorize_for_regular_polynomial_ (const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities, CGAL::Tag_false){ typedef Polynomial POLY; typedef typename Algebraic_structure_traits::Algebraic_category Algebraic_category; - return square_free_factorization_for_regular_polynomial_(p,factors,multiplicities,Algebraic_category()); + return square_free_factorize_for_regular_polynomial_(p,factors,multiplicities,Algebraic_category()); } template -inline int square_free_factorization_for_regular_polynomial_ +inline int square_free_factorize_for_regular_polynomial_ (const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities, Integral_domain_tag){ // Yun's Square-Free Factorization // see [Geddes et al, 1992], Algorithm 8.2 @@ -228,7 +228,7 @@ inline int square_free_factorization_for_regular_polynomial_ } template -inline int square_free_factorization_for_regular_polynomial_ +inline int square_free_factorize_for_regular_polynomial_ (const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities, Unique_factorization_domain_tag){ // Yun's Square-Free Factorization // see [Geddes et al, 1992], Algorithm 8.2 @@ -289,17 +289,17 @@ inline int square_free_factorization_for_regular_polynomial_ // square-free factorization utcf template -inline int square_free_factorization_utcf +inline int square_free_factorize_utcf (const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities) { - return square_free_factorization(p,factors,multiplicities); + return square_free_factorize(p,factors,multiplicities); } template -inline int square_free_factorization_utcf_for_regular_polynomial +inline int square_free_factorize_utcf_for_regular_polynomial (const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities) { - return square_free_factorization_for_regular_polynomial(p,factors,multiplicities); + return square_free_factorize_for_regular_polynomial(p,factors,multiplicities); } @@ -309,20 +309,20 @@ inline int square_free_factorization_utcf_for_regular_polynomial // ### filtered versions #### -/*! \brief As NiX::square_free_factorization, but filtered by +/*! \brief As NiX::square_free_factorize, but filtered by * NiX::may_have_multiple_root * * Use this function if the polynomial might be square free. */ template inline -int filtered_square_free_factorization( +int filtered_square_free_factorize( Polynomial p, OutputIterator1 factors, OutputIterator2 multiplicities) { if(CGAL::CGALi::may_have_multiple_factor(p)){ - return CGALi::square_free_factorization(p, factors, multiplicities); + return CGALi::square_free_factorize(p, factors, multiplicities); }else{ *factors++ = canonicalize_polynomial(p); *multiplicities++ = 1; @@ -330,18 +330,18 @@ int filtered_square_free_factorization( } } -/*! \brief As NiX::square_free_factorization_utcf, but filtered by +/*! \brief As NiX::square_free_factorize_utcf, but filtered by * NiX::may_have_multiple_root * * Use this function if the polynomial might be square free. */ template inline -int filtered_square_free_factorization_utcf( const Polynomial& p, +int filtered_square_free_factorize_utcf( const Polynomial& p, OutputIterator1 factors, OutputIterator2 multiplicities) { - return filtered_square_free_factorization(p,factors,multiplicities); + return filtered_square_free_factorize(p,factors,multiplicities); } } // namespace CGALi diff --git a/Polynomial/include/CGAL/Polynomial_traits_d.h b/Polynomial/include/CGAL/Polynomial_traits_d.h index 7bec4176d5d..836eee346ba 100644 --- a/Polynomial/include/CGAL/Polynomial_traits_d.h +++ b/Polynomial/include/CGAL/Polynomial_traits_d.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -214,7 +214,7 @@ template< class Coefficient_type_, class PolynomialAlgebraicCategory > class Polynomial_traits_d_base_polynomial_algebraic_category { public: typedef Null_functor Univariate_content; - typedef Null_functor Square_free_factorization; + typedef Null_functor Square_free_factorize; }; // Specializations @@ -250,15 +250,15 @@ public: } }; - // Square_free_factorization; - struct Square_free_factorization{ + // Square_free_factorize; + struct Square_free_factorize{ template < class OutputIterator > OutputIterator operator()( const Polynomial_d& p, OutputIterator oi) const { std::vector factors; std::vector mults; - square_free_factorization + square_free_factorize ( p, std::back_inserter(factors), std::back_inserter(mults) ); CGAL_postcondition( factors.size() == mults.size() ); @@ -350,7 +350,7 @@ public: } }; - typedef Null_functor Square_free_factorization; + typedef Null_functor Square_free_factorize; typedef Null_functor Pseudo_division; typedef Null_functor Pseudo_division_remainder; typedef Null_functor Pseudo_division_quotient; @@ -375,7 +375,7 @@ public: } }; - typedef Null_functor Square_free_factorization_up_to_constant_factor; + typedef Null_functor Square_free_factorize_up_to_constant_factor; typedef Null_functor Resultant; typedef Null_functor Canonicalize; typedef Null_functor Evaluate_homogeneous; @@ -1165,7 +1165,7 @@ public: } }; - struct Square_free_factorization_up_to_constant_factor { + struct Square_free_factorize_up_to_constant_factor { private: typedef Coefficient_type Coeff; typedef Innermost_coefficient_type ICoeff; @@ -1183,7 +1183,7 @@ public: typename First_if_different::Type c, OutputIterator oi) const { - typename PTC::Square_free_factorization_up_to_constant_factor sqff; + typename PTC::Square_free_factorize_up_to_constant_factor sqff; std::vector > fac_mul_pairs; sqff(c,std::back_inserter(fac_mul_pairs)); @@ -1208,7 +1208,7 @@ public: p = idiv_utcf( p , Polynomial_d(c)); std::vector factors; std::vector mults; - square_free_factorization_utcf( + square_free_factorize_utcf( p, std::back_inserter(factors), std::back_inserter(mults)); for(unsigned int i = 0; i < factors.size() ; i++){ *oi++=std::make_pair(factors[i],mults[i]); diff --git a/Polynomial/test/Polynomial/Polynomial.cpp b/Polynomial/test/Polynomial/Polynomial.cpp index 53e0f01c985..47d8907b3e0 100644 --- a/Polynomial/test/Polynomial/Polynomial.cpp +++ b/Polynomial/test/Polynomial/Polynomial.cpp @@ -516,7 +516,7 @@ void test_sqff_utcf_(const POLY& poly, int n){ std::back_insert_iterator > mul_bi(mul); assert(n == - CGAL::CGALi::square_free_factorization_utcf(poly, fac_bi, mul_bi)); + CGAL::CGALi::square_free_factorize_utcf(poly, fac_bi, mul_bi)); assert((int) mul.size() == n); assert((int) fac.size() == n); @@ -650,7 +650,7 @@ void sqff() { std::back_insert_iterator mul_bi(mul); unsigned n; NT alpha; - n = CGAL::CGALi::square_free_factorization(p, fac_bi, mul_bi ); + n = CGAL::CGALi::square_free_factorize(p, fac_bi, mul_bi ); // assert(alpha == 3); assert(n == 3); @@ -666,7 +666,7 @@ void sqff() { mul.clear(); fac_bi = std::back_insert_iterator(fac); mul_bi = std::back_insert_iterator(mul); - std::cerr << CGAL::CGALi::square_free_factorization( p, fac_bi, mul_bi ) << std::endl; + std::cerr << CGAL::CGALi::square_free_factorize( p, fac_bi, mul_bi ) << std::endl; std::cerr << fac[0] << std::endl;*/ //std::cerr << fac[1] << std::endl; @@ -681,7 +681,7 @@ void sqff() { mul.clear(); std::back_insert_iterator< BPVEC > bfac_bi( bfac ); mul_bi = std::back_insert_iterator(mul); -// std::cerr << CGAL::POLYNOMIAL::square_free_factorization( bp, bfac_bi, mul_bi ) << std::endl; +// std::cerr << CGAL::POLYNOMIAL::square_free_factorize( bp, bfac_bi, mul_bi ) << std::endl; // std::cerr << bfac[0] << std::endl; } diff --git a/Polynomial/test/Polynomial/Polynomial_traits_d.cpp b/Polynomial/test/Polynomial/Polynomial_traits_d.cpp index 43cf0bde597..d686507da41 100644 --- a/Polynomial/test/Polynomial/Polynomial_traits_d.cpp +++ b/Polynomial/test/Polynomial/Polynomial_traits_d.cpp @@ -737,14 +737,14 @@ void test_make_square_free(const Polynomial_traits_d&){ } -// // Square_free_factorization; +// // Square_free_factorize; template -void test_square_free_factorization(const Polynomial_traits_d&){ - std::cerr << "start test_square_free_factorization "; std::cerr.flush(); +void test_square_free_factorize(const Polynomial_traits_d&){ + std::cerr << "start test_square_free_factorize "; std::cerr.flush(); CGAL_SNAP_CGALi_TRAITS_D(Polynomial_traits_d); typedef CGAL::Algebraic_structure_traits AST; typename AST::Integral_division idiv; - typename PT::Square_free_factorization sqff; + typename PT::Square_free_factorize sqff; typename PT::Canonicalize canonicalize; (void) idiv; (void) sqff; @@ -949,14 +949,14 @@ void test_univariate_content_up_to_constant_factor(const Polynomial_traits_d&){ } -// // Square_free_factorization_up_to_constant_factor; +// // Square_free_factorize_up_to_constant_factor; template -void test_square_free_factorization_up_to_constant_factor(const Polynomial_traits_d&){ - std::cerr << "start test_square_free_factorization_up_to_constant_factor "; +void test_square_free_factorize_up_to_constant_factor(const Polynomial_traits_d&){ + std::cerr << "start test_square_free_factorize_up_to_constant_factor "; std::cerr.flush(); CGAL_SNAP_CGALi_TRAITS_D(Polynomial_traits_d); typename PT::Integral_division_up_to_constant_factor idiv_utcf; - typename PT::Square_free_factorization_up_to_constant_factor sqff_utcf; + typename PT::Square_free_factorize_up_to_constant_factor sqff_utcf; typename PT::Canonicalize canonicalize; (void) idiv_utcf; @@ -1424,7 +1424,7 @@ void test_fundamental_functors(const PT& traits){ test_gcd_up_to_constant_factor(traits); test_integral_division_up_to_constant_factor(traits); test_univariate_content_up_to_constant_factor(traits); - test_square_free_factorization_up_to_constant_factor(traits); + test_square_free_factorize_up_to_constant_factor(traits); // resultant test_resultant(traits); @@ -1472,13 +1472,13 @@ void test_ac_icoeff_functors(const PT& traits, CGAL::Field_tag){ template< class PT > void test_ac_poly_functors(const PT&, CGAL::Integral_domain_without_division_tag){ ASSERT_IS_NULL_FUNCTOR(typename PT::Univariate_content); - ASSERT_IS_NULL_FUNCTOR(typename PT::Square_free_factorization); + ASSERT_IS_NULL_FUNCTOR(typename PT::Square_free_factorize); } template< class PT > void test_ac_poly_functors(const PT& traits, CGAL::Unique_factorization_domain_tag){ test_univariate_content(traits); - test_square_free_factorization(traits); + test_square_free_factorize(traits); } diff --git a/Spatial_searching/benchmark/Spatial_searching/Split_data.cpp b/Spatial_searching/benchmark/Spatial_searching/Split_data.cpp index ad5ebc4bf8e..53aee8058cb 100644 --- a/Spatial_searching/benchmark/Spatial_searching/Split_data.cpp +++ b/Spatial_searching/benchmark/Spatial_searching/Split_data.cpp @@ -1,5 +1,5 @@ -// $URL:$ -// $Id:$ +// $URL$ +// $Id$ #include #include