[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] permutation

From: Inigo Aldazabal Mensa
Subject: Re: [Help-gsl] permutation
Date: Fri, 19 Aug 2005 16:16:00 +0200
User-agent: KMail/1.8


If you just want combinations with the elements allowed to repeat, as in your 
{0,1} sample, I think you can do it yourself with just four nested for loops 
all of them running from 1 to 4...

Something as...

for (n1=1; n1<=4; n1++)
   for (n2...)
      for (n3...)
         for (n4...){
            print (n1 n2 n3 n4)



El Viernes, 19 de Agosto de 2005 15:47, Eric Germaneau escribió:
> Hello,
> I'd like to find out all possible combinations of {1,2,3,4} set. There
> are actually 1024 i think.
> I'm trying to use "permutaions" from GSL but I do not get out all of them.
> For example if I ask combination os {0,1} set the result is: 0 1 ; 1 0
> In fact 1 1 and 0 0 are missing ....
> Does someone has an idea hoe to do that?
> Thanks in advance,
> Regards,
>                         Eric.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]