|
Boost : |
From: Martin Schürch (martin.schuerch_at_[hidden])
Date: 2000-03-06 11:11:09
Hi
For me it would be a great win to have a "standard" class like interval.
I use similar classes a lot.
I use them not for calculation errors, but e.g. for
1) general real interval e.g. for selecting a sub curve of a parametic
curve -> [a,b] is used as encapsulated lower and upper
2) solving of Diff. Equations with limited lower and upper derivations
3) ...
What I found in both areas often very useful are comparison operators
only with a real. e.g. [a,b] < 3.14.
In area 2) many problems arrived by comparison of intervals because
different kinds of comparisons
are used in different situations.
Concept
1: [1,100] < [20,60] <-> comparison is "set" - like
2: [0,1] <[3,7] <-> Like your interval "<"
The conclusion of the mess above:
The interval concept is very helpful and for sure one important using
area, are calculation errors you wrote it for.
However there are other situations where the [a,b] interval concept of
real values are also very useful. And a class name like
interval does for me exactly imply that. To make the interval class more
general useful would be JUST GREAT.
Perhaps there are some ways (e.g. different namespaces, function names
or traits) where the very general interval class can be
separated of the
more specific functionality. Especially comparison is one of the often
disturbing points. (e.g. in your code : !(I1 < I2) && !(I2
< I1) does not imply (I1== I2) can lead to problems)
Personally I choose different function names to compare in different
ways (like set_less_eq, ...) perhaps not very good names.
Would it be in your interest to transform your interval concept in a
(multiple) general ones?
Martin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk