From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 6E46EBB84 for ; Thu, 20 Apr 2006 23:14:50 +0200 (CEST) Received: from pproxy.gmail.com (pproxy.gmail.com [64.233.166.182]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k3KLEnSx005300 for ; Thu, 20 Apr 2006 23:14:50 +0200 Received: by pproxy.gmail.com with SMTP id b36so285173pyb for ; Thu, 20 Apr 2006 14:14:49 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VhXSmGz7zPpOz5Q/p9InRAwGlrCrq0VaB6TOBwWTM5ol1SnIE/GpZ+yDrV4bl1q50gf18EzSGGA3hsX+yubsvG4yKLMy/RVega8vnNgJRB2IMpVosDL9Uy3v+dzwopD0CVjByZjHdP2bx0m9I+6NwAyGlFuGB8QADMSEk/lUgBc= Received: by 10.35.22.17 with SMTP id z17mr529414pyi; Thu, 20 Apr 2006 14:14:49 -0700 (PDT) Received: by 10.35.38.8 with HTTP; Thu, 20 Apr 2006 14:14:49 -0700 (PDT) Message-ID: <6b8a91420604201414q4180a0f3pfc43205fe73760a8@mail.gmail.com> Date: Thu, 20 Apr 2006 23:14:49 +0200 From: "Remi Vanicat" To: "Florent Monnier" Subject: Re: [Caml-list] Re: Bigarray.c_layout Cc: caml-list@yquem.inria.fr In-Reply-To: <200604201603.39533.fmonnier@linux-nantes.fr.eu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200604141604.29147.fmonnier@linux-nantes.fr.eu.org> <200604142007.54690.fmonnier@linux-nantes.fr.eu.org> <9B63C7CE-6D35-4E5E-B838-94AF9753C0F7@inria.fr> <200604201603.39533.fmonnier@linux-nantes.fr.eu.org> X-Miltered: at nez-perce with ID 4447F9C9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bigarray:01 2006:98 20,:98 caml-list:01 remi:01 remi:01 vanicat:01 vanicat:01 reorder:02 fortran:02 fortran:02 library:03 translate:04 layout:05 layout:05 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.9 required=5.0 tests=RCVD_BY_IP, RCVD_IN_BL_SPAMCOP_NET autolearn=disabled version=3.0.3 2006/4/20, Florent Monnier : > > > In the library I use the elements are ordered like this in the 1dim > > > C array: > > > 01 02 03 04 05 06 > > > 07 08 09 10 11 12 > > > 13 14 15 16 17 18 > > > 19 20 21 22 23 24 > > > > > > but with the c_layout of big array the datas are ordered like this : > > > 01 05 09 13 17 21 > > > 02 06 10 14 18 22 > > > 03 07 11 15 19 23 > > > 04 08 12 16 20 24 > > > > Looks like you need to use fortran_layout, and shift the indices by 1 > > to translate between 0-based and 1-based. > > But it would be like the "reorder" function I use, isn't it ? Nope, a biggarray with a fortran_layout is a biggaray with ordering as in your first example, when c_layout is with the ordering as in you second example. The other difference is that with fortran_layout, array are from 1 to n, not from 0 to n-1.