Flat multi-dim arrays.

Reiner Pope reiner.pope at REMOVE.THIS.gmail.com
Thu Aug 10 23:24:55 PDT 2006


Dave wrote:
> Oskar Linde wrote:
>> Mikola Lysenko wrote:
>>
>>> 5.  How do slices work?
>>>
>>> You can't just slice a random chunk from the middle of an array in place
>>> like a regular array, since the layout will be incorrect.  
>>
>> Yes you can. This is exactly what strides are for.
>> For each dimension, you keep a stride as well as a length. Walking up the
>> dimension moves a stride of units of memory. This even allows things like
>> transposing a large matrix without moving a single byte.
> 
> Can you pass along some syntax / usage for that?
> 
> Thanks.
> 
>> /Oskar
>>
>>
I think he was talking about Norbert Nemec's proposal, which was 
referred to earlier:

http://homepages.uni-regensburg.de/~nen10015/documents/D-multidimarray.html

Cheers,

Reiner



More information about the Digitalmars-d mailing list