Boost logo

Boost :

Subject: Re: [boost] [Math] Permutations?
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2014-01-19 17:59:31


On Jan 19, 2014, at 4:11 AM, Vee Kay <vkicefire_at_[hidden]> wrote:

> Hello,
>
> Would it be useful for Boost to provide a permutation class? The
> standard provides a couple of relevant functions (is_permutation,
> next_permutation) and Boost.Iterator offers a permutation_iterator
> adaptor. But as far as I can tell, no class that can be manipulated
> similarly to the mathematical object, something like this:
>
> https://gist.github.com/Kojirion/8503800
>
> I admit I do not have many use cases in mind, just the impression this
> is a useful tool. As an example, once in a gui application I wished to
> animate the rearranging of a table; writing a permutation class made it
> easy to get the sequence of transpositions of rows and columns that
> would yield the desired result.
> (note though the above api doesn't include an asTranspositions() because
> I 'm not sure what is the most useful way to represent a transposition).

You might also look at:
        http://home.roadrunner.com/~hinnant/combinations.html

— Marshall


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