[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Quick test for interval containing interval
From: |
David Kastrup |
Subject: |
Re: Quick test for interval containing interval |
Date: |
Sat, 10 Dec 2011 21:24:28 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
Keith OHara <address@hidden> writes:
> mike <at> apollinemike.com <mike <at> apollinemike.com> writes:
>
>> Before I reinvent the wheel, does the code base have something like
>> Interval::contains that accepts an interval as an argument instead of a
>> point?
>>
>
> Well, there is Interval::superset() if you like
> object-oriented-obfuscation,
You could check whether the interval intersection is identical with the
interval supposed to be inner. The possibilities for clever
incomprehensible code are endless.
> but it would be much more clear to simply
> (a.at (LEFT) <= b.at (LEFT) && a.at (RIGHT) >= b.at (RIGHT))
Yes.
--
David Kastrup