Boost logo

Boost :

From: David Bergman (davidb_at_[hidden])
Date: 2002-09-05 17:01:14


Ok,

I just thought that the midpoint relation would be a good subrelation
for a total one, which a lot of users would need from time to time (in
order to use the STL algorithms and structures you mentioned, among
other reasons). But, ok, having the STL-induced equivalence (by
incomparability) relation is probably fine.

/David

-----Original Message-----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of George A.
Heintzelman
Sent: Thursday, September 05, 2002 5:53 PM
To: boost_at_[hidden]
Subject: Re: [boost] Interval Library and comparison operators

> How would you define the mid-point relation for elements having
> identical midpoints, but varying extension, such as [1, 5] and [2, 4]?

> Since we want a total ordering, and not be forced (through the
> "equivalent if incomparable" hypothesis of the STL library) to have
> them be equal...

The midpoint relation isn't a total ordering. It *is*, however, a
strict weak ordering, which satisfies the requirements for defined
behavior in std::sort. [1,5] and [2,4] are part of the same equivalence
class for this ordering.

If you wanted to extend this to a total ordering, you could, but I
don't think it's necessary, and would add overhead to operator<.
Furthermore, I don't think there is an intuitive definition to choose
in this case, so it will be one of those things that people are
continually looking up.

George Heintzelman
georgeh_at_[hidden]

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk