123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #include "assign_scalar.h"
- IGL_INLINE void igl::copyleft::cgal::assign_scalar(
- const CGAL::Epeck::FT & cgal,
- CGAL::Epeck::FT & d)
- {
- d = cgal;
- }
- IGL_INLINE void igl::copyleft::cgal::assign_scalar(
- const CGAL::Epeck::FT & _cgal,
- double & d)
- {
-
- const CGAL::Epeck::FT cgal = _cgal.exact();
- const auto interval = CGAL::to_interval(cgal);
- d = interval.first;
- do {
- const double next = nextafter(d, interval.second);
- if (CGAL::abs(cgal-d) < CGAL::abs(cgal-next)) break;
- d = next;
- } while (d < interval.second);
- }
- IGL_INLINE void igl::copyleft::cgal::assign_scalar(
- const CGAL::Epeck::FT & _cgal,
- float& d)
- {
-
- const CGAL::Epeck::FT cgal = _cgal.exact();
- const auto interval = CGAL::to_interval(cgal);
- d = interval.first;
- do {
- const float next = nextafter(d, float(interval.second));
- if (CGAL::abs(cgal-d) < CGAL::abs(cgal-next)) break;
- d = next;
- } while (d < float(interval.second));
- }
- IGL_INLINE void igl::copyleft::cgal::assign_scalar(
- const double & c,
- double & d)
- {
- d = c;
- }
- IGL_INLINE void igl::copyleft::cgal::assign_scalar(
- const float& c,
- float& d)
- {
- d = c;
- }
- IGL_INLINE void igl::copyleft::cgal::assign_scalar(
- const float& c,
- double& d)
- {
- d = c;
- }
|