33#ifdef OGDF_INCLUDE_CGAL
35# include <CGAL/CORE_Expr.h>
36# include <CGAL/Gmpfr.h>
37# include <CGAL/Gmpq.h>
38# include <CGAL/gmpxx.h>
41# ifndef OGDF_GEOMETRIC_MPFR_NUMBER_OF_DIGITS
43# define OGDF_GEOMETRIC_MPFR_NUMBER_OF_DIGITS 77
47# ifndef OGDF_GEOMETRIC_MPFR_EQUALITY_THRESHOLD
48# define OGDF_GEOMETRIC_MPFR_EQUALITY_THRESHOLD 1e-20
58inline double cast(
const T& a) {
60 return CGAL::to_double(a);
64inline double cast(
const double& a) {
70 case std::round_indeterminate:
73 case std::round_toward_zero:
75 case std::round_to_nearest:
77 case std::round_toward_infinity:
79 case std::round_toward_neg_infinity:
101 return (T)
sqrt(CGAL::to_double(v));
110inline const CGAL::Gmpfr
approx_sqrt(
const CGAL::Gmpfr& v) {
116inline const CORE::Expr
approx_sqrt(
const CORE::Expr& v) {
return CGAL::sqrt(v); }
119inline const T
acos(
const T& v) {
120 return (T)std::acos(CGAL::to_double(v));
124inline const CGAL::Gmpfr
acos(
const CGAL::Gmpfr& v) {
131inline const CORE::Expr
acos(
const CORE::Expr& v) {
132 return std::acos(CGAL::to_double(v));
139inline bool isEqual(
const t& a,
const t& b) {
144inline bool isEqual(
const double& a,
const double& b) {
149inline bool isEqual(
const CGAL::Gmpfr& a,
const CGAL::Gmpfr& b) {
155 return (a < b) ||
isEqual(a, b);
159inline bool isLess(
const T& a,
const T& b) {
160 return (a < b) && !
isEqual(a, b);
165 return (a > b) ||
isEqual(a, b);
169inline bool isGreater(
const T& a,
const T& b) {
170 return (a > b) && !
isEqual(a, b);
174inline bool isZero(
const T& a) {
181inline std::ostream&
operator<<(std::ostream&
os,
const CGAL::Gmpq& p) {
183 os << CGAL::to_double(p);
187inline std::ostream&
operator<<(std::ostream&
os,
const CORE::Expr& p) {
189 os << CGAL::to_double(p);
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.