fix min/max problem

This commit is contained in:
Andreas Fabri 2006-08-03 03:37:56 +00:00
parent 304206a323
commit 83ce38c57f
2 changed files with 17 additions and 8 deletions

View File

@ -47,7 +47,10 @@ struct Random_convex_set_traits_2 {
{ {
FT FT
operator()( const Point_2& p) const operator()( const Point_2& p) const
{ return max( CGAL_NTS abs( p.x()), CGAL_NTS abs( p.y())); } {
BOOST_USING_STD_MAX();
return max BOOST_PREVENT_MACRO_SUBSTITUTION ( CGAL_NTS abs( p.x()), CGAL_NTS abs( p.y()));
}
}; };
struct Sum struct Sum

View File

@ -201,8 +201,11 @@ public:
// distributed on the segment from p to q except q, i.e. `*g' == // distributed on the segment from p to q except q, i.e. `*g' ==
// \lambda p + (1-\lambda)\, q where 0 <= \lambda < 1 . A single // \lambda p + (1-\lambda)\, q where 0 <= \lambda < 1 . A single
// random number is needed from `rnd' for each point. // random number is needed from `rnd' for each point.
: Random_generator_base<P>( max( max( to_double(p.x()), to_double(q.x())), : Random_generator_base<P>( max BOOST_PREVENT_MACRO_SUBSTITUTION
max( to_double(p.y()), ( max BOOST_PREVENT_MACRO_SUBSTITUTION
( to_double(p.x()), to_double(q.x())),
max BOOST_PREVENT_MACRO_SUBSTITUTION
( to_double(p.y()),
to_double(q.y()))), to_double(q.y()))),
rnd) , _p(p), _q(q) { rnd) , _p(p), _q(q) {
generate_point(); generate_point();
@ -244,8 +247,11 @@ public:
Points_on_segment_2() {} Points_on_segment_2() {}
Points_on_segment_2( const P& p, const P& q, Points_on_segment_2( const P& p, const P& q,
std::size_t mx, std::size_t i = 0) std::size_t mx, std::size_t i = 0)
: Generator_base<P>( max( max( to_double(p.x()), to_double(q.x())), : Generator_base<P>( max BOOST_PREVENT_MACRO_SUBSTITUTION
max( to_double(p.y()), to_double(q.y())))), ( max BOOST_PREVENT_MACRO_SUBSTITUTION
( to_double(p.x()), to_double(q.x())),
max BOOST_PREVENT_MACRO_SUBSTITUTION
( to_double(p.y()), to_double(q.y())))),
_p(p), _q(q), d_i(i), d_mx(mx) { _p(p), _q(q), d_i(i), d_mx(mx) {
generate_point(); generate_point();
} }