Modified, due to porting of interval_support from EXACUS2CGAL. The new

interval_support is now in the Number_types package.
This commit is contained in:
Ralf Schindlbeck 2008-02-14 09:42:23 +00:00
parent edd70f970a
commit d590c9e011
6 changed files with 25 additions and 12 deletions

View File

@ -596,18 +596,18 @@ public:
}
long final_prec = set_precision(BF(),get_precision(BF())+4);
BFI bfi = CGALi::hull(convert_to_bfi(lower(*this)),
BFI bfi = CGAL::hull(convert_to_bfi(lower(*this)),
convert_to_bfi(upper(*this)));
while( !singleton(bfi) &&
get_significant_bits(bfi) < final_prec ){
refine(*this);
bfi = CGALi::hull(
bfi = CGAL::hull(
convert_to_bfi(lower(*this)),
convert_to_bfi(upper(*this)));
}
double_y
= CGAL::to_double((CGALi::lower(bfi)+ CGALi::upper(bfi)) / 2);
= CGAL::to_double((CGAL::lower(bfi)+ CGAL::upper(bfi)) / 2);
}
set_precision(BF(),old_prec);
return std::make_pair(double_x, double_y);

View File

@ -21,7 +21,8 @@
#include <CGAL/Polynomial.h>
#include <CGAL/Polynomial_traits_d.h>
#include <CGAL/Polynomial/may_have_common_factor.h>
#include <CGAL/Algebraic_kernel_d/interval_support.h>
// #include <CGAL/Algebraic_kernel_d/interval_support.h>
#include <CGAL/interval_support.h>
//#include <NiX/NT_traits.h>
//#include <NiX/univariate_polynomial_utils.h>

View File

@ -25,7 +25,8 @@
#include <CGAL/basic.h>
#include <CGAL/Sqrt_extension.h>
#include <CGAL/Algebraic_kernel_d/interval_support.h>
// #include <CGAL/Algebraic_kernel_d/interval_support.h>
#include <CGAL/interval_support.h>
#include <CGAL/Algebraic_kernel_d/Integer_iterator.h>
#include <CGAL/Algebraic_kernel_d/Real_embeddable_extension.h>

View File

@ -22,13 +22,15 @@
#ifdef CGAL_USE_LEDA
#include <LEDA/numbers/digit.h>
#include <CGAL/Algebraic_kernel_d/leda_interval_support.h>
// #include <CGAL/Algebraic_kernel_d/leda_interval_support.h>
#include <CGAL/leda_interval_support.h>
#endif
#ifdef CGAL_USE_CORE
#include <CGAL/Number_types/core_interval_support.h>
// #include <CGAL/Number_types/core_interval_support.h>
#include <CGAL/core_interval_support.h>
#endif
@ -210,7 +212,7 @@ namespace CGALi {
struct Floor_log2_abs
: public Unary_function< CORE::BigFloat, long > {
long operator()( CORE::BigFloat x ) const {
CGAL_precondition(!CGALi::in_zero(x));
CGAL_precondition(!CGAL::in_zero(x));
x = CGAL::abs(x);
return CORE::floorLg(x.m()-x.err())+x.exp()*14;
}

View File

@ -22,6 +22,8 @@
#ifndef CGAL_ALGEBRAIC_KERNEL_D_INTERVAL_SUPPORT_H
#define CGAL_ALGEBRAIC_KERNEL_D_INTERVAL_SUPPORT_H
#if 0
// TODO: Remove #define (also from Arithmetic_kernel.h) if Algebraic_kernel_d is
// part of the release
#ifndef CGAL_INTERN_USE_BFI
@ -34,11 +36,13 @@
#include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_LEDA
#include <CGAL/Algebraic_kernel_d/leda_interval_support.h>
// #include <CGAL/Algebraic_kernel_d/leda_interval_support.h>
#include <CGAL/leda_interval_support.h>
#endif // LiS_HAVE_LEDA
#ifdef CGAL_USE_CORE
#include <CGAL/Number_types/core_interval_support.h>
// #include <CGAL/Number_types/core_interval_support.h>
#include <CGAL/core_interval_support.h>
#endif // LiS_HAVE_LEDA
@ -95,4 +99,6 @@ convert_to_bfi(const Algebraic_real_pure< COEFF, RAT, POLICY, REPCLASS >& x){
CGAL_END_NAMESPACE
#endif
#endif // NiX_INTERVAL_SUPPORT_H

View File

@ -20,6 +20,8 @@
#ifndef CGAL_ALGEBRAIC_KERNEL_D_LEDA_INTERVAL_SUPPORT_H
#define CGAL_ALGEBRAIC_KERNEL_D_LEDA_INTERVAL_SUPPORT_H
#if 0
#include <CGAL/basic.h>
#include <CGAL/leda_bigfloat.h>
#include <boost/numeric/interval.hpp>
@ -115,7 +117,7 @@ namespace interval_lib{
};
}//namespace interval_lib
/*
inline
std::ostream& operator <<
(std::ostream& os, const boost::numeric::interval<leda::bigfloat>& x)
@ -126,7 +128,7 @@ std::ostream& operator <<
<< x.upper().get_significant() << "*2^" << x.upper().get_exponent()
<< "]";
return os;
}
}*/
}//namespace numeric
}//namespace boost
@ -296,5 +298,6 @@ std::pair<double, double> to_interval( const CGALi::leda_bigfloat_interval& x )
CGAL_END_NAMESPACE
#endif
#endif // CGAL_ALGEBRAIC_KERNEL_D_LEDA_INTERVAL_SUPPORT_H