1 // Copyright (c) 2006-2009 Max-Planck-Institute Saarbruecken (Germany). 2 // All rights reserved. 3 // 4 // This file is part of CGAL (www.cgal.org) 5 // 6 // $URL: https://github.com/CGAL/cgal/blob/v5.3/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d_1.h $ 7 // $Id: Algebraic_kernel_d_1.h 0779373 2020-03-26T13:31:46+01:00 Sébastien Loriot 8 // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial 9 // 10 // 11 // Author(s) : Michael Hemmer <hemmer@mpi-inf.mpg.de> 12 // Sebastian Limbach <slimbach@mpi-inf.mpg.de> 13 // Michael Kerber <mkerber@mpi-inf.mpg.de> 14 // 15 // ============================================================================ 16 17 #ifndef CGAL_ALGEBRAIC_KERNEL_D_1_H 18 #define CGAL_ALGEBRAIC_KERNEL_D_1_H 19 20 #include <CGAL/disable_warnings.h> 21 22 #ifndef CGAL_AK_ENABLE_DEPRECATED_INTERFACE 23 #define CGAL_AK_ENABLE_DEPRECATED_INTERFACE 0 24 #endif 25 26 #include <CGAL/basic.h> 27 #include <CGAL/Algebraic_kernel_d/flags.h> 28 #include <CGAL/Polynomial.h> 29 30 #include <CGAL/Arithmetic_kernel.h> 31 #include <CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h> 32 #include <CGAL/Algebraic_kernel_d/Descartes.h> 33 #include <CGAL/Algebraic_kernel_d/Real_roots.h> 34 #include <CGAL/Algebraic_kernel_d/refine_zero_against.h> 35 #include <CGAL/Algebraic_kernel_d/Interval_evaluate_1.h> 36 #include <CGAL/Algebraic_kernel_d/bound_between_1.h> 37 #include <CGAL/ipower.h> 38 39 namespace CGAL { 40 41 namespace internal { 42 template< class AlgebraicReal1, class Isolator_ > 43 class Algebraic_kernel_d_1_base { 44 45 public: 46 typedef AlgebraicReal1 Algebraic_real_1; 47 typedef Isolator_ Isolator; 48 49 typedef typename Algebraic_real_1::Coefficient Coefficient; 50 typedef typename Algebraic_real_1::Bound Bound; 51 typedef typename Algebraic_real_1::Polynomial_1 Polynomial_1; 52 53 // TODO: Other choice? 54 typedef int size_type; 55 typedef int Multiplicity_type; 56 57 private: 58 typedef CGAL::Polynomial_traits_d< Polynomial_1 > PT_1; 59 60 61 protected: 62 63 // Some functors used for STL calls 64 template<typename A,typename B> 65 struct Pair_first : public CGAL::cpp98::unary_function<std::pair<A,B>,A> { operatorPair_first66 A operator() (std::pair<A,B> pair) const { return pair.first; } 67 }; 68 69 template<typename A,typename B> 70 struct Pair_second : public CGAL::cpp98::unary_function<std::pair<A,B>,B> { operatorPair_second71 B operator() (std::pair<A,B> pair) const { return pair.second; } 72 }; 73 74 public: 75 class Algebraic_real_traits { 76 public: 77 typedef Algebraic_real_1 Type; 78 79 struct Bound_between 80 : public CGAL::cpp98::binary_function< Type, Type, Bound > { operatorBound_between81 Bound operator()( const Type& t1, 82 const Type& t2 ) const { 83 #if CGAL_AK_DONT_USE_SIMPLE_BOUND_BETWEEN 84 #warning uses deprecated bound_between_1 functor 85 return t1.rational_between( t2 ); 86 #else 87 return internal::simple_bound_between(t1,t2); 88 #endif 89 } 90 }; 91 92 struct Lower_bound 93 : public CGAL::cpp98::unary_function< Type, Bound > { operatorLower_bound94 Bound operator()( const Type& t ) const { 95 return t.low(); 96 } 97 }; 98 99 struct Upper_bound 100 : public CGAL::cpp98::unary_function< Type, Bound > { operatorUpper_bound101 Bound operator()( const Type& t ) const { 102 return t.high(); 103 } 104 }; 105 106 struct Refine 107 : public CGAL::cpp98::unary_function< Type, void > { operatorRefine108 void operator()( const Type& t ) const { 109 t.refine(); 110 } 111 operatorRefine112 void operator()( Type& t, int rel_prec ) const { 113 // If t is zero, we can refine the interval to 114 // infinite precission 115 if( CGAL::is_zero( t ) ) { 116 t = Type(0); 117 } else { 118 // Refine until both boundaries have the same sign 119 while( CGAL::sign( t.high() ) != 120 CGAL::sign( t.low() ) ) 121 t.refine(); 122 123 CGAL_assertion( CGAL::sign( t.high() ) != CGAL::ZERO && 124 CGAL::sign( t.low() ) != CGAL::ZERO ); 125 126 // Calculate the needed precision 127 Bound prec = Bound(1) / 128 CGAL::ipower( Bound(2), rel_prec ); 129 130 // Refine until precision is reached 131 while( CGAL::abs( t.high() - t.low() ) / 132 (CGAL::max)( CGAL::abs( t.high() ), 133 CGAL::abs( t.low() ) ) > prec ) { 134 t.refine(); 135 136 CGAL_assertion( CGAL::sign( t.high() ) != CGAL::ZERO && 137 CGAL::sign( t.low() ) != CGAL::ZERO ); 138 139 } 140 } 141 } 142 }; 143 144 struct Approximate_absolute_1: 145 public CGAL::cpp98::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{ 146 std::pair<Bound,Bound> operatorApproximate_absolute_1147 operator()(const Algebraic_real_1& x, int prec) const { 148 Lower_bound lower; 149 Upper_bound upper; 150 Refine refine; 151 Bound l = lower(x); 152 Bound u = upper(x); 153 Bound error = CGAL::ipower(Bound(2),CGAL::abs(prec)); 154 while((prec>0)?((u-l)*error>Bound(1)):((u-l)>error)){ 155 refine(x); 156 u = upper(x); 157 l = lower(x); 158 } 159 return std::make_pair(l,u); 160 } 161 }; 162 163 struct Approximate_relative_1: 164 public CGAL::cpp98::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{ 165 std::pair<Bound,Bound> operatorApproximate_relative_1166 operator()(const Algebraic_real_1& x, int prec) const { 167 168 if(CGAL::is_zero(x)) return std::make_pair(Bound(0),Bound(0)); 169 170 Lower_bound lower; 171 Upper_bound upper; 172 Refine refine; 173 Bound l = lower(x); 174 Bound u = upper(x); 175 Bound error = CGAL::ipower(Bound(2),CGAL::abs(prec)); 176 Bound min_b = (CGAL::min)(CGAL::abs(u),CGAL::abs(l)); 177 while((prec>0)?((u-l)*error>min_b):((u-l)>error*min_b)){ 178 refine(x); 179 u = upper(x); 180 l = lower(x); 181 min_b = (CGAL::min)(CGAL::abs(u),CGAL::abs(l)); 182 } 183 return std::make_pair(l,u); 184 } 185 }; 186 187 #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE 188 typedef Lower_bound Lower_boundary; 189 typedef Upper_bound Upper_boundary; 190 typedef Bound_between Boundary_between; 191 #endif 192 193 194 }; // class Algebraic_real_traits 195 196 struct Construct_algebraic_real_1; 197 198 // Functors of Algebraic_kernel_d_1 199 struct Solve_1 { 200 public: 201 template <class OutputIterator> 202 OutputIterator operatorSolve_1203 operator()(const Polynomial_1& p, OutputIterator oi) const { 204 #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE 205 #else 206 CGAL_precondition(!CGAL::is_zero(p)); 207 #endif 208 internal::Real_roots< Algebraic_real_1, Isolator > real_roots; 209 std::list< int > mults; 210 std::list< Algebraic_real_1 > roots; 211 real_roots( p, std::back_inserter(roots), std::back_inserter( mults ) ); 212 CGAL_assertion(roots.size()==mults.size()); 213 std::list<int>::iterator mit =mults.begin(); 214 typename std::list< Algebraic_real_1 >::iterator rit = roots.begin(); 215 while(rit != roots.end()) { 216 //*oi++ = std::make_pair(*rit, (unsigned int)(*mit)); 217 *oi++ = std::make_pair(*rit, *mit); 218 rit++; 219 mit++; 220 } 221 return oi; 222 } 223 224 #if 1 || CGAL_AK_ENABLE_DEPRECATED_INTERFACE 225 template< class OutputIterator > operatorSolve_1226 OutputIterator operator()( 227 const Polynomial_1& p, 228 OutputIterator oi , 229 bool known_to_be_square_free) const { 230 return this->operator()(p,known_to_be_square_free,oi); 231 } 232 #endif 233 234 template< class OutputIterator > operatorSolve_1235 OutputIterator operator()( 236 const Polynomial_1& p, 237 bool known_to_be_square_free, 238 OutputIterator oi) const { 239 240 internal::Real_roots< Algebraic_real_1, Isolator > real_roots; 241 #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE 242 #else 243 CGAL_precondition(!CGAL::is_zero(p)); 244 #endif 245 std::list<Algebraic_real_1> roots; 246 if( known_to_be_square_free ){ 247 real_roots(p,std::back_inserter(roots)); 248 }else{ 249 std::list<int> dummy; 250 real_roots(p,std::back_inserter(roots),std::back_inserter(dummy)); 251 } 252 return std::copy(roots.begin(),roots.end(),oi); 253 } 254 255 #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE 256 template< class OutputIteratorRoots , class OutputIteratorMults > 257 std::pair<OutputIteratorRoots,OutputIteratorMults> operatorSolve_1258 operator()( 259 const Polynomial_1& p, 260 OutputIteratorRoots roi, 261 OutputIteratorMults moi) const { 262 263 internal::Real_roots< Algebraic_real_1, Isolator > real_roots; 264 real_roots(p,roi,moi); 265 return std::make_pair(roi,moi); 266 } 267 #endif 268 269 protected: 270 271 /* 272 // TODO: Can we avoid to use this? 273 struct Greater_compare : 274 public CGAL::cpp98::binary_function<Algebraic_real_1,Algebraic_real_1,bool> { 275 276 bool operator() (const Algebraic_real_1& a, const Algebraic_real_1& b) 277 const { 278 return a>b; 279 } 280 281 }; 282 */ 283 284 public: 285 286 template< class OutputIterator > operatorSolve_1287 OutputIterator operator()(const Polynomial_1& p, Bound l, Bound u, 288 OutputIterator res) const { 289 290 std::vector<std::pair<Algebraic_real_1,Multiplicity_type> > roots; 291 this->operator() (p,std::back_inserter(roots)); 292 Algebraic_real_1 alg_l=Construct_algebraic_real_1()(l); 293 Algebraic_real_1 alg_u=Construct_algebraic_real_1()(u); 294 typedef typename 295 std::vector<std::pair<Algebraic_real_1,Multiplicity_type> >::iterator 296 Iterator; 297 Pair_first<Algebraic_real_1,Multiplicity_type> pair_first; 298 Iterator it_start=std::lower_bound 299 (::boost::make_transform_iterator(roots.begin(),pair_first), 300 ::boost::make_transform_iterator(roots.end(),pair_first), 301 alg_l).base(); 302 Iterator it_end=std::upper_bound 303 (::boost::make_transform_iterator(it_start,pair_first), 304 ::boost::make_transform_iterator(roots.end(),pair_first), 305 alg_u).base(); 306 std::copy(it_start,it_end,res); 307 return res; 308 } 309 310 template< class OutputIterator > operatorSolve_1311 OutputIterator operator()(const Polynomial_1& p, 312 bool known_to_be_square_free, 313 Bound l, Bound u, 314 OutputIterator res) const { 315 316 std::vector<Algebraic_real_1 > roots; 317 this->operator() (p,known_to_be_square_free,std::back_inserter(roots)); 318 Algebraic_real_1 alg_l=Construct_algebraic_real_1()(l); 319 Algebraic_real_1 alg_u=Construct_algebraic_real_1()(u); 320 typedef typename 321 std::vector<Algebraic_real_1>::iterator 322 Iterator; 323 Iterator it_start=std::lower_bound(roots.begin(),roots.end(),alg_l); 324 Iterator it_end=std::upper_bound(it_start,roots.end(),alg_u); 325 std::copy(it_start,it_end,res); 326 return res; 327 } 328 329 }; 330 331 class Number_of_solutions_1 332 : public CGAL::cpp98::unary_function<Polynomial_1,size_type> { 333 334 public: 335 operator()336 size_type operator() 337 (const Polynomial_1& p) const { 338 339 std::vector<std::pair<Algebraic_real_1,Multiplicity_type> > roots; 340 Solve_1()(p,std::back_inserter(roots)); 341 return static_cast<size_type>(roots.size()); 342 } 343 344 }; 345 346 347 struct Sign_at_1 348 : public CGAL::cpp98::binary_function< Polynomial_1, Algebraic_real_1, CGAL::Sign > { operatorSign_at_1349 CGAL::Sign operator()( const Polynomial_1& p, const Algebraic_real_1& ar ) const { 350 if(CGAL::is_zero(p)) return ZERO; 351 if(CGAL::degree(p)==0) return p.sign_at(0); 352 if( ar.low() == ar.high() ) return p.sign_at( ar.low() ); 353 354 if (p == ar.polynomial()) { 355 return ZERO; 356 } 357 358 Polynomial_1 g = gcd_utcf(p,ar.polynomial()); 359 if (g.sign_at(ar.low()) != g.sign_at(ar.high())) return ZERO; 360 361 while(internal::descartes(p,ar.low(),ar.high()) > 0) ar.refine(); 362 while( p.sign_at(ar.low()) == ZERO ) ar.refine(); 363 while( p.sign_at(ar.high()) == ZERO ) ar.refine(); 364 365 CGAL::Sign result = p.sign_at(ar.low()); 366 CGAL_assertion(result == p.sign_at(ar.high())); 367 return result; 368 } 369 }; 370 struct Is_zero_at_1 371 : public CGAL::cpp98::binary_function< Polynomial_1, Algebraic_real_1, bool > { operatorIs_zero_at_1372 bool operator()( const Polynomial_1& p, const Algebraic_real_1& ar ) const { 373 if(CGAL::is_zero(p)) return true; 374 if( ar.low() == ar.high() ) return p.sign_at( ar.low() ) == ZERO; 375 Polynomial_1 g = gcd_utcf(p,ar.polynomial()); 376 return g.sign_at(ar.low()) != g.sign_at(ar.high()); 377 } 378 }; 379 380 struct Is_square_free_1 381 : public CGAL::cpp98::unary_function< Polynomial_1, bool > { operatorIs_square_free_1382 bool operator()( const Polynomial_1& p ) const { 383 typename CGAL::Polynomial_traits_d< Polynomial_1 >::Is_square_free isf; 384 return isf(p); 385 } 386 }; 387 388 struct Is_coprime_1 389 : public CGAL::cpp98::binary_function< Polynomial_1, Polynomial_1, bool > { operatorIs_coprime_1390 bool operator()( const Polynomial_1& p1, const Polynomial_1& p2 ) const { 391 typename CGAL::Polynomial_traits_d< Polynomial_1 >::Total_degree total_degree; 392 393 // TODO: Is GCD already filtered? 394 return( total_degree( gcd_utcf( p1, p2 ) ) == 0 ); 395 } 396 }; 397 398 struct Make_square_free_1 399 : public CGAL::cpp98::unary_function< Polynomial_1, Polynomial_1 > { operatorMake_square_free_1400 Polynomial_1 operator()( const Polynomial_1& p ) const { 401 return typename CGAL::Polynomial_traits_d< Polynomial_1 >::Make_square_free()( p ); 402 } 403 }; 404 405 struct Make_coprime_1 { 406 typedef bool result_type; 407 typedef Polynomial_1 first_argument_type; 408 typedef Polynomial_1 second_argument_type; 409 typedef Polynomial_1 third_argument_type; 410 typedef Polynomial_1 fourth_argument_type; 411 typedef Polynomial_1 fifth_argument_type; 412 operatorMake_coprime_1413 bool operator()( const Polynomial_1& p1, 414 const Polynomial_1& p2, 415 Polynomial_1& g, // ggT utcf 416 Polynomial_1& q1, // Rest utcf 417 Polynomial_1& q2 ) const { 418 g = typename CGAL::Polynomial_traits_d< Polynomial_1 >::Gcd_up_to_constant_factor()( p1, p2 ); 419 q1 = p1 / g; 420 q2 = p2 / g; 421 return CGAL::is_one(g); 422 } 423 }; 424 425 426 struct Square_free_factorize_1 { 427 template< class OutputIterator> operatorSquare_free_factorize_1428 OutputIterator operator()( const Polynomial_1& p, OutputIterator it) const { 429 typename PT_1::Square_free_factorize_up_to_constant_factor sqff; 430 return sqff(p,it); 431 } 432 }; 433 434 struct Compute_polynomial_1 : public CGAL::cpp98::unary_function<Algebraic_real_1, 435 Polynomial_1> { operatorCompute_polynomial_1436 Polynomial_1 operator()(const Algebraic_real_1& x) const { 437 return x.polynomial(); 438 } 439 }; 440 441 struct Construct_algebraic_real_1 { 442 443 public: 444 445 typedef Algebraic_real_1 result_type; 446 operatorConstruct_algebraic_real_1447 result_type operator() (int a) const { 448 return Algebraic_real_1(a); 449 } 450 operatorConstruct_algebraic_real_1451 result_type operator() (Bound a) const { 452 return Algebraic_real_1(a); 453 } 454 operatorConstruct_algebraic_real_1455 result_type operator() 456 (typename CGAL::First_if_different<Coefficient,Bound>::Type a) const { 457 Coefficient coeffs[2] = {a,Coefficient(-1)}; 458 Polynomial_1 p = typename PT_1::Construct_polynomial() 459 (coeffs,coeffs+2); 460 std::vector<Algebraic_real_1 > roots; 461 Solve_1()(p,true,std::back_inserter(roots)); 462 CGAL_assertion(roots.size() == size_type(1)); 463 return roots[0]; 464 } 465 466 operatorConstruct_algebraic_real_1467 result_type operator() (Polynomial_1 p,size_type i) 468 const { 469 std::vector<Algebraic_real_1 > roots; 470 Solve_1()(p,true,std::back_inserter(roots)); 471 CGAL_assertion( size_type(roots.size()) > i); 472 return roots[i]; 473 } 474 operatorConstruct_algebraic_real_1475 result_type operator() (Polynomial_1 p, 476 Bound l, Bound u) const { 477 CGAL_precondition(l<u); 478 return Algebraic_real_1(p,l,u); 479 } 480 481 }; 482 483 struct Compare_1 484 : public CGAL::cpp98::binary_function<Algebraic_real_1, 485 Algebraic_real_1, 486 CGAL::Comparison_result>{ 487 488 typedef CGAL::Comparison_result result_type; 489 operatorCompare_1490 result_type operator() (Algebraic_real_1 a,Algebraic_real_1 b) const { 491 return typename Real_embeddable_traits<Algebraic_real_1> 492 ::Compare() (a,b); 493 } 494 operatorCompare_1495 result_type operator() (Algebraic_real_1 a,int b) const { 496 return this->operator()(a,Construct_algebraic_real_1()(b)); 497 } 498 operatorCompare_1499 result_type operator() (Algebraic_real_1 a,Bound b) const { 500 return this->operator()(a,Construct_algebraic_real_1()(b)); 501 } 502 503 operatorCompare_1504 result_type operator() 505 (Algebraic_real_1 a, 506 typename CGAL::First_if_different<Coefficient,Bound>::Type b) const { 507 return this->operator()(a,Construct_algebraic_real_1()(b)); 508 } 509 operatorCompare_1510 result_type operator() (int a, Algebraic_real_1 b) const { 511 return this->operator()(Construct_algebraic_real_1()(a),b); 512 } 513 operatorCompare_1514 result_type operator() (Bound a,Algebraic_real_1 b) const { 515 return this->operator()(Construct_algebraic_real_1()(a),b); 516 } 517 518 operatorCompare_1519 result_type operator() 520 (typename CGAL::First_if_different<Coefficient,Bound>::Type a, 521 Algebraic_real_1 b) const { 522 return this->operator()(Construct_algebraic_real_1()(a),b); 523 } 524 525 }; 526 527 public: 528 529 struct Isolate_1 : public CGAL::cpp98::binary_function 530 < Algebraic_real_1,Polynomial_1,std::pair<Bound,Bound> > { 531 532 public: 533 operatorIsolate_1534 std::pair<Bound,Bound> operator() (const Algebraic_real_1 a, 535 const Polynomial_1 p) const { 536 537 if(p == a.polynomial()) return std::make_pair(a.low(),a.high()); 538 539 std::vector<Algebraic_real_1> roots; 540 // First isolate p... 541 Solve_1()(p,false,std::back_inserter(roots)); 542 typedef typename std::vector<Algebraic_real_1>::iterator Iterator; 543 // Binary search on the root to find a place where a could be inserted 544 std::pair<Iterator,Iterator> it_pair 545 = equal_range(roots.begin(),roots.end(),a); 546 CGAL_assertion(std::distance(it_pair.first,it_pair.second)==0 || 547 std::distance(it_pair.first,it_pair.second)==1); 548 // If we can insert a in two places, it must have been in roots already 549 bool a_in_roots = std::distance(it_pair.first,it_pair.second)==1; 550 if(a_in_roots) { 551 // TODO: can we rely on the property that the isolating intervals 552 // of the roots in p are isolating from each other. What 553 // if p was factorized during isolation? Is that still 554 // guaranteed? To be sure, we do it this way: 555 if(it_pair.first!=roots.begin()) { 556 it_pair.first->strong_refine(*(it_pair.first-1)); 557 } 558 if(it_pair.second!=roots.end()) { 559 it_pair.first->strong_refine(*(it_pair.second)); 560 } 561 return std::make_pair(it_pair.first->low(),it_pair.first->high()); 562 } else { 563 // Refine a until disjoint from neighbors 564 // This is probably not even necessary since the isolating 565 // interval of a isolates against all roots of p thanks to the 566 // comparisons. But to be sure... 567 if(it_pair.first!=roots.begin()) { 568 a.strong_refine(*(it_pair.first-1)); 569 } 570 if(it_pair.first!=roots.end()) { 571 a.strong_refine(*(it_pair.first)); 572 } 573 return std::make_pair(a.low(),a.high()); 574 } 575 } 576 577 }; 578 579 typedef typename Algebraic_real_traits::Bound_between Bound_between_1; 580 typedef typename Algebraic_real_traits::Approximate_absolute_1 Approximate_absolute_1; 581 typedef typename Algebraic_real_traits::Approximate_relative_1 Approximate_relative_1; 582 583 584 585 586 #define CGAL_ALGEBRAIC_KERNEL_1_PRED(Y,Z) Y Z() const { return Y(); } 587 #define CGAL_ALGEBRAIC_KERNEL_1_PRED_WITH_KERNEL \ 588 Y Z() const { return Y((const Algebraic_kernel_d_1*)this); } 589 590 591 CGAL_ALGEBRAIC_KERNEL_1_PRED(Is_square_free_1, 592 is_square_free_1_object); 593 CGAL_ALGEBRAIC_KERNEL_1_PRED(Make_square_free_1, 594 make_square_free_1_object); 595 CGAL_ALGEBRAIC_KERNEL_1_PRED(Square_free_factorize_1, 596 square_free_factorize_1_object); 597 CGAL_ALGEBRAIC_KERNEL_1_PRED(Is_coprime_1, 598 is_coprime_1_object); 599 CGAL_ALGEBRAIC_KERNEL_1_PRED(Make_coprime_1, 600 make_coprime_1_object); 601 CGAL_ALGEBRAIC_KERNEL_1_PRED(Solve_1, 602 solve_1_object); 603 CGAL_ALGEBRAIC_KERNEL_1_PRED(Number_of_solutions_1, 604 number_of_solutions_1_object); 605 CGAL_ALGEBRAIC_KERNEL_1_PRED(Construct_algebraic_real_1, 606 construct_algebraic_real_1_object); 607 CGAL_ALGEBRAIC_KERNEL_1_PRED(Sign_at_1, 608 sign_at_1_object); 609 CGAL_ALGEBRAIC_KERNEL_1_PRED(Is_zero_at_1, 610 is_zero_at_1_object); 611 CGAL_ALGEBRAIC_KERNEL_1_PRED(Compare_1,compare_1_object); 612 CGAL_ALGEBRAIC_KERNEL_1_PRED(Bound_between_1, 613 bound_between_1_object); 614 CGAL_ALGEBRAIC_KERNEL_1_PRED(Approximate_absolute_1, 615 approximate_absolute_1_object); 616 CGAL_ALGEBRAIC_KERNEL_1_PRED(Approximate_relative_1, 617 approximate_relative_1_object); 618 CGAL_ALGEBRAIC_KERNEL_1_PRED(Compute_polynomial_1, 619 compute_polynomial_1_object); 620 CGAL_ALGEBRAIC_KERNEL_1_PRED(Isolate_1, 621 isolate_1_object); 622 623 // Deprecated 624 #if CGAL_AK_ENABLE_DEPRECATED_INTERFACE 625 typedef Bound Boundary; 626 typedef typename Algebraic_real_traits::Refine Refine_1; 627 typedef typename Algebraic_real_traits::Lower_bound Lower_bound_1; 628 typedef typename Algebraic_real_traits::Upper_bound Upper_bound_1; 629 typedef typename Algebraic_real_traits::Lower_bound Lower_boundary_1; 630 typedef typename Algebraic_real_traits::Upper_bound Upper_boundary_1; 631 typedef Bound_between_1 Boundary_between_1; 632 633 CGAL_ALGEBRAIC_KERNEL_1_PRED(Refine_1, refine_1_object); 634 CGAL_ALGEBRAIC_KERNEL_1_PRED(Lower_bound_1, lower_bound_1_object); 635 CGAL_ALGEBRAIC_KERNEL_1_PRED(Upper_bound_1, upper_bound_1_object); 636 CGAL_ALGEBRAIC_KERNEL_1_PRED(Lower_boundary_1, lower_boundary_1_object); 637 CGAL_ALGEBRAIC_KERNEL_1_PRED(Upper_boundary_1, upper_boundary_1_object); 638 CGAL_ALGEBRAIC_KERNEL_1_PRED(Boundary_between_1, boundary_between_1_object); 639 #endif 640 641 #undef CGAL_ALGEBRAIC_KERNEL_1_PRED 642 643 }; 644 } // namespace internal 645 646 647 template< class Coefficient, 648 class Bound = typename CGAL::Get_arithmetic_kernel< Coefficient >::Arithmetic_kernel::Rational, 649 class RepClass = internal::Algebraic_real_rep< Coefficient, Bound >, 650 class Isolator = internal::Descartes< typename CGAL::Polynomial_type_generator<Coefficient,1>::Type, Bound > > 651 class Algebraic_kernel_d_1 652 : public internal::Algebraic_kernel_d_1_base< 653 654 // Template argument #1 (AlgebraicReal1) 655 internal::Algebraic_real_d_1< 656 Coefficient, 657 Bound, 658 ::CGAL::Handle_policy_no_union, 659 RepClass >, 660 661 // Template argument #2 (Isolator_) 662 Isolator > 663 664 {}; 665 666 667 } //namespace CGAL 668 669 #include <CGAL/enable_warnings.h> 670 671 #endif // CGAL_ALGEBRAIC_KERNEL_D_1_H 672