# Boost :

Subject: Re: [boost] [Polygon] review - interval
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-08-29 20:25:07

AMDG

interval_concept.hpp:75
It would make more sense to me to make it a precondition
of construct that low_value <= high_value.

I would like to see a specialization of interval_traits
for boost::interval.

interval_concept.hpp:190-191
I don't think this is correct. Consider calling
flip with an interval [1,2] and an axis 1. I would
expect the result to be [0,1]. flip as written will
give [1-2,1-1]=[-1,0]. The correct formula is
newLow = 2*axis - high(interval);
newHigh = 2*axis - low(interval);

interval_concept.hpp:205-206,219-220,231-232,246-247, maybe more

interval_concept.hpp:247
Is it necessary to set high in terms of low instead of
adding displacement to high? What's the difference
between convolve and move?

interval_concept.hpp:366
I'm inclined to doubt whether this is any faster than
if(position < low(interval)) return low(interval) - position;
else if(position <= high(interval)) return 0;
else return(position - high(interval));
which is easier to understand.

interval_concept.hpp:396
is the use of the bitwise & operator instead of
the logical operator intentional?

I didn't see get_half and join_with in the documentation.

In Christ,
Steven Watanabe