12345
foo is an array that you want to copy data from bar is an empty array of the same length as foo for every element in foo bar[index] = foo[index]
for interesting elements in foo bar[ fbmap(index) ] = foo[ index ]
for every element in bar bar[ index ] = foo[ bfmap(index) ]