Hi,
I need to do windowing on big arrays (4-D with millions of elements) which is very expensive.
Just to illustrate what I mean by windowing.
From what I've read here and on the internet, LabVIEW stores arrays as a structure with the dimension sizes and a pointer to the first element.
In the example 2-D Array Handle in the "External Code (DLL) Execution" vi, we can find a definition:
typedef struct {
int32 dimSizes[2];
double elt[1];
} TD1;
When we do simple operations on 1D or 2D arrays such as reverse or transpose, LabVIEW doesn't copy any data, instead it creates a structure with the information needed to read or reconstruct the array.
Rolf Kalbermatter said that this information is stored in the wire Type description.
We can read this information with the vi ArrayMemInfo.
It gives the pointer to the first element, the size and stride of each dimension and the element size. The stride is the number of bytes to skip to get the next element in a given dimension.
Numpy has a similar approach and this is what it gives for sizes and strides.
We can modify it with the function "numpy.lib.stride_tricks.as_strided", and do really fast windowing thanks to it.
The information given by ArrayMemInfo seems incorrect but assuming it's just a reading error, modifying this information would allow me to do efficient windowing and much more, like transposing or permuting N-D arrays.
I have no idea if this is possible and even if I could change this information, I don't know if LabVIEW would have no problem interpreting it.
What do you think ?