#14572: Shouldn't the attacking_pairs method live in Partitions, not in 
Tableaux?
-----------------------------+----------------------------------------------
   Reporter:  darij          |             Owner:  tbd                          
 
       Type:  defect         |            Status:  new                          
 
   Priority:  minor          |         Milestone:  sage-5.10                    
 
  Component:  PLEASE CHANGE  |          Keywords:  tableaux, partitions, 
combinat
Work issues:                 |   Report Upstream:  N/A                          
 
  Reviewers:                 |           Authors:                               
 
  Merged in:                 |      Dependencies:                               
 
   Stopgaps:                 |  
-----------------------------+----------------------------------------------
 I was scrolling through ``sage/combinat/tableau.py`` and found this method
 of the Tableau class:

 {{{
     def attacking_pairs(self):
         """
         Returns a list of the attacking pairs of self. An pair of cells
 (c,
         d) is said to be attacking if one of the following conditions
         hold:

         1. c and d lie in the same row with c to the west of d

         2. c is in the row immediately to the south of d and c
            lies strictly east of d.

         EXAMPLES::

             sage: t = Tableau([[1,2,3],[2,5]])
             sage: t.attacking_pairs()
             [((0, 0), (0, 1)),
              ((0, 0), (0, 2)),
              ((0, 1), (0, 2)),
              ((1, 0), (1, 1)),
              ((1, 1), (0, 0))]
         """
         attacking_pairs = []
         for i in range(len(self)):
             for j in range(len(self[i])):
                 #c is in position (i,j)
                 #Find the d that satisfy condition 1
                 for k in range(j+1,len(self[i])):
                     attacking_pairs.append( ((i,j),(i,k)) )

                 #Find the d that satisfy condition 2
                 if i == 0:
                     continue
                 for k in range(j):
                     attacking_pairs.append( ((i,j),(i-1,k)) )

         return attacking_pairs
 }}}

 I see nothing about this method that actually uses the entries of the
 tableau, as opposed to just its shape. As the method is never used (or at
 least ``grep "attacking_pairs" -r *`` doesn't find it anywhere outside its
 own definition), it shouldn't be hard to just move it, right?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14572>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to