Hi Andrew,
On Tue, May 17, 2011 at 07:58:34PM -0700, Andrew Mathas wrote:
> 1. Currently the shape of a tableau must be a partition, however, to
> me it seems more natural to allow the shapes to be arbitrary
> compositions -- and certainly I need this sometimes"). I am not sure
> if this would break anything apart from the partition checks, but it
> might.
This generalization should probably go in a super class of Tableau.
> 2. Secondly, what do people think about adding a __call__ method to
> the Tableaux() class:
>
> def __call__(self,cell):
> """
> Return the entry in `cell` of the tableau
>
> EXAMPLES::
>
> sage: Tableau([[1,2,3,4],[3,4,2,5]])(0,0)
> 1
> sage: Tableau([[1,2,3,4],[3,4,2,5]])(1,3)
> 5
> """
> row=cell[0]
> col=cell[1]
> assert row<len(self.shape()) and col<self.shape()[row], 'cell not in
> diagram'
> return self[row][col]
>
> Of course, currently you can use Tableau([[1,2,3,4],[3,4,2,5]])[0][0]
> but this would be useful (for me) in writing code which could apply to
> elements of the classes Tableaux or TableauxTuples.
We definitely want a feature of this sort. In MuPAD, we had something
like T.getxy(i,j) which was doing just that. I think it was discussed
to allow for T[i,j] or T.get_cell(x,y); T(i,j) could make sense too.
And we also want T.set_cell(x,y,value) allowing for changing the value
of a cell, or even adding new cells on the border of the tableau.
Cheers,
Nicolas
--
Nicolas M. ThiƩry "Isil" <[email protected]>
http://Nicolas.Thiery.name/
--
You received this message because you are subscribed to the Google Groups
"sage-combinat-devel" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-combinat-devel?hl=en.