Oakromulo Posted January 8, 2013 Report Share Posted January 8, 2013 Once LV lacks a primitive for this operation, I've written a quick & dirty VI to do random line permutations. I've tried to generate a random 1D array of I32 indexes, copy the 2D array and then do the line permutations one by one. Unfortunately, my code to generate the random I32 Array inside the VI seems to have an average O(n²) complexity. Do you know if there is a simple way to do O(n) or maybe O(n log(n) ) line permutations instead? Just out of curiosity, the randperm function from MATLAB has recently shifted from polynomial complexity to O(n log(n)), probably they've implemented some variation of the Fisher-Yates shuffle algorithm. randPerm1D.vi randPerm2D.vi evalRandPerm1D.vi Quote Link to comment
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.