Mir vs. Numpy: Reworked!

data pulverizer data.pulverizer at gmail.com
Fri Dec 4 02:35:49 UTC 2020


On Thursday, 3 December 2020 at 21:28:04 UTC, jmh530 wrote:
> The document says:
>     Slice: Python like. Uses D Slices and Strides for grouping 
> (Red-Black).
>     Naive: one for-loop for each dimension. Matrix-Access via 
> multi-dimensional Array.
>     Field: one for-loop. Matrix is flattened. Access via 
> flattened index.
>     NdSlice: D like. Uses just MIR functionalities.

It's quite interesting because it says that it's well worth 
implementing a field index as supposed to naive access - at least 
for this algorithm. It makes sense because in the field case at 
least you know that all the data is on the same array - and 
therefore in close proximity in memory, whereas individual arrays 
in multidimensional array could be far apart in the memory. 
NDSlice is even faster for this case - cool. Am I correct in 
assuming that the data in the NDSlice is also a single array?



More information about the Digitalmars-d-announce mailing list