*add non documented conjugate() to Sqrt_extension (root_of_2 testsuite)

*fix template specialization of Standardise (detected thanks to a bug of gcc-4.1.2)
*add missing template ACDE_TAG and FP_TAG at few places
This commit is contained in:
Sébastien Loriot 2011-05-19 12:15:44 +00:00
parent 1d8d585685
commit ba1c543c27
5 changed files with 22 additions and 16 deletions

View File

@ -47,12 +47,12 @@ struct Get_max_coefficient{
}
};
template <class NT, class Root>
struct Get_max_coefficient<CGAL::Sqrt_extension<NT, Root> >{
template <class NT, class Root,class ACDE_TAG, class FP_TAG>
struct Get_max_coefficient<CGAL::Sqrt_extension<NT, Root, ACDE_TAG, FP_TAG> >{
typedef Get_max_coefficient<NT> GMC;
typedef typename GMC::result_type result_type;
result_type operator () (const CGAL::Sqrt_extension<NT, Root>& a) {
result_type operator () (const CGAL::Sqrt_extension<NT, Root, ACDE_TAG, FP_TAG>& a) {
GMC gmc;
return std::max(std::max(gmc(a.a0()), gmc(a.a1())), gmc(NT(a.root())));
}

View File

@ -153,9 +153,9 @@ struct Curve_renderer_traits_base
struct Rat_to_float {
typedef Float result_type;
template <class X, class Y>
Float operator()(const Sqrt_extension<X, Y>& x) const {
typename CGAL::Coercion_traits<Sqrt_extension<X, Y>, Float>::Cast
template <class X, class Y,class ACDE_TAG,class FP_TAG>
Float operator()(const Sqrt_extension<X, Y, ACDE_TAG, FP_TAG>& x) const {
typename CGAL::Coercion_traits<Sqrt_extension<X, Y, ACDE_TAG, FP_TAG>, Float>::Cast
cast;
return cast(x);
}
@ -502,9 +502,9 @@ struct Curve_renderer_traits<leda::bigfloat, class leda::rational>
struct Rat_to_float {
typedef Float result_type;
template <class X, class Y>
Float operator()(const Sqrt_extension<X, Y>& x) const {
typename CGAL::Coercion_traits<Sqrt_extension<X, Y>, Float>::Cast
template <class X, class Y,class ACDE_TAG,class FP_TAG>
Float operator()(const Sqrt_extension<X, Y, ACDE_TAG, FP_TAG>& x) const {
typename CGAL::Coercion_traits<Sqrt_extension<X, Y, ACDE_TAG, FP_TAG>, Float>::Cast
cast;
return cast(x);
}

View File

@ -43,11 +43,11 @@ class Algebraic_extension_traits<CGAL::Sqrt_extension<COEFF,ROOT,ACDE_TAG,FP_TAG
}
};
template <class COEFF_, class ROOT_>
class Standardise<CGAL::Sqrt_extension<COEFF_,ROOT_,ACDE_TAG,FP_TAG> > {
template <class COEFF_, class ROOT_,class ACDE_TAG_,class FP_TAG_>
class Standardise<CGAL::Sqrt_extension<COEFF_,ROOT_,ACDE_TAG_,FP_TAG_> > {
Standardise<COEFF_> standardise;
public:
typedef CGAL::Sqrt_extension<COEFF_,ROOT_,ACDE_TAG,FP_TAG> Type_;
typedef CGAL::Sqrt_extension<COEFF_,ROOT_,ACDE_TAG_,FP_TAG_> Type_;
typedef Type_ argument_type;
typedef Type_ result_type;
Type_ operator () (const Type_& a) const {

View File

@ -212,6 +212,12 @@ public:
}
}
Self conjugate() const
{
if(!is_extended_) return *this;
return Self(a0_,-a1_,root_);
}
//! Access operator for a0_, \c const
inline const NT& a0() const { return a0_; }

View File

@ -60,13 +60,13 @@ NT my_rand()
//----------------------
template<class T>
bool is_RO2_class(const CGAL::Sqrt_extension<T,T>& ){ return true;}
template<class T,class ACDE_TAG,class FP_TAG>
bool is_RO2_class(const CGAL::Sqrt_extension<T,T,ACDE_TAG,FP_TAG>& ){ return true;}
template<class T>
bool is_RO2_class(const T& ){ return false;}
template<class T>
CGAL::Sqrt_extension<T,T> conjugate(const CGAL::Sqrt_extension<T,T>& R){
template<class T,class ACDE_TAG,class FP_TAG>
CGAL::Sqrt_extension<T,T,ACDE_TAG,FP_TAG> conjugate(const CGAL::Sqrt_extension<T,T,ACDE_TAG,FP_TAG>& R){
return R.conjugate();
}