Boost logo

Boost Users :

From: Jeffrey Holle (jeffreyholle_at_[hidden])
Date: 2007-07-08 19:51:14


I am looking for a function that randomly selects a permutation of a
sequence. For instance given "1,2,3", it would produce something like
"2,1,3" randomly selected from all possible permutations.

I could code this myself by creating a container with all possible
permutations and randomly selecting one, but this isn't reasonably if
the size of the sequence gets larger.

I've looked on the web and found an old 4 line FORTRAN subroutine that
appears to do this. If boost don't already have this, I will attempt to
convert this to C++.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net