..and this is what I would like to have...
So instead of:
Creating a new buffer allocation
The subset is copied to this new buffer allocation
Copy the new buffer to the destination array
We can simply:
Move the data from source to destination.
I fully agree, I'd also like this function. I just programmed a VI where this would have been useful.
I think it would have 2 array inputs, plus an index and a length for the portion of the source array to be copied and an index for the destination array.
It would basically be the combination of array subset and replace array subset, but without doing the copy first.
Very good idea... I hope to see this in a future version of LabVIEW!
This is how I envisioned the same code using the inplace operators.
Buffer "A" and "B" are created by the init arrays. Since A is not modified, buffer "A" is used as the source of the data.
Buffer "B" is really handled by the compiler (in the source code, like "A") so to make sure it is the same from run to run it is copied to buffer "C" where all of the work is done.
The lack of buffer allocation dots show that all of the rest of the work is done "in-place".
I hope that is getting closer to your concern,
Is it something like this function. I think it appeared in Labview 8.6
@Ben: This does it in place, that's correct. But instead of allocating an intermediate array it requires a for loop. This also slows things down if you have to copy big portions of the array.
Also, I think if you don't need the old value, there's no need for the in-place element structure because replace array subset should also be an in place operation.
I didn't do benchmarks, I think whether this method or the array subset / replace array subset combination is faster depends on the size of the portion to copy. One solution allocates memory, the other requires more CPU.