From: Eric Woodruff (Eric.Woodruff_at_[hidden])
Date: 2002-09-26 16:06:07
Is boost::interval<> in the current release? If so, where can I find it?
----- Original Message -----
From: Herve Bronnimann
Sent: Thursday, 2002:September:26 14:49
Subject: Re: Re: Re: range_intersection
On Thu, Sep 26, 2002 at 10:38:45AM -0400, Eric Woodruff wrote:
> There is a lot of support for iterators, but I needed something numerical,
> not iterator-based.
And Doug gregor wrote:
> The recently-accepted Interval arithmetic library does range
> intersection, but not for std::pair.
If it's numerical, then I suspect you don't really intend to represent
your range with std::pair, consider using boost::interval<T> instead.
Unlike pair, the semantic of an interval is what you mean here.
Intersections will work fine using intersection(i1, i2). If your intent
is to model open intervals, you'll have to ask Guillaume Melquiond what
the comparison scheme is to handle those, but I recall from the review
that it can be done.
If you also need to represent union of intervals, then, you'll have to
this one on your own, but the building block interval<T> is already done
so all you need to worry about is a sorted container of them
(presumably, your intervals will be disjoint and then totally ordered;
you'll have to worry about merging non-disjoint intervals in your
container... for this, you'd use the function hull(i1,i2).)
-- Herve' _______________________________________________ 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