Opened 8 years ago

Closed 7 years ago

#14572 closed defect (duplicate)

Shouldn't the attacking_pairs method live in Partitions, not in Tableaux?

Reported by: darij Owned by: sage-combinat
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: combinatorics Keywords: tableaux, partitions, combinat
Cc: sage-combinat, tscrim, chrisjamesberg Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

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?

Change History (8)

comment:1 Changed 8 years ago by darij

  • Component changed from PLEASE CHANGE to combinatorics
  • Owner changed from tbd to sage-combinat

comment:2 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:3 Changed 7 years ago by tscrim

  • Cc chrisjamesberg added

I agree (somehow I had missed this e-mail). I'm cc-ing Chris Berg to see if he has an opinion on this.

comment:4 Changed 7 years ago by darij

Oops, I forgot about this ticket. Everything I wanted to do about this is done and merged already in #15327. Sorry for the misdirection.

comment:5 Changed 7 years ago by darij

  • Status changed from new to needs_review

comment:6 Changed 7 years ago by darij

  • Status changed from needs_review to positive_review

comment:7 Changed 7 years ago by tscrim

  • Milestone changed from sage-6.1 to sage-duplicate/invalid/wontfix

comment:8 Changed 7 years ago by vbraun

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.