Re: fixed list combinatorics

2007-11-30 Thread Xavier Noria
On Nov 29, 2007, at 2:06 AM, Xavier Noria wrote: Indeed, the iterator provided by Algorithm::Combinatorics is faster only for lists of sizes >= 7. (And gets to be twice as fast for size 16.) Certainly there's room for improvement here. For the archives, I copied the iterator in List::Power

Re: fixed list combinatorics

2007-11-28 Thread John W . Krahn
On Wednesday 28 November 2007 06:32, Dan Klose wrote: > Hi list, Hello, > I am having a bad day and would really like some help (the coffee > hasn't). > > I have a list that looks like: > my @list = (1,2,3,4); > > I would like to generate all patterns that follow: > 1 > 2 > 3 > 4 > 12 > 123 >

Re: fixed list combinatorics

2007-11-28 Thread Xavier Noria
On Nov 28, 2007, at 10:37 PM, Xavier Noria wrote: On Nov 28, 2007, at 9:54 PM, Xavier Noria wrote: On Nov 28, 2007, at 8:58 PM, yitzle wrote: In a personal email conversation, he realized what he was actually looking for is the power set. List::PowerSet http://search.cpan.org/~nikc/List-Powe

Re: fixed list combinatorics

2007-11-28 Thread Dr.Ruud
yitzle schreef: > In a personal email conversation, he realized what he was actually > looking for is the power set. > List::PowerSet > http://search.cpan.org/~nikc/List-PowerSet-0.01/lib/List/PowerSet.pm #!/usr/bin/perl use strict; use warnings; use Data::Dumper; sub powerset { my $set = shif

Re: fixed list combinatorics

2007-11-28 Thread Xavier Noria
On Nov 28, 2007, at 9:54 PM, Xavier Noria wrote: On Nov 28, 2007, at 8:58 PM, yitzle wrote: In a personal email conversation, he realized what he was actually looking for is the power set. List::PowerSet http://search.cpan.org/~nikc/List-PowerSet-0.01/lib/List/PowerSet.pm If speed is an issu

Re: fixed list combinatorics

2007-11-28 Thread Xavier Noria
On Nov 28, 2007, at 8:58 PM, yitzle wrote: In a personal email conversation, he realized what he was actually looking for is the power set. List::PowerSet http://search.cpan.org/~nikc/List-PowerSet-0.01/lib/List/PowerSet.pm If speed is an issue Algorith::Combinatorics provides subsets() in XS:

Re: fixed list combinatorics

2007-11-28 Thread Dan Klose
yeah sorry, I should have posted. Thanks all for the solutions. Next time I will post if I get a solution to the problem. On 28 Nov 2007, at 19:58, yitzle wrote: In a personal email conversation, he realized what he was actually looking for is the power set. List::PowerSet http://search.cp

Re: fixed list combinatorics

2007-11-28 Thread yitzle
In a personal email conversation, he realized what he was actually looking for is the power set. List::PowerSet http://search.cpan.org/~nikc/List-PowerSet-0.01/lib/List/PowerSet.pm -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.or

Re: fixed list combinatorics

2007-11-28 Thread Dr.Ruud
"Dan Klose" schreef: > Hi list, > > I am having a bad day and would really like some help (the coffee > hasn't). > > I have a list that looks like: > my @list = (1,2,3,4); > > I would like to generate all patterns that follow: > 1 > 2 > 3 > 4 > 12 > 123 > 23 > 34 > 234 > 1234 > > > The list

Re: fixed list combinatorics

2007-11-28 Thread Rob Dixon
Dan Klose wrote: Hi list, I am having a bad day and would really like some help (the coffee hasn't). I have a list that looks like: my @list = (1,2,3,4); I would like to generate all patterns that follow: 1 2 3 4 12 123 23 34 234 1234 The list can be of any length and the next number

Re: fixed list combinatorics

2007-11-28 Thread Dan Klose
ABC > ABCD > B > BC > BCD > C > CD > D > > -Original Message- > From: Andrew Curry [mailto:[EMAIL PROTECTED] > Sent: 28 November 2007 15:43 > To: Dan Klose; beginners@perl.org > Subject: RE: fixed list combinatorics > > Not sure this exactly w

RE: fixed list combinatorics

2007-11-28 Thread Andrew Curry
} $n++; } } If this indeed what your asking. A AB ABC ABCD B BC BCD C CD D -Original Message- From: Andrew Curry [mailto:[EMAIL PROTECTED] Sent: 28 November 2007 15:43 To: Dan Klose; beginners@perl.org Subject: RE: fixed list combinatorics Not sure this exactly what you wan

Re: fixed list combinatorics

2007-11-28 Thread yitzle
On Nov 28, 2007 9:32 AM, Dan Klose <[EMAIL PROTECTED]> wrote: > I did look at the Combinatorics module however it does > not impose fixed ordering as far as I can see. Yet the example seems to indicate that the order is followed... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

RE: fixed list combinatorics

2007-11-28 Thread Andrew Curry
Runs and returns 1 12 123 1234 2 23 234 3 34 4 -Original Message- From: Dan Klose [mailto:[EMAIL PROTECTED] Sent: 28 November 2007 14:32 To: beginners@perl.org Subject: fixed list combinatorics Hi list, I am having a bad day and would really like some help (the coffee hasn't)

fixed list combinatorics

2007-11-28 Thread Dan Klose
Hi list, I am having a bad day and would really like some help (the coffee hasn't). I have a list that looks like: my @list = (1,2,3,4); I would like to generate all patterns that follow: 1 2 3 4 12 123 23 34 234 1234 The list can be of any length and the next number in the list must be