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