Subject: [boost] [Math] Permutations?
From: Vee Kay (vkicefire_at_[hidden])
Date: 2014-01-19 07:11:22
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:
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).
I 'd be happy to hear your thoughts,
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk