On 2012-11-27, Travis Scrimshaw <tsc...@ucdavis.edu> wrote: > ------=_Part_468_5000489.1354057101700 > Content-Type: text/plain; charset=ISO-8859-1 > > Hey everyone, > I've been trying to figure out how to handle generalized > permutations (a.k.a. two-line arrays, bi-words, ...) since we want > Permutation() to only accept input from 1 to n. A typical misuse of Permutation is in sage/combinat/integer_vector_weighted.py where nothing prevents one to return lists all the time. Cf. e.g. the relevant part of http://trac.sagemath.org/sage_trac/attachment/ticket/13742/trac_13742_reviewer1.patch Yes, and the RSK stuff is a more tricky one.
I have a stupid question: why can't one just use lists? One should not overdesign. What are the real reasons for GeneralizedPermutation to come? E.g. to have a special class to just handle a pair of lists of equal length is a big an overdesign to me. And if you need the first list to be ordered, use a pair (set,list) > In particular, in a clean > 5.5.rc0, the permutations code will perform RSK (and the inverse) on > one-line arrays with a standard recording tableau. Currently > trac_8392-check_permutation-ts.patch tweaks the inverse to return a > generalized permutation, however I would like to know how I should go about > structuring these classes? Here's my current thoughts: > - Create a class Biword which is just two finite words of the same length. > - Create a class GeneralizedPermutation which inherits from Biword and will > check necessary conditions (e.g. support is a totally ordered alphabet, > weakly increasing in top row, etc.). > - Refactor Permutation_class so that it inherits from Finite_word (I've > talked about this with Anne, and she was favorable to this). > - Have a coercion map from Word (or Permutation) to GeneralizedPermutation > - Implement the various RSK functions in respective classes. > - Some abstract class which holds methods common to GeneralizedPermutation > and Permutation. > > Thanks, > Travis > -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.