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: A coset table is standardized if when running through the cosets and
  within each coset through the generator images (ignoring generator
  inverses), the cosets appear in order of the integers
  `0, 1, \dots, n`. "Standardize" reorders the elements of `\Omega`
  such that, if we scan the coset table first by elements of `\Omega`
  and then by elements of A, then the cosets occur in ascending order.
  ``standardize()`` is used at the end of an enumeration to permute the
  cosets so that they occur in some sort of standard order.
  
  Notes
  =====
  
  procedure is described on pg. 167-168 [1], it also makes use of the
  ``switch`` routine to replace by smaller integer value.
  
  Examples
  ========
  
  >>> from sympy.combinatorics import free_group
  >>> from sympy.combinatorics.fp_groups import FpGroup, coset_enumeration_r
  >>> F, x, y = free_group("x, y")
  
  # Example 5.3 from [1]
  >>> f = FpGroup(F, [x**2*y**2, x**3*y**5])
  >>> C = coset_enumeration_r(f, [])
  >>> C.compress()
  >>> C.table
  [[1, 3, 1, 3], [2, 0, 2, 0], [3, 1, 3, 1], [0, 2, 0, 2]]
  >>> C.standardize()
  >>> C.table
  [[1, 2, 1, 2], [3, 0, 3, 0], [0, 3, 0, 3], [2, 1, 2, 1]]
docstr_tok: ["A","coset","table","is","standardized","if","when","running","through","the","cosets","and","within","each","coset","through","the","generator","images","(","ignoring","generator","inverses",")",",","the","cosets","appear","in","order","of","the","integers","`","0",",","1",",","\\dots",",","n","`",".","``","Standardize","''","reorders","the","elements","of","`","\\Omega","`","such","that",",","if","we","scan","the","coset","table","first","by","elements","of","`","\\Omega","`","and","then","by","elements","of","A",",","then","the","cosets","occur","in","ascending","order",".","``","standardize","(",")","``","is","used","at","the","end","of","an","enumeration","to","permute","the","cosets","so","that","they","occur","in","some","sort","of","standard","order",".","Notes","=====","procedure","is","described","on","pg",".","167-168","[","1","]",",","it","also","makes","use","of","the","``","switch","``","routine","to","replace","by","smaller","integer","value",".","Examples","========",">",">",">","from","sympy.combinatorics","import","free_group",">",">",">","from","sympy.combinatorics.fp_groups","import","FpGroup",",","coset_enumeration_r",">",">",">","F",",","x",",","y","=","free_group","(","``","x",",","y","''",")","#","Example","5.3","from","[","1","]",">",">",">","f","=","FpGroup","(","F",",","[","x","*","*","2","*","y","*","*","2",",","x","*","*","3","*","y","*","*","5","]",")",">",">",">","C","=","coset_enumeration_r","(","f",",","[","]",")",">",">",">","C.compress","(",")",">",">",">","C.table","[","[","1",",","3",",","1",",","3","]",",","[","2",",","0",",","2",",","0","]",",","[","3",",","1",",","3",",","1","]",",","[","0",",","2",",","0",",","2","]","]",">",">",">","C.standardize","(",")",">",">",">","C.table","[","[","1",",","2",",","1",",","2","]",",","[","3",",","0",",","3",",","0","]",",","[","0",",","3",",","0",",","3","]",",","[","2",",","1",",","2",",","1","]","]"]
code: def standardize(self):
      r"""
      A coset table is standardized if when running through the cosets and
      within each coset through the generator images (ignoring generator
      inverses), the cosets appear in order of the integers
      `0, 1, \dots, n`. "Standardize" reorders the elements of `\Omega`
      such that, if we scan the coset table first by elements of `\Omega`
      and then by elements of A, then the cosets occur in ascending order.
      ``standardize()`` is used at the end of an enumeration to permute the
      cosets so that they occur in some sort of standard order.
  
      Notes
      =====
  
      procedure is described on pg. 167-168 [1], it also makes use of the
      ``switch`` routine to replace by smaller integer value.
  
      Examples
      ========
  
      >>> from sympy.combinatorics import free_group
      >>> from sympy.combinatorics.fp_groups import FpGroup, coset_enumeration_r
      >>> F, x, y = free_group("x, y")
  
      # Example 5.3 from [1]
      >>> f = FpGroup(F, [x**2*y**2, x**3*y**5])
      >>> C = coset_enumeration_r(f, [])
      >>> C.compress()
      >>> C.table
      [[1, 3, 1, 3], [2, 0, 2, 0], [3, 1, 3, 1], [0, 2, 0, 2]]
      >>> C.standardize()
      >>> C.table
      [[1, 2, 1, 2], [3, 0, 3, 0], [0, 3, 0, 3], [2, 1, 2, 1]]
  
      """
      A = self.A
      A_dict = self.A_dict
      gamma = 1
      for alpha, x in product(range(self.n), A):
          beta = self.table[alpha][A_dict[x]]
          if beta >= gamma:
              if beta > gamma:
                  self.switch(gamma, beta)
              gamma += 1
              if gamma == self.n:
                  return
  
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 22 for calling the CosetTable obj's underlying member method code with example usage: obj.standardize() without return types