Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Memoryless iterator for integer partitions

by grinder (Bishop)
on Jun 18, 2007 at 20:59 UTC ( #621866=note: print w/replies, xml ) Need Help??

in reply to Memoryless iterator for integer partitions

Interesting. I needed to generate some integer partitions myself for something I was working on the other day and I was surprised to discover that there wasn't anything already available on CPAN.

I searched around, and ran across the same paper. I imemplented both algorithms proposed by Zoghbi and Stojmenovic in that paper, to permit forward and reverse lexicographic orderings and released it as a module.

My only comment is that while your code is very consice, I think you have removed the constant average delay property that the original algorithm features. The algorithm only requires two scalars to maintain state, so it's not as if its a memory pig.

• another intruder with the mooring in the heart of the Perl

  • Comment on Re: Memoryless iterator for integer partitions

Replies are listed 'Best First'.
Re^2: Memoryless iterator for integer partitions
by Limbic~Region (Chancellor) on Jun 19, 2007 at 13:31 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://621866]
[marto]: good morning all
[prospect]: Good morning ! More Perl learning today, Man that subroutines chapter is tough.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2017-07-24 07:53 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (348 votes). Check out past polls.