1
// Copyright (c) 2006-2008 Inria Lorraine (France). All rights reserved.
3
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
4
// modify it under the terms of the GNU Lesser General Public License as
5
// published by the Free Software Foundation; either version 3 of the License,
6
// or (at your option) any later version.
8
// Licensees holding a valid commercial license may use this file in
9
// accordance with the commercial license agreement provided with the software.
11
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17
// Author(s) : Michael Hemmer <hemmer@mpi-inf.mpg.de>
19
// ============================================================================
25
class Real_embeddable_traits< Algebraic_1 >
26
: public INTERN_RET::Real_embeddable_traits_base< Algebraic_1 , CGAL::Tag_true > {
29
typedef INTERN_RET::Real_embeddable_traits_base< Algebraic_1 , CGAL::Tag_true > Base;
31
typedef CGAL::Tag_true Is_real_embeddable;
33
typedef CGAL::Sign Sign;
34
typedef CGAL::Comparison_result Comparison_result;
37
typedef Algebraic_1 Type;
38
typedef Base::Compare Compare; // todo: get a more efficient impl
41
: public std::unary_function< Type, CGAL::Sign > {
43
CGAL::Sign operator()( const Type& a ) const {
44
return Compare()(a, Type(0));
49
: public std::unary_function< Type, double > {
51
double operator()(const Type& a) const {
57
: public std::unary_function< Type, std::pair<double, double> > {
59
std::pair<double, double> operator()(const Type& a) const {
60
return a.to_interval();
65
: public std::unary_function< Type, Boolean> {
67
bool operator()(const Type& a) const {
68
return Sgn()(a) == CGAL::ZERO;
73
:public std::unary_function< Type, Boolean> {
75
bool operator()(const Type& ) const {
81
:public std::unary_function< Type, Type> {
83
Type operator()(const Type& a) const {
84
return Sgn()(a)==CGAL::NEGATIVE?-a:a;