Browse thread
Bigarray.c_layout
-
Florent Monnier
-
Florent Monnier
-
Damien Doligez
-
Florent Monnier
- Remi Vanicat
-
Florent Monnier
-
Damien Doligez
-
Florent Monnier
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2006-04-20 (21:14) |
From: | Remi Vanicat <remi.vanicat@g...> |
Subject: | Re: [Caml-list] Re: Bigarray.c_layout |
2006/4/20, Florent Monnier <fmonnier@linux-nantes.fr.eu.org>: > > > 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.