Per Freem wrote:
i forgot to add, my naive_find is:
def naive_find(intervals, start, stop):
results = []
for interval in intervals:
if interval.start >= start and interval.stop <= stop:
results.append(interval)
return results
I don't know if using a list-comprehension here is a
En Tue, 13 Jan 2009 02:55:36 -0200, Per Freem
escribió:
On Jan 12, 10:58 pm, Steven D'Aprano
wrote:
On Mon, 12 Jan 2009 14:49:43 -0800, Per Freem wrote:
> thanks for your replies -- a few clarifications and questions. the
> is_within operation is containment, i.e. (a,b) is within (c,d) iff
On Jan 12, 9:34 pm, Per Freem wrote:
> hi brent, thanks very much for your informative reply -- didn't
> realize this about the size of the interval.
>
> thanks for the bx-python link. could you (or someone else) explain
> why the size of the interval makes such a big difference? i don't
> unders
On Mon, 12 Jan 2009 20:55:36 -0800, Per Freem wrote:
> on one run, i get:
> interval tree: 8584.682
> brute force: 8201.644
Here are three runs on my computer:
interval tree: 10132.682
brute force: 12054.988
interval tree: 10355.058
brute force: 12119.227
interval tree: 9975.414
brute force:
hi brent, thanks very much for your informative reply -- didn't
realize this about the size of the interval.
thanks for the bx-python link. could you (or someone else) explain
why the size of the interval makes such a big difference? i don't
understand why it affects efficiency so much...
thanks
On Jan 12, 8:55 pm, Per Freem wrote:
> On Jan 12, 10:58 pm, Steven D'Aprano
>
>
>
> wrote:
> > On Mon, 12 Jan 2009 14:49:43 -0800, Per Freem wrote:
> > > thanks for your replies -- a few clarifications and questions. the
> > > is_within operation is containment, i.e. (a,b) is within (c,d) iff a
>
i forgot to add, my naive_find is:
def naive_find(intervals, start, stop):
results = []
for interval in intervals:
if interval.start >= start and interval.stop <= stop:
results.append(interval)
return results
On Jan 12, 11:55 pm, Per Freem wrote:
> On Jan 12, 10:58 pm, Steven D'A
On Jan 12, 10:58 pm, Steven D'Aprano
wrote:
> On Mon, 12 Jan 2009 14:49:43 -0800, Per Freem wrote:
> > thanks for your replies -- a few clarifications and questions. the
> > is_within operation is containment, i.e. (a,b) is within (c,d) iff a
> >>= c and b <= d. Note that I am not looking for inte
On Mon, 12 Jan 2009 14:49:43 -0800, Per Freem wrote:
> thanks for your replies -- a few clarifications and questions. the
> is_within operation is containment, i.e. (a,b) is within (c,d) iff a
>>= c and b <= d. Note that I am not looking for intervals that
> overlap... this is why interval trees s
thanks for your replies -- a few clarifications and questions. the
is_within operation is containment, i.e. (a,b) is within (c,d) iff a
>= c and b <= d. Note that I am not looking for intervals that
overlap... this is why interval trees seem to me to not be relevant,
as the overlapping interval pro
On Mon, 12 Jan 2009 11:36:47 -0800, Per Freem wrote:
> hello,
>
> suppose I have two lists of intervals, one significantly larger than the
> other.
[...]
> What is an efficient way to this? One simple way is:
http://en.wikipedia.org/wiki/Interval_tree
> for a_range in listA:
> for b_range i
[Apologies for piggybacking, but I think GMane had a hiccup today and missed the
original post]
[Somebody wrote]:
suppose I have two lists of intervals, one significantly larger than
the other.
For example listA = [(10, 30), (5, 25), (100, 200), ...] might contain
thousands
of elements while li
Are these ranges constrained in any way?
Does preprocessing count in the efficiency cost?
Is the long list or the short list fixed while the other varies?
With no constraints the problem is harder.
> But perhaps there's a way to index this that makes things more
> efficient? I.e. a smart way of
suppose I have two lists of intervals, one significantly larger than
the other.
For example listA = [(10, 30), (5, 25), (100, 200), ...] might contain
thousands
of elements while listB (of the same form) might contain hundreds of
thousands
or millions of elements.
I want to count how many interval
hello,
suppose I have two lists of intervals, one significantly larger than
the other.
For example listA = [(10, 30), (5, 25), (100, 200), ...] might contain
thousands
of elements while listB (of the same form) might contain hundreds of
thousands
or millions of elements.
I want to count how many i
15 matches
Mail list logo