Difference between revisions of "Shuffle"
m (adding doc status category) |
(added category) |
||
Line 1: | Line 1: | ||
+ | [[Category:Distribution Functions]] | ||
+ | [[Category:Doc Status C]] <!-- For Lumina use, do not change --> | ||
+ | |||
= Function Shuffle = | = Function Shuffle = | ||
− | |||
Shuffle returns a random permutation of the values in an array along a given index. | Shuffle returns a random permutation of the values in an array along a given index. |
Revision as of 18:18, 2 May 2007
Function Shuffle
Shuffle returns a random permutation of the values in an array along a given index.
Declaration
Shuffle(A : Array[I] ; I : IndexType)
If A contains dimensions other than I, each slice of those dimensions will be independently shuffled.
If you want to shuffle an array along I, but have the same shuffling apply to all slices along other dimensions, you can do this:
Slice(A, I, Shuffle(@I,I))
Comments
Enable comment auto-refresher