[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] Knuth Shuffling a list twice with no identical number at
From: |
Brian Gough |
Subject: |
Re: [Help-gsl] Knuth Shuffling a list twice with no identical number at identical position |
Date: |
Fri, 20 Feb 2009 09:53:29 +0000 |
User-agent: |
Wanderlust/2.14.0 (Africa) Emacs/22.2 Mule/5.0 (SAKAKI) |
At Thu, 19 Feb 2009 16:22:49 +0530,
Awhan Patnaik wrote:
> I invoked gsl_ran_shuffle() once on each array in succession but was not
> able to achieve the desired result every time. A non-elegant (ugly) solution
> is to compare the lists and shuffle any one of them until there is no match
> at identical positions.
>
> Any help or pointer in this regard ?
Maybe the section on cyclic permutations in the manual can be of
use--you'd want to generate a random cyclic permutation without any
singleton elements to generate the second array from the first after
shuffling.
--
Brian Gough
(GSL Maintainer)
Support freedom by joining the FSF!
http://www.fsf.org/associate/support_freedom/join_fsf?referrer=37