From 2f89408eafa4f384d42dd5b207379261a4854d08 Mon Sep 17 00:00:00 2001 From: Michael Hemmer Date: Thu, 7 Aug 2008 09:49:32 +0000 Subject: [PATCH] PT:: Innermost_coefficient -> Innermost_coefficient_type PT:: Coefficient -> Coefficient_type --- .../Algebraic_curve_kernel_2.cpp | 2 +- .../include/CGAL/Polynomial_parser_2.h | 2 +- .../Best_approximation_cache.h | 2 +- .../gfx/Curve_renderer_internals.h | 2 +- .../gfx/Curve_renderer_traits.h | 6 +- .../Polynomial/coefficient_access.cpp | 4 +- .../examples/Polynomial/construction.cpp | 4 +- Polynomial/examples/Polynomial/degree.cpp | 4 +- Polynomial/examples/Polynomial/substitute.cpp | 4 +- Polynomial/examples/Polynomial/swap_move.cpp | 4 +- .../include/CGAL/Polynomial/Fraction_traits.h | 4 +- .../include/CGAL/Polynomial/Interpolator.h | 4 +- .../include/CGAL/Polynomial/Polynomial_type.h | 12 +- Polynomial/include/CGAL/Polynomial/misc.h | 16 +- .../Polynomial/modular_gcd_utcf_algorithm_M.h | 2 +- .../CGAL/Polynomial/modular_gcd_utcf_dfai.h | 2 +- .../Polynomial/modular_gcd_utcf_pure_wang.h | 2 +- .../Polynomial/modular_gcd_utcf_with_wang.h | 2 +- .../include/CGAL/Polynomial/polynomial_gcd.h | 6 +- .../CGAL/Polynomial/polynomial_utils.h | 4 +- .../include/CGAL/Polynomial/resultant.h | 4 +- .../Polynomial/square_free_factorization.h | 2 +- Polynomial/include/CGAL/Polynomial_traits_d.h | 398 +++++++++--------- Polynomial/test/Polynomial/Interpolator.cpp | 4 +- Polynomial/test/Polynomial/Polynomial.cpp | 20 +- .../test/Polynomial/Polynomial_traits_d.cpp | 92 ++-- .../include/CGAL/gen_sparse_polynomial.h | 4 +- Polynomial/test/Polynomial/resultant.cpp | 2 +- 28 files changed, 307 insertions(+), 307 deletions(-) diff --git a/Algebraic_kernel_d/benchmark/Algebraic_kernel_d/Algebraic_curve_kernel_2.cpp b/Algebraic_kernel_d/benchmark/Algebraic_kernel_d/Algebraic_curve_kernel_2.cpp index dd02a0664b8..393014767c3 100755 --- a/Algebraic_kernel_d/benchmark/Algebraic_kernel_d/Algebraic_curve_kernel_2.cpp +++ b/Algebraic_kernel_d/benchmark/Algebraic_kernel_d/Algebraic_curve_kernel_2.cpp @@ -284,7 +284,7 @@ Benchmark_result do_benchmark(std::string filename, int n_samples = 5) typedef typename AK_2::Internal_polynomial_2 Internal_polynomial_2; typedef typename NiX::Polynomial_traits:: - Innermost_coefficient Integer; + Innermost_coefficient_type Integer; typedef Bench_solve_2 Bench_solve_ak_2; typedef typename Bench_solve_ak_2::Curve_vector Curve_vector; diff --git a/Algebraic_kernel_d/demo/Algebraic_curve_kernel_2/include/CGAL/Polynomial_parser_2.h b/Algebraic_kernel_d/demo/Algebraic_curve_kernel_2/include/CGAL/Polynomial_parser_2.h index df3fdbc48e8..f74bbc6f30c 100644 --- a/Algebraic_kernel_d/demo/Algebraic_curve_kernel_2/include/CGAL/Polynomial_parser_2.h +++ b/Algebraic_kernel_d/demo/Algebraic_curve_kernel_2/include/CGAL/Polynomial_parser_2.h @@ -49,7 +49,7 @@ template struct _Default_checker { // coefficient type - typedef typename CGAL::Polynomial_traits_d::Innermost_coefficient NT; + typedef typename CGAL::Polynomial_traits_d::Innermost_coefficient_type NT; bool operator()(const NT& x) const { return true; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2/Bitstream_descartes_at_x/Best_approximation_cache.h b/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2/Bitstream_descartes_at_x/Best_approximation_cache.h index 0ed5eb74e5f..01a553d61f5 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2/Bitstream_descartes_at_x/Best_approximation_cache.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_curve_kernel_2/Bitstream_descartes_at_x/Best_approximation_cache.h @@ -3,7 +3,7 @@ // 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:$ +// $URL$ // $Id$ // // diff --git a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h index 838da829dd0..705da2f7ed0 100644 --- a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h +++ b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h @@ -898,7 +898,7 @@ int evaluate_rational(int var, const NT& c, const NT& key) //! precomputes polynomials and derivative coefficients void precompute(const Polynomial_2& in) { - typedef typename Polynomial_traits_2::Innermost_coefficient Coeff_src; + typedef typename Polynomial_traits_2::Inntermost_coefficient_type Coeff_src; Max_coeff max_coeff; Coeff_src max_c = max_coeff(in); diff --git a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h index 7d7fab7d244..89153e6aa2f 100644 --- a/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h +++ b/Curved_kernel_via_analysis_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h @@ -89,8 +89,8 @@ struct Reduce_by { * \c OutputPoly_2 by recursively applying operation \c Op to all of its * coefficients * - * Op: InputPoly_2::Innermost_coefficient -> - * OutputPoly_2::Innermost_coefficient + * Op: InputPoly_2::Inntermost_coefficient_type -> + * OutputPoly_2::Inntermost_coefficient_type */ template struct Transform { @@ -109,7 +109,7 @@ struct Transform { } OutputPoly_2 operator()( - const typename Innermost_coefficient::Type& x, Op op) + const typename Inntermost_coefficient_type::Type& x, Op op) const { return static_cast(op(x)); diff --git a/Polynomial/examples/Polynomial/coefficient_access.cpp b/Polynomial/examples/Polynomial/coefficient_access.cpp index 5c37d5b74f9..5557dba2040 100644 --- a/Polynomial/examples/Polynomial/coefficient_access.cpp +++ b/Polynomial/examples/Polynomial/coefficient_access.cpp @@ -8,8 +8,8 @@ int main(){ CGAL::set_pretty_mode(std::cout); typedef CGAL::Polynomial_type_generator::Type Poly_2; typedef CGAL::Polynomial_traits_d PT_2; - typedef PT_2::Coefficient Poly_1; - typedef PT_2::Innermost_coefficient Integer; + typedef PT_2::Coefficient_type Poly_1; + typedef PT_2::Innermost_coefficient_type Integer; //construction using shift Poly_2 x = PT_2::Shift()(Poly_2(1),1,0); // x_0^1 diff --git a/Polynomial/examples/Polynomial/construction.cpp b/Polynomial/examples/Polynomial/construction.cpp index 04815ef5fb0..8aca6a8363c 100644 --- a/Polynomial/examples/Polynomial/construction.cpp +++ b/Polynomial/examples/Polynomial/construction.cpp @@ -10,8 +10,8 @@ int main(){ typedef CGAL::Polynomial_type_generator::Type Poly_2; typedef CGAL::Polynomial_traits_d PT_2; - typedef PT_2::Coefficient Poly_1; - typedef PT_2::Innermost_coefficient Integer; + typedef PT_2::Coefficient_type Poly_1; + typedef PT_2::Innermost_coefficient_type Integer; PT_2::Construct_polynomial construct_polynomial; diff --git a/Polynomial/examples/Polynomial/degree.cpp b/Polynomial/examples/Polynomial/degree.cpp index 9a2545e9065..b96db2a64bd 100644 --- a/Polynomial/examples/Polynomial/degree.cpp +++ b/Polynomial/examples/Polynomial/degree.cpp @@ -8,8 +8,8 @@ int main(){ CGAL::set_pretty_mode(std::cout); typedef CGAL::Polynomial_type_generator::Type Poly_2; typedef CGAL::Polynomial_traits_d PT_2; - typedef PT_2::Coefficient Poly_1; - typedef PT_2::Innermost_coefficient Integer; + typedef PT_2::Coefficient_type Poly_1; + typedef PT_2::Innermost_coefficient_type Integer; //construction using shift Poly_2 x = PT_2::Shift()(Poly_2(1),1,0); // x_0^1 diff --git a/Polynomial/examples/Polynomial/substitute.cpp b/Polynomial/examples/Polynomial/substitute.cpp index 10beb964f45..a6515f20715 100644 --- a/Polynomial/examples/Polynomial/substitute.cpp +++ b/Polynomial/examples/Polynomial/substitute.cpp @@ -8,8 +8,8 @@ int main(){ CGAL::set_pretty_mode(std::cout); typedef CGAL::Polynomial_type_generator::Type Poly_2; typedef CGAL::Polynomial_traits_d PT_2; - typedef PT_2::Coefficient Poly_1; - typedef PT_2::Innermost_coefficient Integer; + typedef PT_2::Coefficient_type Poly_1; + typedef PT_2::Innermost_coefficient_type Integer; //construction using shift Poly_2 x = PT_2::Shift()(Poly_2(1),1,0); // x_0^1 diff --git a/Polynomial/examples/Polynomial/swap_move.cpp b/Polynomial/examples/Polynomial/swap_move.cpp index 2b47f06e23c..7abcfcee685 100644 --- a/Polynomial/examples/Polynomial/swap_move.cpp +++ b/Polynomial/examples/Polynomial/swap_move.cpp @@ -8,8 +8,8 @@ int main(){ CGAL::set_pretty_mode(std::cout); typedef CGAL::Polynomial_type_generator::Type Poly_3; typedef CGAL::Polynomial_traits_d PT_3; - typedef PT_3::Coefficient Poly_1; - typedef PT_3::Innermost_coefficient Integer; + typedef PT_3::Coefficient_type Poly_1; + typedef PT_3::Innermost_coefficient_type Integer; //construction using shift Poly_3 x = PT_3::Shift()(Poly_3(1),1,0); // x_0^1 diff --git a/Polynomial/include/CGAL/Polynomial/Fraction_traits.h b/Polynomial/include/CGAL/Polynomial/Fraction_traits.h index 7dbdef72ecc..ee7601cee58 100644 --- a/Polynomial/include/CGAL/Polynomial/Fraction_traits.h +++ b/Polynomial/include/CGAL/Polynomial/Fraction_traits.h @@ -47,7 +47,7 @@ public: template class Poly_Ftr_base< Polynomial, CGAL::Tag_true > { typedef Polynomial Poly; - typedef NT_ Coefficient; + typedef NT_ Coefficient_type; public: typedef Polynomial Type; typedef CGAL::Tag_true Is_fraction; @@ -68,7 +68,7 @@ public: typedef Numerator_type INTPOLY; typedef Denominator_type DENOM; - typedef Fraction_traits CFTRAITS; + typedef Fraction_traits CFTRAITS; typedef typename CFTRAITS::Numerator_type INTCOEFF; const int d = p.degree(); diff --git a/Polynomial/include/CGAL/Polynomial/Interpolator.h b/Polynomial/include/CGAL/Polynomial/Interpolator.h index 500a0d1de89..715f18493fb 100644 --- a/Polynomial/include/CGAL/Polynomial/Interpolator.h +++ b/Polynomial/include/CGAL/Polynomial/Interpolator.h @@ -14,8 +14,8 @@ class Interpolator{ public: typedef typename PT::Polynomial_d Polynomial_d; - typedef typename PT::Coefficient Coeff; - typedef typename PT::Innermost_coefficient IC; + typedef typename PT::Coefficient_type Coeff; + typedef typename PT::Innermost_coefficient_type IC; private: typedef typename CGAL::Coercion_traits::Cast IC2Coeff; diff --git a/Polynomial/include/CGAL/Polynomial/Polynomial_type.h b/Polynomial/include/CGAL/Polynomial/Polynomial_type.h index 4a86eed2b9e..411288b94bf 100644 --- a/Polynomial/include/CGAL/Polynomial/Polynomial_type.h +++ b/Polynomial/include/CGAL/Polynomial/Polynomial_type.h @@ -26,10 +26,10 @@ #define CGAL_POLYNOMIAL_CGALi_TYPE_H #define CGAL_icoeff(T) typename CGAL::First_if_different< \ -typename CGAL::CGALi::Innermost_coefficient::Type, T, 1>::Type +typename CGAL::CGALi::Innermost_coefficient_type::Type, T, 1>::Type #define CGAL_int(T) typename CGAL::First_if_different< int, \ -typename CGAL::CGALi::Innermost_coefficient::Type , 2>::Type +typename CGAL::CGALi::Innermost_coefficient_type::Type , 2>::Type #include @@ -189,7 +189,7 @@ class Polynomial boost::ordered_field_operators2< Polynomial , CGAL_icoeff(NT_), boost::ordered_field_operators2< Polynomial , CGAL_int(NT_) > > > > { - typedef typename CGALi::Innermost_coefficient::Type Innermost_coefficient; + typedef typename CGALi::Innermost_coefficient_type::Type Innermost_coefficient_type; public: //! \name Typedefs @@ -1341,9 +1341,9 @@ void Polynomial::output_ascii(std::ostream &os) const { template void Polynomial::output_benchmark(std::ostream &os) const { - typedef typename Polynomial_traits_d< Polynomial >::Innermost_coefficient - Innermost_coefficient; - typedef std::pair< Exponent_vector, Innermost_coefficient > + typedef typename Polynomial_traits_d< Polynomial >::Innermost_coefficient_type + Innermost_coefficient_type; + typedef std::pair< Exponent_vector, Innermost_coefficient_type > Exponents_coeff_pair; typedef typename Polynomial_traits_d< Polynomial >::Get_monom_representation Gmr; diff --git a/Polynomial/include/CGAL/Polynomial/misc.h b/Polynomial/include/CGAL/Polynomial/misc.h index 2b47692c9f1..5f43f8dff44 100644 --- a/Polynomial/include/CGAL/Polynomial/misc.h +++ b/Polynomial/include/CGAL/Polynomial/misc.h @@ -7,20 +7,20 @@ namespace CGAL{ namespace CGALi{ -// template meta function Innermost_coefficient +// template meta function Innermost_coefficient_type // returns the tpye of the innermost coefficient -template struct Innermost_coefficient{ typedef T Type; }; -template -struct Innermost_coefficient >{ - typedef typename Innermost_coefficient::Type Type; +template struct Innermost_coefficient_type{ typedef T Type; }; +template +struct Innermost_coefficient_type >{ + typedef typename Innermost_coefficient_type::Type Type; }; // template meta function Dimension // returns the number of variables template struct Dimension{ static const int value = 0;}; -template -struct Dimension > { - static const int value = Dimension::value + 1 ; +template +struct Dimension > { + static const int value = Dimension::value + 1 ; }; } // namespace CGALi diff --git a/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_algorithm_M.h b/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_algorithm_M.h index 1883cade5ac..8dd7d237951 100644 --- a/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_algorithm_M.h +++ b/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_algorithm_M.h @@ -73,7 +73,7 @@ Polynomial modular_gcd_utcf_algorithm_M( typedef Polynomial Poly; typedef Polynomial_traits_d PT; - typedef typename PT::Innermost_coefficient IC; + typedef typename PT::Innermost_coefficient_type IC; // will paly the role of content typedef typename CGAL::Scalar_factor_traits::Scalar Scalar; diff --git a/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_dfai.h b/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_dfai.h index f0a480db24f..e3ddafc3a47 100644 --- a/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_dfai.h +++ b/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_dfai.h @@ -76,7 +76,7 @@ Polynomial modular_gcd_utcf_dfai( Poly FF2 = FF2_; typedef Polynomial_traits_d PT; - typedef typename PT::Innermost_coefficient IC; + typedef typename PT::Innermost_coefficient_type IC; typename Coercion_traits::Cast ictp; typename PT::Innermost_coefficient_begin begin; diff --git a/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_pure_wang.h b/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_pure_wang.h index dd841fbb7ba..210bf7e9948 100644 --- a/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_pure_wang.h +++ b/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_pure_wang.h @@ -129,7 +129,7 @@ Polynomial modular_gcd_utcf_pure_wang( typename WT_POLY::Wang wang; - typedef typename PT::Innermost_coefficient IC; + typedef typename PT::Innermost_coefficient_type IC; typename Coercion_traits::Cast ictp; typename PT::Innermost_leading_coefficient ilcoeff; diff --git a/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_with_wang.h b/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_with_wang.h index d50259c95ea..a0b1aabd686 100644 --- a/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_with_wang.h +++ b/Polynomial/include/CGAL/Polynomial/modular_gcd_utcf_with_wang.h @@ -89,7 +89,7 @@ Polynomial modular_gcd_utcf_with_wang( typename WT_POLY::Wang wang; - typedef typename PT::Innermost_coefficient IC; + typedef typename PT::Innermost_coefficient_type IC; typename CGAL::Coercion_traits::Cast ictp; typename PT::Innermost_leading_coefficient ilcoeff; diff --git a/Polynomial/include/CGAL/Polynomial/polynomial_gcd.h b/Polynomial/include/CGAL/Polynomial/polynomial_gcd.h index 296a6464985..d44460e60a0 100644 --- a/Polynomial/include/CGAL/Polynomial/polynomial_gcd.h +++ b/Polynomial/include/CGAL/Polynomial/polynomial_gcd.h @@ -96,7 +96,7 @@ Polynomial gcd_( { typedef Polynomial POLY; typedef Polynomial_traits_d PT; - typedef typename PT::Innermost_coefficient IC; + typedef typename PT::Innermost_coefficient_type IC; typename PT::Multivariate_content mcont; IC mcont_p1 = mcont(p1); @@ -116,13 +116,13 @@ Polynomial gcd_( * \relates CGAL::Polynomial * \brief return the greatest common divisor of \c p1 and \c p2 * - * \pre Requires \c Innermost_coefficient to be a \c Field or a \c UFDomain. + * \pre Requires \c Innermost_coefficient_type to be a \c Field or a \c UFDomain. */ template inline Polynomial gcd(const Polynomial& p1, const Polynomial& p2) { - typedef typename CGALi::Innermost_coefficient >::Type IC; + typedef typename CGALi::Innermost_coefficient_type >::Type IC; typedef typename Algebraic_structure_traits::Algebraic_category Algebraic_category; // Filter for zero-polynomials diff --git a/Polynomial/include/CGAL/Polynomial/polynomial_utils.h b/Polynomial/include/CGAL/Polynomial/polynomial_utils.h index 0ffc08ae31e..866b76370ed 100644 --- a/Polynomial/include/CGAL/Polynomial/polynomial_utils.h +++ b/Polynomial/include/CGAL/Polynomial/polynomial_utils.h @@ -64,7 +64,7 @@ namespace CGALi { Polynomial canonicalize_polynomial_(Polynomial p, CGAL::Tag_true) { typedef Polynomial POLY; - typedef typename Polynomial_traits_d::Innermost_coefficient IC; + typedef typename Polynomial_traits_d::Innermost_coefficient_type IC; typename Polynomial_traits_d::Innermost_leading_coefficient ilcoeff; typename Algebraic_extension_traits::Normalization_factor nfac; @@ -110,7 +110,7 @@ namespace CGALi { Polynomial canonicalize_polynomial(const Polynomial& p) { typedef Polynomial POLY; - typedef typename Polynomial_traits_d::Innermost_coefficient IC; + typedef typename Polynomial_traits_d::Innermost_coefficient_type IC; typedef typename Algebraic_extension_traits::Is_extended Is_extended; if (p.is_zero()) return p; diff --git a/Polynomial/include/CGAL/Polynomial/resultant.h b/Polynomial/include/CGAL/Polynomial/resultant.h index 45f49cf54f1..450c898ff63 100644 --- a/Polynomial/include/CGAL/Polynomial/resultant.h +++ b/Polynomial/include/CGAL/Polynomial/resultant.h @@ -141,7 +141,7 @@ CGAL::Polynomial resultant_interpolate( typedef CGAL::Polynomial Coeff_1; typedef CGAL::Polynomial POLY; typedef CGAL::Polynomial_traits_d PT; - typedef typename PT::Innermost_coefficient IC; + typedef typename PT::Innermost_coefficient_type IC; CGAL_precondition(PT::d >= 2); @@ -227,7 +227,7 @@ Coeff resultant_modularize( typedef Polynomial_traits_d > PT; typedef typename PT::Polynomial_d Polynomial; - typedef typename PT::Innermost_coefficient IC; + typedef typename PT::Innermost_coefficient_type IC; typedef Chinese_remainder_traits CRT; diff --git a/Polynomial/include/CGAL/Polynomial/square_free_factorization.h b/Polynomial/include/CGAL/Polynomial/square_free_factorization.h index bee4347f15f..7ec1ddeb210 100644 --- a/Polynomial/include/CGAL/Polynomial/square_free_factorization.h +++ b/Polynomial/include/CGAL/Polynomial/square_free_factorization.h @@ -156,7 +156,7 @@ inline int square_free_factorization_for_regular_polynomial_ typedef Polynomial POLY; typedef Polynomial_traits_d PT; - typedef typename Polynomial_traits_d::Innermost_coefficient IC; + 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; diff --git a/Polynomial/include/CGAL/Polynomial_traits_d.h b/Polynomial/include/CGAL/Polynomial_traits_d.h index 84d6f1e873d..7bec4176d5d 100644 --- a/Polynomial/include/CGAL/Polynomial_traits_d.h +++ b/Polynomial/include/CGAL/Polynomial_traits_d.h @@ -29,25 +29,25 @@ #include #define CGAL_POLYNOMIAL_TRAITS_D_BASE_TYPEDEFS \ - typedef Polynomial_traits_d< Polynomial< Coefficient_ > > PT; \ - typedef Polynomial_traits_d< Coefficient_ > PTC; \ + typedef Polynomial_traits_d< Polynomial< Coefficient_type_ > > PT; \ + typedef Polynomial_traits_d< Coefficient_type_ > PTC; \ \ public: \ - typedef Polynomial Polynomial_d; \ - typedef Coefficient_ Coefficient; \ + typedef Polynomial Polynomial_d; \ + typedef Coefficient_type_ Coefficient_type; \ \ - typedef typename Innermost_coefficient::Type \ - Innermost_coefficient; \ + typedef typename Innermost_coefficient_type::Type \ + Innermost_coefficient_type; \ static const int d = Dimension::value; \ \ \ private: \ - typedef std::pair< Exponent_vector, Innermost_coefficient > \ + typedef std::pair< Exponent_vector, Innermost_coefficient_type > \ Exponents_coeff_pair; \ typedef std::vector< Exponents_coeff_pair > Monom_rep; \ \ typedef CGAL::Recursive_const_flattening< d-1, \ - typename CGAL::Polynomial::const_iterator > \ + typename CGAL::Polynomial::const_iterator > \ Coefficient_flattening; \ \ public: \ @@ -63,7 +63,7 @@ namespace CGALi { // Base class for functors depending on the algebraic category of the // innermost coefficient -template< class Coefficient_, class ICoeffAlgebraicCategory > +template< class Coefficient_type_, class ICoeffAlgebraicCategory > class Polynomial_traits_d_base_icoeff_algebraic_category { public: typedef Null_functor Multivariate_content; @@ -73,34 +73,34 @@ public: }; // Specializations -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Integral_domain_without_division_tag > + Polynomial< Coefficient_type_ >, Integral_domain_without_division_tag > : public Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Null_tag > {}; + Polynomial< Coefficient_type_ >, Null_tag > {}; -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Integral_domain_tag > + Polynomial< Coefficient_type_ >, Integral_domain_tag > : public Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Integral_domain_without_division_tag > {}; + Polynomial< Coefficient_type_ >, Integral_domain_without_division_tag > {}; -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Unique_factorization_domain_tag > + Polynomial< Coefficient_type_ >, Unique_factorization_domain_tag > : public Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Integral_domain_tag > { + Polynomial< Coefficient_type_ >, Integral_domain_tag > { CGAL_POLYNOMIAL_TRAITS_D_BASE_TYPEDEFS public: struct Multivariate_content - : public std::unary_function< Polynomial_d , Innermost_coefficient >{ - Innermost_coefficient + : public std::unary_function< Polynomial_d , Innermost_coefficient_type >{ + Innermost_coefficient_type operator()(const Polynomial_d& p) const { typedef Innermost_coefficient_iterator IT; - Innermost_coefficient content(0); + Innermost_coefficient_type content(0); for (IT it = typename PT::Innermost_coefficient_begin()(p); it != typename PT::Innermost_coefficient_end()(p); it++){ @@ -112,36 +112,36 @@ public: }; }; -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Euclidean_ring_tag > + Polynomial< Coefficient_type_ >, Euclidean_ring_tag > : public Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Unique_factorization_domain_tag > + Polynomial< Coefficient_type_ >, Unique_factorization_domain_tag > {}; -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Field_tag > + Polynomial< Coefficient_type_ >, Field_tag > : public Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Integral_domain_tag > { + Polynomial< Coefficient_type_ >, Integral_domain_tag > { CGAL_POLYNOMIAL_TRAITS_D_BASE_TYPEDEFS public: // Multivariate_content; struct Multivariate_content - : public std::unary_function< Polynomial_d , Innermost_coefficient >{ - Innermost_coefficient operator()(const Polynomial_d& p) const { + : public std::unary_function< Polynomial_d , Innermost_coefficient_type >{ + Innermost_coefficient_type operator()(const Polynomial_d& p) const { if( CGAL::is_zero(p) ) - return Innermost_coefficient(0); + return Innermost_coefficient_type(0); else - return Innermost_coefficient(1); + return Innermost_coefficient_type(1); } }; // // Disabled for release // struct Interpolate{ -// typedef Polynomial Polynomial_1; +// typedef Polynomial Polynomial_1; // void operator() ( // const Polynomial_1& m1, const Polynomial_d& u1, @@ -190,27 +190,27 @@ public: // }; }; -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Field_with_sqrt_tag > + Polynomial< Coefficient_type_ >, Field_with_sqrt_tag > : public Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Field_tag > {}; + Polynomial< Coefficient_type_ >, Field_tag > {}; -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Field_with_kth_root_tag > + Polynomial< Coefficient_type_ >, Field_with_kth_root_tag > : public Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Field_with_sqrt_tag > {}; + Polynomial< Coefficient_type_ >, Field_with_sqrt_tag > {}; -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Field_with_root_of_tag > + Polynomial< Coefficient_type_ >, Field_with_root_of_tag > : public Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, Field_with_kth_root_tag > {}; + Polynomial< Coefficient_type_ >, Field_with_kth_root_tag > {}; // Base class for functors depending on the algebraic category of the // Polynomial type -template< class Coefficient_, class PolynomialAlgebraicCategory > +template< class Coefficient_type_, class PolynomialAlgebraicCategory > class Polynomial_traits_d_base_polynomial_algebraic_category { public: typedef Null_functor Univariate_content; @@ -218,34 +218,34 @@ public: }; // Specializations -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_polynomial_algebraic_category< - Polynomial< Coefficient_ >, Integral_domain_without_division_tag > + Polynomial< Coefficient_type_ >, Integral_domain_without_division_tag > : public Polynomial_traits_d_base_polynomial_algebraic_category< - Polynomial< Coefficient_ >, Null_tag > {}; + Polynomial< Coefficient_type_ >, Null_tag > {}; -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_polynomial_algebraic_category< - Polynomial< Coefficient_ >, Integral_domain_tag > + Polynomial< Coefficient_type_ >, Integral_domain_tag > : public Polynomial_traits_d_base_polynomial_algebraic_category< - Polynomial< Coefficient_ >, Integral_domain_without_division_tag > {}; + Polynomial< Coefficient_type_ >, Integral_domain_without_division_tag > {}; -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_polynomial_algebraic_category< - Polynomial< Coefficient_ >, Unique_factorization_domain_tag > + Polynomial< Coefficient_type_ >, Unique_factorization_domain_tag > : public Polynomial_traits_d_base_polynomial_algebraic_category< - Polynomial< Coefficient_ >, Integral_domain_tag > { + Polynomial< Coefficient_type_ >, Integral_domain_tag > { CGAL_POLYNOMIAL_TRAITS_D_BASE_TYPEDEFS public: // Univariate_content struct Univariate_content - : public std::unary_function< Polynomial_d , Coefficient>{ - Coefficient operator()(const Polynomial_d& p) const { + : public std::unary_function< Polynomial_d , Coefficient_type>{ + Coefficient_type operator()(const Polynomial_d& p) const { return p.content(); } - Coefficient operator()(Polynomial_d p, int i) const { + Coefficient_type operator()(Polynomial_d p, int i) const { return typename PT::Swap()(p,i,PT::d-1).content(); } }; @@ -273,10 +273,10 @@ public: OutputIterator operator()( const Polynomial_d& p , OutputIterator oi, - Innermost_coefficient& a ) { + Innermost_coefficient_type& a ) { if( CGAL::is_zero(p) ) { - a = Innermost_coefficient(0); + a = Innermost_coefficient_type(0); return oi; } @@ -290,11 +290,11 @@ public: }; }; -template< class Coefficient_ > +template< class Coefficient_type_ > class Polynomial_traits_d_base_polynomial_algebraic_category< - Polynomial< Coefficient_ >, Euclidean_ring_tag > + Polynomial< Coefficient_type_ >, Euclidean_ring_tag > : public Polynomial_traits_d_base_polynomial_algebraic_category< - Polynomial< Coefficient_ >, Unique_factorization_domain_tag > {}; + Polynomial< Coefficient_type_ >, Unique_factorization_domain_tag > {}; // Polynomial_traits_d_base class connecting the two base classes which depend @@ -302,16 +302,16 @@ class Polynomial_traits_d_base_polynomial_algebraic_category< // nomial type. // First the general base class for the innermost coefficient -template< class InnermostCoefficient, +template< class InnermostCoefficient_type, class ICoeffAlgebraicCategory, class PolynomialAlgebraicCategory > class Polynomial_traits_d_base { - typedef InnermostCoefficient ICoeff; + typedef InnermostCoefficient_type ICoeff; public: static const int d = 0; typedef ICoeff Polynomial_d; - typedef ICoeff Coefficient; - typedef ICoeff Innermost_coefficient; + typedef ICoeff Coefficient_type; + typedef ICoeff Innermost_coefficient_type; struct Degree : public std::unary_function< ICoeff , int > { @@ -387,9 +387,9 @@ public: struct Degree_vector{ typedef Exponent_vector result_type; - typedef Coefficient argument_type; + typedef Coefficient_type argument_type; // returns the exponent vector of inner_most_lcoeff. - result_type operator()(const Coefficient&){ + result_type operator()(const Coefficient_type&){ return Exponent_vector(); } }; @@ -411,15 +411,15 @@ public: typename CGAL::Coercion_traits< typename std::iterator_traits::value_type, - Innermost_coefficient>::Type + Innermost_coefficient_type>::Type operator()( - const Innermost_coefficient& p, + const Innermost_coefficient_type& p, Input_iterator begin, Input_iterator end){ CGAL_precondition(end == begin); typedef typename std::iterator_traits::value_type value_type; - typedef CGAL::Coercion_traits CT; + typedef CGAL::Coercion_traits CT; return typename CT::Cast()(p); } }; @@ -433,16 +433,16 @@ public: typename CGAL::Coercion_traits< typename std::iterator_traits::value_type, - Innermost_coefficient>::Type + Innermost_coefficient_type>::Type operator()( - const Innermost_coefficient& p, + const Innermost_coefficient_type& p, Input_iterator begin, Input_iterator end, int hdegree){ typedef typename std::iterator_traits::value_type value_type; - typedef CGAL::Coercion_traits CT; + typedef CGAL::Coercion_traits CT; typename CT::Type result = typename CT::Cast()(CGAL::ipower(*begin++,hdegree)) * typename CT::Cast()(p); @@ -457,14 +457,14 @@ public: // Now the version for the polynomials with all functors provided by all // polynomials -template< class Coefficient_, +template< class Coefficient_type_, class ICoeffAlgebraicCategory, class PolynomialAlgebraicCategory > -class Polynomial_traits_d_base< Polynomial< Coefficient_ >, +class Polynomial_traits_d_base< Polynomial< Coefficient_type_ >, ICoeffAlgebraicCategory, PolynomialAlgebraicCategory > : public Polynomial_traits_d_base_icoeff_algebraic_category< - Polynomial< Coefficient_ >, ICoeffAlgebraicCategory >, + Polynomial< Coefficient_type_ >, ICoeffAlgebraicCategory >, public Polynomial_traits_d_base_polynomial_algebraic_category< - Polynomial< Coefficient_ >, PolynomialAlgebraicCategory > { + Polynomial< Coefficient_type_ >, PolynomialAlgebraicCategory > { CGAL_POLYNOMIAL_TRAITS_D_BASE_TYPEDEFS @@ -475,13 +475,13 @@ class Polynomial_traits_d_base< Polynomial< Coefficient_ >, private: struct Compare_exponents_coeff_pair : public std::binary_function< - std::pair< Exponent_vector, Innermost_coefficient >, - std::pair< Exponent_vector, Innermost_coefficient >, + std::pair< Exponent_vector, Innermost_coefficient_type >, + std::pair< Exponent_vector, Innermost_coefficient_type >, bool > { bool operator()( - const std::pair< Exponent_vector, Innermost_coefficient >& p1, - const std::pair< Exponent_vector, Innermost_coefficient >& p2 ) const { + const std::pair< Exponent_vector, Innermost_coefficient_type >& p1, + const std::pair< Exponent_vector, Innermost_coefficient_type >& p2 ) const { // TODO: Precondition leads to an error within test_translate in // Polynomial_traits_d test // CGAL_precondition( p1.first != p2.first ); @@ -511,63 +511,63 @@ public: } //! construct the constant polynomial a0 - Polynomial_d operator() (const Coefficient& a0) const + Polynomial_d operator() (const Coefficient_type& a0) const {return Polynomial_d(a0);} //! construct the polynomial a0 + a1*x Polynomial_d operator() ( - const Coefficient& a0, const Coefficient& a1) const + const Coefficient_type& a0, const Coefficient_type& a1) const {return Polynomial_d(a0,a1);} //! construct the polynomial a0 + a1*x + a2*x^2 Polynomial_d operator() ( - const Coefficient& a0, const Coefficient& a1, - const Coefficient& a2) const + const Coefficient_type& a0, const Coefficient_type& a1, + const Coefficient_type& a2) const {return Polynomial_d(a0,a1,a2);} //! construct the polynomial a0 + a1*x + ... + a3*x^3 Polynomial_d operator() ( - const Coefficient& a0, const Coefficient& a1, - const Coefficient& a2, const Coefficient& a3) const + const Coefficient_type& a0, const Coefficient_type& a1, + const Coefficient_type& a2, const Coefficient_type& a3) const {return Polynomial_d(a0,a1,a2,a3);} //! construct the polynomial a0 + a1*x + ... + a4*x^4 Polynomial_d operator() ( - const Coefficient& a0, const Coefficient& a1, - const Coefficient& a2, const Coefficient& a3, - const Coefficient& a4) const + const Coefficient_type& a0, const Coefficient_type& a1, + const Coefficient_type& a2, const Coefficient_type& a3, + const Coefficient_type& a4) const {return Polynomial_d(a0,a1,a2,a3,a4);} //! construct the polynomial a0 + a1*x + ... + a5*x^5 Polynomial_d operator() ( - const Coefficient& a0, const Coefficient& a1, - const Coefficient& a2, const Coefficient& a3, - const Coefficient& a4, const Coefficient& a5) const + const Coefficient_type& a0, const Coefficient_type& a1, + const Coefficient_type& a2, const Coefficient_type& a3, + const Coefficient_type& a4, const Coefficient_type& a5) const {return Polynomial_d(a0,a1,a2,a3,a4,a5);} //! construct the polynomial a0 + a1*x + ... + a6*x^6 Polynomial_d operator() ( - const Coefficient& a0, const Coefficient& a1, - const Coefficient& a2, const Coefficient& a3, - const Coefficient& a4, const Coefficient& a5, - const Coefficient& a6) const + const Coefficient_type& a0, const Coefficient_type& a1, + const Coefficient_type& a2, const Coefficient_type& a3, + const Coefficient_type& a4, const Coefficient_type& a5, + const Coefficient_type& a6) const {return Polynomial_d(a0,a1,a2,a3,a4,a5,a6);} //! construct the polynomial a0 + a1*x + ... + a7*x^7 Polynomial_d operator() ( - const Coefficient& a0, const Coefficient& a1, - const Coefficient& a2, const Coefficient& a3, - const Coefficient& a4, const Coefficient& a5, - const Coefficient& a6, const Coefficient& a7) const + const Coefficient_type& a0, const Coefficient_type& a1, + const Coefficient_type& a2, const Coefficient_type& a3, + const Coefficient_type& a4, const Coefficient_type& a5, + const Coefficient_type& a6, const Coefficient_type& a7) const {return Polynomial_d(a0,a1,a2,a3,a4,a5,a6,a7);} //! construct the polynomial a0 + a1*x + ... + a8*x^8 Polynomial_d operator() ( - const Coefficient& a0, const Coefficient& a1, - const Coefficient& a2, const Coefficient& a3, - const Coefficient& a4, const Coefficient& a5, - const Coefficient& a6, const Coefficient& a7, - const Coefficient& a8) const + const Coefficient_type& a0, const Coefficient_type& a1, + const Coefficient_type& a2, const Coefficient_type& a3, + const Coefficient_type& a4, const Coefficient_type& a5, + const Coefficient_type& a6, const Coefficient_type& a7, + const Coefficient_type& a8) const {return Polynomial_d(a0,a1,a2,a3,a4,a5,a6,a7,a8);} @@ -588,7 +588,7 @@ public: Input_iterator end , Tag_false) const { std::sort(begin,end,Compare_exponents_coeff_pair()); - return Create_polynomial_from_monom_rep< Coefficient >()( begin, end ); + return Create_polynomial_from_monom_rep< Coefficient_type >()( begin, end ); } template< class Input_iterator > @@ -596,7 +596,7 @@ public: operator()( Input_iterator begin, Input_iterator end ) const { if(begin == end ) return Polynomial_d(0); typedef typename Input_iterator::value_type value_type; - typedef Boolean_tag::value> + typedef Boolean_tag::value> Is_coeff; std::vector vec(begin,end); return construct(vec.begin(),vec.end(),Is_coeff()); @@ -607,7 +607,7 @@ public: Polynomial_d operator()( Input_iterator begin, Input_iterator end , bool is_sorted) const { if(is_sorted) - return Create_polynomial_from_monom_rep< Coefficient >()( begin, end ); + return Create_polynomial_from_monom_rep< Coefficient_type >()( begin, end ); else return (*this)(begin,end); } @@ -622,10 +622,10 @@ public: Monom_rep_iterator begin, Monom_rep_iterator end) const { - std::vector< Innermost_coefficient > coefficients; + std::vector< Innermost_coefficient_type > coefficients; for(Monom_rep_iterator it = begin; it != end; it++){ while( it->first[0] > (int) coefficients.size() ){ - coefficients.push_back(Innermost_coefficient(0)); + coefficients.push_back(Innermost_coefficient_type(0)); } coefficients.push_back(it->second); } @@ -640,18 +640,18 @@ public: Monom_rep_iterator begin, Monom_rep_iterator end) const { - typedef Polynomial_traits_d PT; + typedef Polynomial_traits_d PT; typename PT::Construct_polynomial construct; - BOOST_STATIC_ASSERT(PT::d != 0); // Coefficient is a Polynomial - std::vector coefficients; + BOOST_STATIC_ASSERT(PT::d != 0); // Coefficient_type is a Polynomial + std::vector coefficients; Monom_rep_iterator it = begin; while(it != end){ int current_exp = it->first[PT::d]; // fill up with zeros until current exp is reached while( (int) coefficients.size() < current_exp){ - coefficients.push_back(Coefficient(0)); + coefficients.push_back(Coefficient_type(0)); } // collect all coeffs for this exp Monom_rep monoms; @@ -671,17 +671,17 @@ public: // Get_coefficient; struct Get_coefficient - : public std::binary_function { + : public std::binary_function { - Coefficient operator()( const Polynomial_d& p, int i) const { + Coefficient_type operator()( const Polynomial_d& p, int i) const { CGAL_precondition( i >= 0 ); typename PT::Degree degree; if( i > degree(p) ) - return Coefficient(0); + return Coefficient_type(0); return p[i]; } - Coefficient operator()( const Polynomial_d& p, int i, int index) const { + Coefficient_type operator()( const Polynomial_d& p, int i, int index) const { CGAL_precondition(0 <= index && index < d); return (*this)(Swap()(p,index,d-1),i); } @@ -690,10 +690,10 @@ public: // Get_innermost_coefficient; struct Get_innermost_coefficient : public - std::binary_function< Polynomial_d, Exponent_vector, Innermost_coefficient > + std::binary_function< Polynomial_d, Exponent_vector, Innermost_coefficient_type > { - Innermost_coefficient + Innermost_coefficient_type operator()( const Polynomial_d& p, Exponent_vector ev ) const { CGAL_precondition( !ev.empty() ); typename PTC::Get_innermost_coefficient gic; @@ -716,12 +716,12 @@ public: Polynomial_d operator()(const Polynomial_d& p, int i, int j ) const { CGAL_precondition(0 <= i && i < d); CGAL_precondition(0 <= j && j < d); - typedef std::pair< Exponent_vector, Innermost_coefficient > + typedef std::pair< Exponent_vector, Innermost_coefficient_type > Exponents_coeff_pair; typedef std::vector< Exponents_coeff_pair > Monom_rep; Get_monom_representation gmr; typename Construct_polynomial - ::template Create_polynomial_from_monom_rep< Coefficient > construct; + ::template Create_polynomial_from_monom_rep< Coefficient_type > construct; Monom_rep mon_rep; gmr( p, std::back_inserter( mon_rep ) ); for( typename Monom_rep::iterator it = mon_rep.begin(); @@ -750,7 +750,7 @@ public: operator()(const Polynomial_d& p, int i, int j = (d-1) ) const { CGAL_precondition(0 <= i && i < d); CGAL_precondition(0 <= j && j < d); - typedef std::pair< Exponent_vector, Innermost_coefficient > + typedef std::pair< Exponent_vector, Innermost_coefficient_type > Exponents_coeff_pair; typedef std::vector< Exponents_coeff_pair > Monom_rep; Get_monom_representation gmr; @@ -786,7 +786,7 @@ public: // Total_degree; struct Total_degree : public std::unary_function< Polynomial_d , int >{ int operator()(const Polynomial_d& p) const { - typedef Polynomial_traits_d COEFF_POLY_TRAITS; + typedef Polynomial_traits_d COEFF_POLY_TRAITS; typename COEFF_POLY_TRAITS::Total_degree total_degree; Degree degree; CGAL_precondition( degree(p) >= 0); @@ -802,19 +802,19 @@ public: // Leading_coefficient; struct Leading_coefficient - : public std::unary_function< Polynomial_d , Coefficient>{ - Coefficient operator()(const Polynomial_d& p) const { + : public std::unary_function< Polynomial_d , Coefficient_type>{ + Coefficient_type operator()(const Polynomial_d& p) const { return p.lcoeff(); } - Coefficient operator()(Polynomial_d p, int i) const { + Coefficient_type operator()(Polynomial_d p, int i) const { return Swap()(p,i,PT::d-1).lcoeff(); } }; // Innermost_leading_coefficient; struct Innermost_leading_coefficient - : public std::unary_function< Polynomial_d , Innermost_coefficient>{ - Innermost_coefficient + : public std::unary_function< Polynomial_d , Innermost_coefficient_type>{ + Innermost_coefficient_type operator()(const Polynomial_d& p) const { typename PTC::Innermost_leading_coefficient ilcoeff; typename PT::Leading_coefficient lcoeff; @@ -850,23 +850,23 @@ public: // Evaluate; struct Evaluate - :public std::unary_function{ + :public std::unary_function{ // Evaluate with respect to one variable - Coefficient - operator()(const Polynomial_d& p, Coefficient x) const { + Coefficient_type + operator()(const Polynomial_d& p, Coefficient_type x) const { return p.evaluate(x); } - Coefficient - operator()(const Polynomial_d& p, Coefficient x, int i ) const { + Coefficient_type + operator()(const Polynomial_d& p, Coefficient_type x, int i ) const { return Move()(p,i).evaluate(x); } -#define ICOEFF typename First_if_different::Type - Coefficient operator() +#define ICOEFF typename First_if_different::Type + Coefficient_type operator() ( const Polynomial_d& p, const ICOEFF& x) const { return p.evaluate(x); } - Coefficient operator() + Coefficient_type operator() (const Polynomial_d& p, const ICOEFF& x, int i) const { return Move()(p,i,PT::d-1).evaluate(x); @@ -876,29 +876,29 @@ public: // Evaluate_homogeneous; struct Evaluate_homogeneous{ - typedef Coefficient result_type; + typedef Coefficient_type result_type; typedef Polynomial_d first_argument_type; - typedef Coefficient second_argument_type; - typedef Coefficient third_argument_type; + typedef Coefficient_type second_argument_type; + typedef Coefficient_type third_argument_type; - Coefficient operator()( - const Polynomial_d& p, Coefficient a, Coefficient b) const + Coefficient_type operator()( + const Polynomial_d& p, Coefficient_type a, Coefficient_type b) const { return p.evaluate_homogeneous(a,b); } - Coefficient operator()( - const Polynomial_d& p, Coefficient a, Coefficient b, int i) const + Coefficient_type operator()( + const Polynomial_d& p, Coefficient_type a, Coefficient_type b, int i) const { return Move()(p,i,PT::d-1).evaluate_homogeneous(a,b); } -#define ICOEFF typename First_if_different::Type - Coefficient operator() +#define ICOEFF typename First_if_different::Type + Coefficient_type operator() ( const Polynomial_d& p, const ICOEFF& a, const ICOEFF& b) const { return p.evaluate_homogeneous(a,b); } - Coefficient operator() + Coefficient_type operator() (const Polynomial_d& p, const ICOEFF& a, const ICOEFF& b, int i) const { return Move()(p,i,PT::d-1).evaluate_homogeneous(a,b); @@ -910,7 +910,7 @@ public: // Is_zero_at; struct Is_zero_at { private: - typedef Algebraic_structure_traits AST; + typedef Algebraic_structure_traits AST; typedef typename AST::Is_zero::result_type BOOL; public: typedef BOOL result_type; @@ -928,7 +928,7 @@ public: // Is_zero_at_homogeneous; struct Is_zero_at_homogeneous { private: - typedef Algebraic_structure_traits AST; + typedef Algebraic_structure_traits AST; typedef typename AST::Is_zero::result_type BOOL; public: typedef BOOL result_type; @@ -948,7 +948,7 @@ public: private: struct Sign_at_ { private: - typedef Real_embeddable_traits RT; + typedef Real_embeddable_traits RT; typedef typename RT::Sign::result_type SIGN; public: typedef SIGN result_type; @@ -965,7 +965,7 @@ private: }; struct Sign_at_homogeneous_ { - typedef Real_embeddable_traits RT; + typedef Real_embeddable_traits RT; typedef typename RT::Sign::result_type SIGN; public: typedef SIGN result_type; @@ -989,7 +989,7 @@ private: } }; - typedef Real_embeddable_traits RET_IC; + typedef Real_embeddable_traits RET_IC; typedef typename RET_IC::Is_real_embeddable IC_is_real_embeddable; public: typedef typename ::boost::mpl::if_::type Sign_at; @@ -1036,7 +1036,7 @@ public: Integral_division_up_to_constant_factor idiv_utcf; Derivative diff; - Coefficient content = ucontent_utcf( p ); + Coefficient_type content = ucontent_utcf( p ); typename PTC::Is_square_free isf; if( !isf( content ) ) @@ -1060,7 +1060,7 @@ public: Derivative diff; typename PTC::Make_square_free msf; - Coefficient content = ucontent_utcf(p); + Coefficient_type content = ucontent_utcf(p); Polynomial_d result = Polynomial_d(msf(content)); Polynomial_d regular_part = idiv_utcf(p,Polynomial_d(content)); @@ -1079,7 +1079,7 @@ public: void operator()( const Polynomial_d& f, const Polynomial_d& g, - Polynomial_d& q, Polynomial_d& r, Coefficient& D) const { + Polynomial_d& q, Polynomial_d& r, Coefficient_type& D) const { Polynomial_d::pseudo_division(f,g,q,r,D); } }; @@ -1090,7 +1090,7 @@ public: Polynomial_d operator()(const Polynomial_d& f, const Polynomial_d& g) const { Polynomial_d q,r; - Coefficient D; + Coefficient_type D; Polynomial_d::pseudo_division(f,g,q,r,D); return q; } @@ -1102,7 +1102,7 @@ public: Polynomial_d operator()(const Polynomial_d& f, const Polynomial_d& g) const { Polynomial_d q,r; - Coefficient D; + Coefficient_type D; Polynomial_d::pseudo_division(f,g,q,r,D); return r; } @@ -1122,13 +1122,13 @@ public: :public std::binary_function { Polynomial_d operator()(const Polynomial_d& p, const Polynomial_d& q) const { - typedef Innermost_coefficient IC; + typedef Innermost_coefficient_type IC; typename PT::Construct_polynomial construct; typename PT::Innermost_leading_coefficient ilcoeff; typename PT::Innermost_coefficient_begin begin; typename PT::Innermost_coefficient_end end; - typedef Algebraic_extension_traits AET; + typedef Algebraic_extension_traits AET; typename AET::Denominator_for_algebraic_integers dfai; typename AET::Normalization_factor nfac; @@ -1146,15 +1146,15 @@ public: }; struct Univariate_content_up_to_constant_factor - :public std::unary_function { - Coefficient + :public std::unary_function { + Coefficient_type operator()(const Polynomial_d& p) const { typename PTC::Gcd_up_to_constant_factor gcd_utcf; - if(CGAL::is_zero(p)) return Coefficient(0); - if(PT::d == 1) return Coefficient(1); + if(CGAL::is_zero(p)) return Coefficient_type(0); + if(PT::d == 1) return Coefficient_type(1); - Coefficient result(0); + Coefficient_type result(0); for(typename Polynomial_d::const_iterator it = p.begin(); it != p.end(); it++){ @@ -1167,8 +1167,8 @@ public: struct Square_free_factorization_up_to_constant_factor { private: - typedef Coefficient Coeff; - typedef Innermost_coefficient ICoeff; + typedef Coefficient_type Coeff; + typedef Innermost_coefficient_type ICoeff; // rsqff_utcf computes the sqff recursively for Coeff // end of recursion: ICoeff @@ -1184,7 +1184,7 @@ public: OutputIterator oi) const { typename PTC::Square_free_factorization_up_to_constant_factor sqff; - std::vector > fac_mul_pairs; + std::vector > fac_mul_pairs; sqff(c,std::back_inserter(fac_mul_pairs)); for(unsigned int i = 0; i < fac_mul_pairs.size(); i++){ @@ -1203,7 +1203,7 @@ public: Univariate_content_up_to_constant_factor ucontent_utcf; Integral_division_up_to_constant_factor idiv_utcf; - Coefficient c = ucontent_utcf(p); + Coefficient_type c = ucontent_utcf(p); p = idiv_utcf( p , Polynomial_d(c)); std::vector factors; @@ -1272,19 +1272,19 @@ public: struct Translate : public std::binary_function< Polynomial_d , Polynomial_d, - Innermost_coefficient >{ + Innermost_coefficient_type >{ Polynomial_d operator()( Polynomial_d p, - const Innermost_coefficient& c, + const Innermost_coefficient_type& c, int i = (d-1)) const { if (i == (d-1) ){ - p.translate(Coefficient(c)); + p.translate(Coefficient_type(c)); }else{ Swap swap; p = swap(p,i,d-1); - p.translate(Coefficient(c)); + p.translate(Coefficient_type(c)); p = swap(p,i,d-1); } return p; @@ -1294,20 +1294,20 @@ public: struct Translate_homogeneous{ typedef Polynomial_d result_type; typedef Polynomial_d first_argument_type; - typedef Innermost_coefficient second_argument_type; - typedef Innermost_coefficient third_argument_type; + typedef Innermost_coefficient_type second_argument_type; + typedef Innermost_coefficient_type third_argument_type; Polynomial_d operator()(Polynomial_d p, - const Innermost_coefficient& a, - const Innermost_coefficient& b, + const Innermost_coefficient_type& a, + const Innermost_coefficient_type& b, int i = (d-1) ) const { if (i == (d-1) ){ - p.translate(Coefficient(a), Coefficient(b) ); + p.translate(Coefficient_type(a), Coefficient_type(b) ); }else{ Swap swap; p = swap(p,i,d-1); - p.translate(Coefficient(a), Coefficient(b)); + p.translate(Coefficient_type(a), Coefficient_type(b)); p = swap(p,i,d-1); } return p; @@ -1316,12 +1316,12 @@ public: struct Scale : public - std::binary_function< Polynomial_d, Innermost_coefficient, Polynomial_d > { + std::binary_function< Polynomial_d, Innermost_coefficient_type, Polynomial_d > { - Polynomial_d operator()( Polynomial_d p, const Innermost_coefficient& c, + Polynomial_d operator()( Polynomial_d p, const Innermost_coefficient_type& c, int i = (PT::d-1) ) { typename PT::Scale_homogeneous scale_homogeneous; - return scale_homogeneous( p, c, Innermost_coefficient(1), i ); + return scale_homogeneous( p, c, Innermost_coefficient_type(1), i ); } }; @@ -1329,26 +1329,26 @@ public: struct Scale_homogeneous{ typedef Polynomial_d result_type; typedef Polynomial_d first_argument_type; - typedef Innermost_coefficient second_argument_type; - typedef Innermost_coefficient third_argument_type; + typedef Innermost_coefficient_type second_argument_type; + typedef Innermost_coefficient_type third_argument_type; Polynomial_d operator()( Polynomial_d p, - const Innermost_coefficient& a, - const Innermost_coefficient& b, + const Innermost_coefficient_type& a, + const Innermost_coefficient_type& b, int i = (d-1) ) const { CGAL_precondition( ! CGAL::is_zero(b) ); if (i == (d-1) ) p = Swap()(p,i,d-1); if(CGAL::is_one(b)) - p.scale_up(Coefficient(a)); + p.scale_up(Coefficient_type(a)); else if(CGAL::is_one(a)) - p.scale_down(Coefficient(b)); + p.scale_down(Coefficient_type(b)); else - p.scale(Coefficient(a), Coefficient(b) ); + p.scale(Coefficient_type(a), Coefficient_type(b) ); if (i == (d-1) ) p = Swap()(p,i,d-1); @@ -1357,9 +1357,9 @@ public: }; struct Resultant - : public std::binary_function{ + : public std::binary_function{ - Coefficient + Coefficient_type operator()( const Polynomial_d& p, const Polynomial_d& q, @@ -1469,7 +1469,7 @@ public: // struct Get_monom_representation { - typedef std::pair< Exponent_vector, Innermost_coefficient > + typedef std::pair< Exponent_vector, Innermost_coefficient_type > Exponents_coeff_pair; typedef std::vector< Exponents_coeff_pair > Monom_rep; @@ -1486,7 +1486,7 @@ public: create_monom_representation ( const Polynomial_d& p, OutputIterator oit, Tag_true ) const{ for( int exponent = 0; exponent <= p.degree(); ++exponent ) { - if ( p[exponent] != Coefficient(0) ){ + if ( p[exponent] != Coefficient_type(0) ){ Exponent_vector exp_vec; exp_vec.push_back( exponent ); *oit = Exponents_coeff_pair( exp_vec, p[exponent] ); @@ -1499,7 +1499,7 @@ public: ( const Polynomial_d& p, OutputIterator oit, Tag_false ) const { for( int exponent = 0; exponent <= p.degree(); ++exponent ) { Monom_rep monom_rep; - typedef Polynomial_traits_d< Coefficient > PT; + typedef Polynomial_traits_d< Coefficient_type > PT; typename PT::Get_monom_representation gmr; gmr( p[exponent], std::back_inserter( monom_rep ) ); for( typename Monom_rep::iterator it = monom_rep.begin(); @@ -1532,7 +1532,7 @@ public: template typename CGAL::Coercion_traits< typename std::iterator_traits::value_type, - Innermost_coefficient + Innermost_coefficient_type >::Type operator()( const Polynomial_d& p, @@ -1546,7 +1546,7 @@ public: template typename CGAL::Coercion_traits< typename std::iterator_traits::value_type, - Innermost_coefficient + Innermost_coefficient_type >::Type operator()( const Polynomial_d& p, @@ -1562,7 +1562,7 @@ public: typename CGAL::Coercion_traits ::value_type, - Innermost_coefficient>::Type + Innermost_coefficient_type>::Type operator()( const Polynomial_d& p, Input_iterator begin, @@ -1571,7 +1571,7 @@ public: typedef typename std::iterator_traits::value_type value_type; - typedef CGAL::Coercion_traits CT; + typedef CGAL::Coercion_traits CT; typename PTC::Substitute subs; typename CT::Type x = typename CT::Cast()(*(--end)); @@ -1597,7 +1597,7 @@ public: struct Result_type{ typedef std::iterator_traits ITT; typedef typename ITT::value_type value_type; - typedef Coercion_traits CT; + typedef Coercion_traits CT; typedef typename CT::Type Type; }; @@ -1633,7 +1633,7 @@ public: typedef std::iterator_traits ITT; typedef typename ITT::value_type value_type; - typedef Coercion_traits CT; + typedef Coercion_traits CT; typedef typename CT::Type Type; typename PTC::Substitute_homogeneous subsh; @@ -1665,7 +1665,7 @@ template< class Polynomial > class Polynomial_traits_d : public CGALi::Polynomial_traits_d_base< Polynomial, typename Algebraic_structure_traits< -typename CGALi::Innermost_coefficient::Type >::Algebraic_category, +typename CGALi::Innermost_coefficient_type::Type >::Algebraic_category, typename Algebraic_structure_traits< Polynomial >::Algebraic_category > , public Algebraic_structure_traits{ diff --git a/Polynomial/test/Polynomial/Interpolator.cpp b/Polynomial/test/Polynomial/Interpolator.cpp index 64fac4ada75..bd36644cdd3 100644 --- a/Polynomial/test/Polynomial/Interpolator.cpp +++ b/Polynomial/test/Polynomial/Interpolator.cpp @@ -18,8 +18,8 @@ static CGAL::Random my_rnd(346); // some seed template void test_interpolator(){ typedef typename CGAL::Polynomial_traits_d PT; - typedef typename PT::Innermost_coefficient IC; - typedef typename PT::Coefficient Coeff; + typedef typename PT::Innermost_coefficient_type IC; + typedef typename PT::Coefficient_type Coeff; for(int k = 0 ; k < 5; k++){ // gen some polynomial diff --git a/Polynomial/test/Polynomial/Polynomial.cpp b/Polynomial/test/Polynomial/Polynomial.cpp index 0dbf336d81e..53e0f01c985 100644 --- a/Polynomial/test/Polynomial/Polynomial.cpp +++ b/Polynomial/test/Polynomial/Polynomial.cpp @@ -1019,12 +1019,12 @@ void test_interoperable_with(){ template void test_interoperable_poly(){ typedef CGAL::Polynomial_traits_d PT; - typedef typename PT::Coefficient Coefficient; - typedef typename PT::Innermost_coefficient Innermost_coefficient; + typedef typename PT::Coefficient_type Coefficient_type; + typedef typename PT::Innermost_coefficient_type Innermost_coefficient_type; test_interoperable_with(); - test_interoperable_with(); - test_interoperable_with(); + test_interoperable_with(); + test_interoperable_with(); test_interoperable_with(); @@ -1035,8 +1035,8 @@ void test_interoperable_at(){ typedef typename AT::Integer Integer; typedef CGAL::Sqrt_extension EXT; { - typedef int Coefficient; - typedef CGAL::Polynomial Poly_1; + typedef int Coefficient_type; + typedef CGAL::Polynomial Poly_1; typedef CGAL::Polynomial Poly_2; typedef CGAL::Polynomial Poly_3; typedef CGAL::Polynomial Poly_4; @@ -1045,8 +1045,8 @@ void test_interoperable_at(){ // test_interoperable_poly(); // test_interoperable_poly(); }{ - typedef Integer Coefficient; - typedef CGAL::Polynomial Poly_1; + typedef Integer Coefficient_type; + typedef CGAL::Polynomial Poly_1; typedef CGAL::Polynomial Poly_2; typedef CGAL::Polynomial Poly_3; typedef CGAL::Polynomial Poly_4; @@ -1055,8 +1055,8 @@ void test_interoperable_at(){ // test_interoperable_poly(); // test_interoperable_poly(); }{ - typedef EXT Coefficient; - typedef CGAL::Polynomial Poly_1; + typedef EXT Coefficient_type; + typedef CGAL::Polynomial Poly_1; typedef CGAL::Polynomial Poly_2; typedef CGAL::Polynomial Poly_3; typedef CGAL::Polynomial Poly_4; diff --git a/Polynomial/test/Polynomial/Polynomial_traits_d.cpp b/Polynomial/test/Polynomial/Polynomial_traits_d.cpp index 03a3bec495f..43cf0bde597 100644 --- a/Polynomial/test/Polynomial/Polynomial_traits_d.cpp +++ b/Polynomial/test/Polynomial/Polynomial_traits_d.cpp @@ -28,8 +28,8 @@ static CGAL::Random my_rnd(346); // some seed #define CGAL_SNAP_CGALi_TRAITS_D(T) \ typedef T PT; \ typedef typename PT::Polynomial_d Polynomial_d; \ - typedef typename PT::Coefficient Coeff; \ - typedef typename PT::Innermost_coefficient ICoeff; \ + typedef typename PT::Coefficient_type Coeff; \ + typedef typename PT::Innermost_coefficient_type ICoeff; \ typedef CGAL::Polynomial_traits_d PTC; \ typedef CGAL::Exponent_vector Exponent_vector; \ typedef std::pair< CGAL::Exponent_vector , ICoeff > Monom; @@ -459,7 +459,7 @@ void test_multivariate_content(const Polynomial_traits_d&){ //void test_interpolate(const Polynomial_traits_d&) { // std::cerr << "start test_interpolate "; std::cerr.flush(); // typedef Polynomial_traits_d PT_d; -// typedef typename PT_d::Innermost_coefficient ICoeff; +// typedef typename PT_d::Innermost_coefficient_type ICoeff; // typedef typename PT_d::Polynomial_d Polynomial_d; // typedef typename PT_d:: template Rebind::Other PT_1; // typedef typename PT_1::Polynomial_d Polynomial_1; @@ -1287,25 +1287,25 @@ void test_substitute(const Polynomial_traits_d&){ std::cerr << "start test_substitute "; std::cerr.flush(); CGAL_SNAP_CGALi_TRAITS_D(Polynomial_traits_d); typename PT::Substitute substitute; (void) substitute; - typedef typename PT::Innermost_coefficient Innermost_coefficient; + typedef typename PT::Innermost_coefficient_type Innermost_coefficient_type; - std::list list; + std::list list; for(int i = 0; i < PT::d; i++){ - list.push_back(Innermost_coefficient(i)); + list.push_back(Innermost_coefficient_type(i)); } - assert(Innermost_coefficient(0) + assert(Innermost_coefficient_type(0) == substitute(Polynomial_d(0),list.begin(),list.end())); - assert(Innermost_coefficient(1) + assert(Innermost_coefficient_type(1) == substitute(Polynomial_d(1),list.begin(),list.end())); - assert(Innermost_coefficient(2) + assert(Innermost_coefficient_type(2) == substitute(Polynomial_d(2),list.begin(),list.end())); - assert(Innermost_coefficient(-2) + assert(Innermost_coefficient_type(-2) == substitute(Polynomial_d(-2),list.begin(),list.end())); for(int i = 0; i< 5; i++){ typedef typename PT - :: template Rebind::Other PT_2; + :: template Rebind::Other PT_2; typedef typename PT_2::Polynomial_d Polynomial_2; std::vector vector1,vector2; for(int j = 0; j < PT::d; j++){ @@ -1331,26 +1331,26 @@ void test_substitute_homogeneous(const Polynomial_traits_d&){ CGAL_SNAP_CGALi_TRAITS_D(Polynomial_traits_d); typename PT::Substitute_homogeneous substitute_homogeneous; (void) substitute_homogeneous; - typedef typename PT::Innermost_coefficient Innermost_coefficient; + typedef typename PT::Innermost_coefficient_type Innermost_coefficient_type; - std::list list; + std::list list; for(int i = 0; i < PT::d; i++){ - list.push_back(Innermost_coefficient(i)); + list.push_back(Innermost_coefficient_type(i)); } - list.push_back(Innermost_coefficient(3)); - assert(Innermost_coefficient(0) + list.push_back(Innermost_coefficient_type(3)); + assert(Innermost_coefficient_type(0) == substitute_homogeneous(Polynomial_d(0),list.begin(),list.end())); - assert(Innermost_coefficient(1) + assert(Innermost_coefficient_type(1) == substitute_homogeneous(Polynomial_d(1),list.begin(),list.end())); - assert(Innermost_coefficient(2) + assert(Innermost_coefficient_type(2) == substitute_homogeneous(Polynomial_d(2),list.begin(),list.end())); - assert(Innermost_coefficient(-2) + assert(Innermost_coefficient_type(-2) == substitute_homogeneous(Polynomial_d(-2),list.begin(),list.end())); for(int i = 0; i< 2; i++){ typedef typename PT - :: template Rebind::Other PT_2; + :: template Rebind::Other PT_2; typedef typename PT_2::Polynomial_d Polynomial_2; std::vector vec1,vec2; for(int j = 0; j < PT::d+1; j++){ @@ -1440,7 +1440,7 @@ void test_real_embeddable_functors(const PT& traits, CGAL::Tag_true){ template< class PT > void test_real_embeddable_functors(const PT&, CGAL::Tag_false){ - // Since Innermost_coefficient is not RealEmbeddable the following functors + // Since Innermost_coefficient_type is not RealEmbeddable the following functors // should be CGAL::Null_functor. ASSERT_IS_NULL_FUNCTOR(typename PT::Sign_at); ASSERT_IS_NULL_FUNCTOR(typename PT::Sign_at_homogeneous); @@ -1468,7 +1468,7 @@ void test_ac_icoeff_functors(const PT& traits, CGAL::Field_tag){ // test_interpolate(traits); } -// test functors depending on the Algebraic_category of Coefficient +// test functors depending on the Algebraic_category of Coefficient_type template< class PT > void test_ac_poly_functors(const PT&, CGAL::Integral_domain_without_division_tag){ ASSERT_IS_NULL_FUNCTOR(typename PT::Univariate_content); @@ -1487,8 +1487,8 @@ void test_ac_poly_functors(const PT& traits, CGAL::Unique_factorization_domain_t template< class PT > void test_polynomial_traits_d(const PT& traits){ typedef typename PT::Polynomial_d Polynomial_d; - typedef typename PT::Innermost_coefficient ICoeff; - typedef typename PT::Coefficient Coeff; + typedef typename PT::Innermost_coefficient_type ICoeff; + typedef typename PT::Coefficient_type Coeff; test_fundamental_functors(traits); @@ -1504,62 +1504,62 @@ void test_polynomial_traits_d(const PT& traits){ } -template< class InnermostCoefficient > +template< class InnermostCoefficient_type > void test_multiple_dimensions() { { - typedef CGAL::Polynomial< InnermostCoefficient > Polynomial_1; + typedef CGAL::Polynomial< InnermostCoefficient_type > Polynomial_1; const int dimension = 1; typedef Polynomial_1 Polynomial_d; - typedef InnermostCoefficient Coefficient; - typedef InnermostCoefficient Innermost_coefficient; + typedef InnermostCoefficient_type Coefficient_type; + typedef InnermostCoefficient_type Innermost_coefficient_type; typedef CGAL::Polynomial_traits_d PT; - typedef CGAL::Algebraic_structure_traits AST_IC; + typedef CGAL::Algebraic_structure_traits AST_IC; typedef typename AST_IC::Algebraic_category Algebraic_category; BOOST_STATIC_ASSERT( (boost::is_same::value)); BOOST_STATIC_ASSERT( - (boost::is_same< typename PT::Coefficient, Coefficient>::value)); - BOOST_STATIC_ASSERT((boost::is_same< typename PT::Innermost_coefficient, - Innermost_coefficient>::value)); + (boost::is_same< typename PT::Coefficient_type, Coefficient_type>::value)); + BOOST_STATIC_ASSERT((boost::is_same< typename PT::Innermost_coefficient_type, + Innermost_coefficient_type>::value)); BOOST_STATIC_ASSERT((PT::d == dimension)); test_polynomial_traits_d(PT()); } { - typedef CGAL::Polynomial< InnermostCoefficient > Polynomial_1; + typedef CGAL::Polynomial< InnermostCoefficient_type > Polynomial_1; typedef CGAL::Polynomial Polynomial_2; const int dimension = 2; typedef Polynomial_2 Polynomial_d; - typedef Polynomial_1 Coefficient; - typedef InnermostCoefficient Innermost_coefficient; + typedef Polynomial_1 Coefficient_type; + typedef InnermostCoefficient_type Innermost_coefficient_type; typedef CGAL::Polynomial_traits_d PT; - typedef CGAL::Algebraic_structure_traits AST_IC; + typedef CGAL::Algebraic_structure_traits AST_IC; typedef typename AST_IC::Algebraic_category Algebraic_category; BOOST_STATIC_ASSERT( (boost::is_same::value)); BOOST_STATIC_ASSERT( - (boost::is_same< typename PT::Coefficient, Coefficient>::value)); - BOOST_STATIC_ASSERT((boost::is_same< typename PT::Innermost_coefficient, - Innermost_coefficient>::value)); + (boost::is_same< typename PT::Coefficient_type, Coefficient_type>::value)); + BOOST_STATIC_ASSERT((boost::is_same< typename PT::Innermost_coefficient_type, + Innermost_coefficient_type>::value)); BOOST_STATIC_ASSERT((PT::d == dimension)); test_polynomial_traits_d(PT()); } { - typedef CGAL::Polynomial< InnermostCoefficient > Polynomial_1; + typedef CGAL::Polynomial< InnermostCoefficient_type > Polynomial_1; typedef CGAL::Polynomial Polynomial_2; typedef CGAL::Polynomial Polynomial_3; const int dimension = 3; typedef Polynomial_3 Polynomial_d; - typedef Polynomial_2 Coefficient; - typedef InnermostCoefficient Innermost_coefficient; + typedef Polynomial_2 Coefficient_type; + typedef InnermostCoefficient_type Innermost_coefficient_type; - typedef CGAL::Algebraic_structure_traits AST_IC; + typedef CGAL::Algebraic_structure_traits AST_IC; typedef typename AST_IC::Algebraic_category Algebraic_category; typedef CGAL::Polynomial_traits_d PT; @@ -1567,9 +1567,9 @@ void test_multiple_dimensions() { BOOST_STATIC_ASSERT( (boost::is_same::value)); BOOST_STATIC_ASSERT( - (boost::is_same< typename PT::Coefficient, Coefficient>::value)); - BOOST_STATIC_ASSERT((boost::is_same< typename PT::Innermost_coefficient, - Innermost_coefficient>::value)); + (boost::is_same< typename PT::Coefficient_type, Coefficient_type>::value)); + BOOST_STATIC_ASSERT((boost::is_same< typename PT::Innermost_coefficient_type, + Innermost_coefficient_type>::value)); BOOST_STATIC_ASSERT((PT::d == dimension)); test_polynomial_traits_d(PT()); } diff --git a/Polynomial/test/Polynomial/include/CGAL/gen_sparse_polynomial.h b/Polynomial/test/Polynomial/include/CGAL/gen_sparse_polynomial.h index c8e778e5bd4..69bd0bc6755 100644 --- a/Polynomial/test/Polynomial/include/CGAL/gen_sparse_polynomial.h +++ b/Polynomial/test/Polynomial/include/CGAL/gen_sparse_polynomial.h @@ -13,7 +13,7 @@ Polynomial_d_ generate_sparse_random_polynomial(CGAL::Random random, int max_degree = 6){ typedef CGAL::Polynomial_traits_d PT; - typedef typename PT::Innermost_coefficient IC; + typedef typename PT::Innermost_coefficient_type IC; typedef typename PT::Polynomial_d Polynomial_d; typename PT::Construct_polynomial construct; @@ -64,7 +64,7 @@ Polynomial_d generate_polynomial_degree_each(CGAL::Random random, int max_degree = 6, int bits = 5){ typedef CGAL::Polynomial_traits_d PT; - typedef typename PT::Innermost_coefficient IC; + typedef typename PT::Innermost_coefficient_type IC; typename PT::Construct_polynomial construct; typedef CGAL::Exponent_vector Exponent_vector; diff --git a/Polynomial/test/Polynomial/resultant.cpp b/Polynomial/test/Polynomial/resultant.cpp index 1568a3c38d9..9cd2a0724cf 100644 --- a/Polynomial/test/Polynomial/resultant.cpp +++ b/Polynomial/test/Polynomial/resultant.cpp @@ -30,7 +30,7 @@ static CGAL::Random my_rnd(346); // some seed template void test_resultant(){ typedef typename CGAL::Polynomial_traits_d PT; - typedef typename PT::Coefficient Coeff; + typedef typename PT::Coefficient_type Coeff; typename PT::Resultant resultant; {