Qualified calls to 'abs' and 'sign' by CGAL_NTS

This commit is contained in:
Geert-Jan Giezeman 2000-06-19 07:36:30 +00:00
parent 65851df836
commit 3d40e07763
3 changed files with 16 additions and 16 deletions

View File

@ -1313,7 +1313,7 @@ Point_2<R> const &end2 = _seg2->end();
Vector_2<R> diff1 = end1-start1;
Point_2<R> const *minpt;
Point_2<R> const *maxpt;
if (abs(diff1.x()) > abs(diff1.y())) {
if (CGAL_NTS abs(diff1.x()) > CGAL_NTS abs(diff1.y())) {
@<Segment_2_Segment_2_pair collinear case 2@>@(x@)
} else {
@<Segment_2_Segment_2_pair collinear case 2@>@(y@)
@ -1767,7 +1767,7 @@ const Point_2<R> &end1 = _seg->end();
const Point_2<R> &start2 = _ray->start();
const Point_2<R> *minpt, *maxpt;
Vector_2<R> diff1 = end1-start1;
if (abs(diff1.x()) > abs(diff1.y())) {
if (CGAL_NTS abs(diff1.x()) > CGAL_NTS abs(diff1.y())) {
@<Ray_2_Segment_2_pair collinear case 2@>@(x@)
} else {
@<Ray_2_Segment_2_pair collinear case 2@>@(y@)
@ -2031,7 +2031,7 @@ the fastest.
typedef typename R::RT RT;
const Vector_2<R> &dir1 = _ray1->direction().to_vector();
const Vector_2<R> &dir2 = _ray2->direction().to_vector();
if (abs(dir1.x()) > abs(dir1.y())) {
if (CGAL_NTS abs(dir1.x()) > CGAL_NTS abs(dir1.y())) {
@<Ray_2_Ray_2_pair collinear case 2@>@(x@)
} else {
@<Ray_2_Ray_2_pair collinear case 2@>@(y@)

View File

@ -1939,7 +1939,7 @@ Segment_2_Iso_rectangle_2_pair(
_ref_point = seg->source();
_dir = seg->direction().to_vector();
_min = (typename R::FT)(0);
int main_dir = (abs(_dir.x()) > abs(_dir.y()) ) ? 0 : 1;
int main_dir = (CGAL_NTS abs(_dir.x()) > CGAL_NTS abs(_dir.y()) ) ? 0 : 1;
_max = (seg->target().cartesian(main_dir)-_ref_point.cartesian(main_dir)) /
_dir.cartesian(main_dir);
}

View File

@ -93,9 +93,9 @@ Straight_2_(Line_2<R> const &line)
{
support_ = line;
Vector_2<R> const &dir = support_.direction().to_vector();
main_dir_ = (abs(dir.x()) > abs(dir.y()) ) ? 0 : 1;
main_dir_ = (CGAL_NTS abs(dir.x()) > CGAL_NTS abs(dir.y()) ) ? 0 : 1;
dir_sign_ =
CGAL::sign(support_.direction().to_vector().cartesian(main_dir_));
CGAL_NTS sign(support_.direction().to_vector().cartesian(main_dir_));
bound_state_ = BOTH_UNBOUNDED;
}
@ -117,10 +117,10 @@ Straight_2_(Ray_2<R> const &ray)
{
support_ = ray.supporting_line();
Vector_2<R> const &dir = ray.direction().to_vector();
// main_dir_ = (abs(dir.hx()) > abs(dir.hy()) ) ? 0 : 1;
main_dir_ = (abs(dir.x()) > abs(dir.y()) ) ? 0 : 1;
// main_dir_ = (CGAL_NTS abs(dir.hx()) > CGAL_NTS abs(dir.hy()) ) ? 0 : 1;
main_dir_ = (CGAL_NTS abs(dir.x()) > CGAL_NTS abs(dir.y()) ) ? 0 : 1;
dir_sign_ =
CGAL::sign(support_.direction().to_vector().cartesian(main_dir_));
CGAL_NTS sign(support_.direction().to_vector().cartesian(main_dir_));
bound_state_ = MAX_UNBOUNDED;
min_ = ray.start();
}
@ -134,10 +134,10 @@ Straight_2_(Ray_2<R> const &ray_,bool cooriented)
/* the supporting line is cooriented with the input ray iff
cooriented is true */
Vector_2<R> const &dir = ray.direction().to_vector();
// main_dir_ = (abs(dir.hx()) > abs(dir.hy()) ) ? 0 : 1;
main_dir_ = (abs(dir.x()) > abs(dir.y()) ) ? 0 : 1;
// main_dir_ = (CGAL_NTS abs(dir.hx()) > CGAL_NTS abs(dir.hy()) ) ? 0 : 1;
main_dir_ = (CGAL_NTS abs(dir.x()) > CGAL_NTS abs(dir.y()) ) ? 0 : 1;
dir_sign_ =
CGAL::sign(support_.direction().to_vector().cartesian(main_dir_));
CGAL_NTS sign(support_.direction().to_vector().cartesian(main_dir_));
if (cooriented)
{
bound_state_ = MAX_UNBOUNDED;
@ -156,9 +156,9 @@ Straight_2_(Segment_2<R> const &seg)
{
support_ = seg.supporting_line();
Vector_2<R> const &dir = support_.direction().to_vector();
main_dir_ = (abs(dir.x()) > abs(dir.y()) ) ? 0 : 1;
main_dir_ = (CGAL_NTS abs(dir.x()) > CGAL_NTS abs(dir.y()) ) ? 0 : 1;
dir_sign_ =
CGAL::sign(support_.direction().to_vector().cartesian(main_dir_));
CGAL_NTS sign(support_.direction().to_vector().cartesian(main_dir_));
bound_state_ = NO_UNBOUNDED;
min_ = seg.start();
max_ = seg.end();
@ -231,7 +231,7 @@ int
sign_of_cross(Direction_2<R> const &dir1,
Direction_2<R> const &dir2)
{
return CGAL::sign(cross(dir1.to_vector(), dir2.to_vector()));
return CGAL_NTS sign(cross(dir1.to_vector(), dir2.to_vector()));
}
#endif
@ -333,7 +333,7 @@ collinear_order(Point_2<R> const &pt1, Point_2<R> const & pt2) const
// Other results are -1 (other side) and 0 (coincidence).
{
int diffsign;
diffsign = CGAL::sign(pt2.cartesian(main_dir_)-pt1.cartesian(main_dir_));
diffsign = CGAL_NTS sign(pt2.cartesian(main_dir_)-pt1.cartesian(main_dir_));
if (diffsign == 0)
return 0;
return (diffsign == dir_sign_) ? 1 : -1;