I’m using the accelerate framework to optimize my DSP code. There are several times when I want to copy the contents of one array (or portion of an array) to another.
I can’t seem to find an appropriate function to do this, so instead I’ve been doing something kind of silly, which is to multiply the array by 1 (or add 0) and get the copy that way.
float one = 1;
float sourceArray = new float[arrayLength];
/////....sourceArray is filled up with data
float destArray = new float[arrayLength];
vDSP_vsmul(sourceArray, 1, &one, destArray, 1, arrayLength);
there has to be a better way to do this!? Thanks!
How about memcpy?