Flat multi-dim arrays.

Dave Dave_member at pathlink.com
Thu Aug 10 15:12:29 PDT 2006


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
> 
> 



More information about the Digitalmars-d mailing list