Is there a good way to transfer vectors? Here is an example of what I mean:
vec0 = [0,0,0,0,0,0,0,0,0,0,0]
vec1 = [1,4,2,7,3,2]
vec2 = [0,0,0,0,0,0,0,0,0]
vec2 = [7,2,7,9,9,6,1,0,4]
vec4 = [0,0,0,0,0,0]
mainvec =
[0,0,0,0,0,0,0,0,0,0,0,1,4,2,7,3,2,0,0,0,0,0,0,0,0,0,7,2,7,9,9,6,1,0,4,0,0,0,0,0,0]
Suppose mainvec does not exist (I just show it to you so you can see the general data structure.
Now say I want mainvec (12), which would be 4. Is there a good way to map the invocation of these vectors without just stitching them together in mainvec? I understand that I can make a bunch of if statements that check the mainvec index, and then I can compensate for each call depending on where the call is inside one of the vectors, for example, for example:
mainvec(12) = vec1(1)
which i could do:
mainvec(index)
if (index >=13)
vect1(index-11);
I wonder if there is a concise way to do this without any claims. Any ideas?