From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 75336BC0A for ; Mon, 1 Jan 2007 15:53:27 +0100 (CET) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l01ErQnq002104 for ; Mon, 1 Jan 2007 15:53:27 +0100 Received: by ug-out-1314.google.com with SMTP id q2so5808401uge for ; Mon, 01 Jan 2007 06:53:26 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:reply-to:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:from; b=PDHOCpSfKr8uS64LySSUwuk0imHIojXWIM9FQjcmVSWOJ5O5wo0094YM9gY06Pn5ZAK2Wu/L9b3y98y1lxhDPFnCpKi6AoGbuU7xoz2743h9dNTwIt/RNpVdiRTwhjSexO02KucQ+pOd5CaNARknSmw9+klxjxMa3yRGfPhFLlc= Received: by 10.67.117.18 with SMTP id u18mr12797358ugm.1167663206607; Mon, 01 Jan 2007 06:53:26 -0800 (PST) Received: from ?192.168.1.10? ( [88.138.226.20]) by mx.google.com with ESMTP id j3sm25013680ugd.2007.01.01.06.53.17; Mon, 01 Jan 2007 06:53:18 -0800 (PST) Message-ID: <4599205A.7050802@laposte.net> Date: Mon, 01 Jan 2007 15:53:14 +0100 Reply-To: matthieu.dubuget@laposte.net User-Agent: Thunderbird 1.5.0.8 (X11/20061115) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] ANNOUNCE : libsndfile-ocaml alpha References: <20061222155407.ebe6c272.mle+ocaml@mega-nerd.com> <45923DC2.9000504@ujf-grenoble.fr> <20061227211046.656615d0.mle+ocaml@mega-nerd.com> <20061231080756.66e89d6c.mle+ocaml@mega-nerd.com> <1167535885.27287.66.camel@rosella.wigram> <20061231152305.694fd3e9.mle+ocaml@mega-nerd.com> <20061231110831.GA21198@furbychan.cocan.org> <20070101095114.911ca90d.mle+ocaml@mega-nerd.com> In-Reply-To: <20070101095114.911ca90d.mle+ocaml@mega-nerd.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit From: Matthieu Dubuget X-j-chkmail-Score: MSGID : 45992066.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45992066.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; matthieu:01 dubuget:01 matthieu:01 dubuget:01 ocaml:01 bigarray:01 ocaml:01 bigarray:01 arrays:01 read-only:01 bigarrays:01 1.0:98 wrote:01 wrote:01 caml-list:01 Erik de Castro Lopo a écrit : > Richard Jones wrote: > > >> On Sun, Dec 31, 2006 at 03:23:05PM +1100, Erik de Castro Lopo wrote: >> >>> Since it is already possible to read Ocaml floats (which are normalised >>> to the range [-1.0, 1.0]) why would anyone want to ready any other data >>> type? >>> >> Two reasons I can think of[*]: (a) to avoid copying, (b) to make an >> exact reproduction (without the conversion to and from float). >> > > Well the amount of copying is the same whether I use bigarray or a > standard Ocaml float array so (a) is irrelevant. > Is it really the case? I thought that it was possible to create a bigarray wrapping a C array without copying datas. I do not know how to achieve this for float arrays? This could be interesting for read-only access or in-place modifications? Another very interesting feature of bigarrays is the memory mapping of a file as a big array, very useful to work with BIG files. Matt