class_docstr: Properties
  ==========
  
  [1] `0 \in \Omega` and `\tau(1) = \epsilon`
  [2] `\alpha^x = \beta \Leftrightarrow \beta^{x^{-1}} = \alpha`
  [3] If `\alpha^x = \beta`, then `H \tau(\alpha)x = H \tau(\beta)`
  [4] `\forall \alpha \in \Omega, 1^{\tau(\alpha)} = \alpha`
  
  References
  ==========
  
  .. [1] Holt, D., Eick, B., O'Brien, E.
         "Handbook of Computational Group Theory"
  
  .. [2] John J. Cannon; Lucien A. Dimino; George Havas; Jane M. Watson
         Mathematics of Computation, Vol. 27, No. 123. (Jul., 1973), pp. 463-490.
         "Implementation and Analysis of the Todd-Coxeter Algorithm"
class_docstr_tok: ["Properties","==========","[","1","]","`","0","\\in","\\Omega","`","and","`","\\tau","(","1",")","=","\\epsilon","`","[","2","]","`","\\alpha^x","=","\\beta","\\Leftrightarrow","\\beta^","{","x^","{","-1","}","}","=","\\alpha","`","[","3","]","If","`","\\alpha^x","=","\\beta","`",",","then","`","H","\\tau","(","\\alpha",")","x","=","H","\\tau","(","\\beta",")","`","[","4","]","`","\\forall","\\alpha","\\in","\\Omega",",","1^","{","\\tau","(","\\alpha",")","}","=","\\alpha","`","References","==========","..","[","1","]","Holt",",","D.",",","Eick",",","B.",",","O'Brien",",","E.","``","Handbook","of","Computational","Group","Theory","''","..","[","2","]","John","J.","Cannon",";","Lucien","A.","Dimino",";","George","Havas",";","Jane","M.","Watson","Mathematics","of","Computation",",","Vol",".","27",",","No",".","123",".","(","Jul.",",","1973",")",",","pp",".","463-490",".","``","Implementation","and","Analysis","of","the","Todd-Coxeter","Algorithm","''"]
docstr: Removes the non-live cosets from the coset table, described on
  pg. 167 [1].
docstr_tok: ["Removes","the","non-live","cosets","from","the","coset","table",",","described","on","pg",".","167","[","1","]","."]
code: def compress(self):
      """Removes the non-live cosets from the coset table, described on
      pg. 167 [1].
  
      """
      gamma = -1
      A = self.A
      A_dict = self.A_dict
      A_dict_inv = self.A_dict_inv
      table = self.table
      chi = tuple([i for i in range(len(self.p)) if self.p[i] != i])
      for alpha in self.omega:
          gamma += 1
          if gamma != alpha:
              # replace alpha by gamma in coset table
              for x in A:
                  beta = table[alpha][A_dict[x]]
                  table[gamma][A_dict[x]] = beta
                  table[beta][A_dict_inv[x]] == gamma
      # all the cosets in the table are live cosets
      self.p = list(range(gamma + 1))
      # delete the useless columns
      del table[len(self.p) :]
      # re-define values
      for row in table:
          for j in range(len(self.A)):
              row[j] -= bisect_left(chi, row[j])
  
imports: from sympy.combinatorics.free_groups import free_group
  from sympy.printing.defaults import DefaultPrinting
  from itertools import chain, product
  from bisect import bisect_left
label_desc: Use image node_id 23 for calling the CosetTable obj's underlying member method code with example usage: obj.compress() without return types