From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q1BAt6PV030591 for ; Sat, 11 Feb 2012 11:55:07 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEBAF1INk/RVdQ2kGdsb2JhbABDnniITQGIIwgiAQEBAQkJDQcUBCOBcgEBAQQBAg8CLAEbEgQHAQMIBAYFBAcGAwECDiEiAQUMAQUBCgoIBhMIChCHY51mCotxgnCEPT+BCwIFC4s0MjEkAQGDOCUghCQEglyQLoIojiU9glSBLw X-IronPort-AV: E=Sophos;i="4.73,401,1325458800"; d="scan'208";a="143824498" Received: from mail-vw0-f54.google.com ([209.85.212.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 11 Feb 2012 11:55:01 +0100 Received: by vbbfa15 with SMTP id fa15so4344230vbb.27 for ; Sat, 11 Feb 2012 02:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=A1dHr/4A2rebO/7uqTpE5uZ+Go6Hx7kD+4uOdQ3reuM=; b=Vonb2BfrmVQmtcUZBhQMvmljxYGkSzualTRzybSP72DY7Klo2peZVDXPwWG8Vgurp+ 6Jou66xEvc+uKtMg36M0hD96m37RP8CEVjfdBmodP5mlEacSm8rVm1AMQlL1GWXxMcxG MgLpDIlqi1SGaU1fko3B8VHrdjsUC+Gug6cVg= Received: by 10.52.178.35 with SMTP id cv3mr4504091vdc.44.1328957699286; Sat, 11 Feb 2012 02:54:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.90.140 with HTTP; Sat, 11 Feb 2012 02:54:39 -0800 (PST) In-Reply-To: <4F346DB9.2070303@riken.jp> References: <4F346DB9.2070303@riken.jp> From: Philippe Veber Date: Sat, 11 Feb 2012 11:54:39 +0100 Message-ID: To: Francois Berenger Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=20cf3071ccba96660a04b8ae1385 X-Validation-by: philippe.veber@gmail.com Subject: Re: [Caml-list] Fwd: interval trees --20cf3071ccba96660a04b8ae1385 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Fran=E7ois, The Biocaml_intervalTree module is merely a specialization of Set in the standard library. It should be fairly easy to functorize it over a type with a total order relation. I think you might even sed -e 's/int/float/g' the current implementation (with a couple of additional and minor modifications). ph. 2012/2/10 Francois Berenger > -------- Original Message -------- > Subject: interval trees > Date: Thu, 09 Feb 2012 17:30:21 +0900 > From: Francois Berenger > To: batteries-discuss@lists.forge.**ocamlcore.org > CC: biocaml@googlegroups.com > > Hello, > > I need to use an interval tree. > > Biocaml has one, batteries have imap/iset, nice! > > However, I have intervals of reals, not integers. :( > > I want to build the tree (once), then query it with a real number > (many times) like in: which intervals contain the query real number? > > Should I convert my floats to ints (by sorting them then ranking) before > inserting them into some existing interval tree for integers? > I am not so concerned about the pre-processing time. > > Should I write from scratch? > > Thanks for any suggestion, > F. > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/**wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/**ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-**bugs > > --20cf3071ccba96660a04b8ae1385 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Fran=E7ois,

The Biocaml_intervalTree module is merely a specializ= ation of Set in the standard library. It should be fairly easy to functoriz= e it over a type with a total order relation. I think you might even sed -e= 's/int/float/g' the current implementation (with a couple of addit= ional and minor modifications).

ph.

2012/2/10 Francois Berenger <berenger@riken.jp= >
-------- Original Message --------<= br> Subject: interval trees
Date: Thu, 09 Feb 2012 17:30:21 +0900
From: Francois Berenger
To: batteries-discuss@lists.forge.ocamlcore.org
CC: biocaml@g= ooglegroups.com

Hello,

I need to use an interval tree.

Biocaml has one, batteries have imap/iset, nice!

However, I have intervals of reals, not integers. :(

I want to build the tree (once), then query it with a real number
(many times) like in: which intervals contain the query real number?

Should I convert my floats to ints (by sorting them then ranking) before
inserting them into some existing interval tree for integers?
I am not so concerned about the pre-processing time.

Should I write from scratch?

Thanks for any suggestion,
F.

--
Caml-list mailing list. =A0Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners<= /a>
Bug reports:
http://caml.inria.fr/bin/caml-bugs


--20cf3071ccba96660a04b8ae1385--