Boost logo

Boost :

Subject: Re: [boost] combinations and permutations
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2011-01-04 15:56:20


Howard Hinnant wrote:
> Warming this up for tr2:
>
> http://home.roadrunner.com/~hinnant/combinations.html
>
> Comments welcome. Real world use welcome.

Hi Howard,

The only time I've needed to use anything like this was for some sort
of search, with termination as soon as a solution is found. With these
algorithms it looks like you'd need to throw an exception to do this,
which is rather frowned-upon, no? I wonder if the functor could return
a bool, or something.

Re the improved performance compared to next_permutation, I always
think of co-routines when I see things like this. A co-routine could
be used to wrap your faster algorithm in the interface of
next_permutation. Yet co-routines are rarely used. I wonder why?

Regards, Phil.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk