Subject: Re: [boost] [Polygon] review - interval
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-08-29 20:25:07
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
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
Please use static_cast, instead of a C-style cast.
Is it necessary to set high in terms of low instead of
adding displacement to high? What's the difference
between convolve and move?
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.
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk