|
Boost : |
From: Rozental, Gennadiy (Gennadiy_at_[hidden])
Date: 2002-09-03 13:01:31
> > Also, I happen to be abstract enough to not clearly
> distinguish "range"
> > and "interval". There seem to be two discriminators, that might be
> > implemented as traits: (1) discreteness and (2)analytical
> properties.
>
> What will "discreteness" provide? It looks to me like these two traits
> are not orthogonal at all; they are antagonistic. Indeed, if you
> manipulate intervals on a discreet type and are interested in
> iterators and traversal, then the analytical functions will not be of any
> use. And vice versa.
In a sense all types used in numeric computation are "discreet". It's step
that matter. Some will be happy with step equal 1. Some will need 1e-1000.
Underlying type used to represent values in program we already abstracted as
template parameter. So in this sense I do not see why int as internal
parameter is worse then double.
Iterator concept could also be useful for intervals. Let say I want to
compute am integral over some interval. Would not the iterator be of some
help to implement the algorithm so it would use STL algorithms. Since as I
mentioned before all types are in fact discrete with the step equal to
numeric_limits::epsilon(), it could be a natural step for iterator. I also
should be possible define different step.
So IMO I do not see to much differences between Interval and Range to
justify to different classes. Though I my be missing something.
Gennadiy.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk