If you don't need to do anything order-dependent until after the pop-appending is done, you could probably use cyclic access when calculating the matrices in your algorithm, and then re-order based on the number of permutations you've performed. If your algorithm generates N+d columns, and you want to discard the first d by overwriting them cyclically, this means that your matrix will end up with something like (pseudo-code:) M[[d+1:end 1:d]] (you can't currently index this way in Julia, but if you could...)
When you are done generating your matrix, you just do a full column shift moving the d first columns to the end, and the N-d last column to the start. The resulting matrix will have the same shape and column order as if you would have appended a vector on the right in each step of the algorithm, and then sliced off the first d columns at the end. I'm not sure exactly how it is best done in practice, but I imagine there must be a memory-efficient way to shift the columns either as a standard library function already in Julia, or as something quite easily implemented. // Tomas On Monday, May 12, 2014 4:27:43 AM UTC+2, Carlos Baptista wrote: > > I think the order is important, although I am not sure. I can test for > that. However what is very important is that V and W have the same order. >
