08-04-2011 11:31 AM - edited 08-04-2011 11:37 AM
Those IPEs are pretty handy for working on data without useing extra buffers - and they are screamming fast! Note: my fault but, the Shift trminal should be OUTSIDE the loop. that mod will allow the complier to assign the loop as a parrallel loop to really optimze the code. ![]()
Shift can also be turned into an array (remove both IPE's and shift 0 for data you want left alone) this forces you to iterate for every column and will take longer but would allow you a bit of flexability for moving non sequentiaal columns
08-04-2011 01:42 PM
How might I allow certain rows in the 2d array swap their values with other rows in the array more frequently than others? I'm thinking I might need an alternative solution. I thought I had one based on this but it was only giving the swap function a chance of working instead of one row swapping with 3 others and another swapping with 2, and so on.
I still need the same number of rows in as out.
08-04-2011 02:25 PM
well lets see what you tried.
08-04-2011 02:38 PM - edited 08-04-2011 02:38 PM
Not sure how to just post the picture like you did, so here's the vi.
My attempt seems kind of far off from my goal. 😕
08-04-2011 02:51 PM - edited 08-04-2011 02:54 PM
I have to attmit that yur requirements are a bit vague. Like This? You'll get the hang of array manipulations in time.
And that's not just a picture---- its a vi snippet. the difference? you can copy it and drag it to a LabVIEW block diagram- it runs.
Method: Edit- select all (Ctrl+A) then Edit- Create snippet from selection
To post click the tree icon in this editor browse to where you saved the snippet click insert.
08-04-2011 03:26 PM
Not entirely, unfortunately. I was trying to be as brief as possible but I'll try to explain in more detail. I'm trying to make the reproduction part of a genetic algorithm where the rows in the 2d array with the highest fitness are able to reproduce more often than those with lower fitness scores (the frequency of which being dependant on the fitness scores). However the array that comes out should be the same dimensions as the one that goes in.
I guess the word "swap" is very misleading.
08-04-2011 03:43 PM
More like this?