Ticket #14319: trac_14319-from_list_to_domain.patch

File trac_14319-from_list_to_domain.patch, 7.4 KB (added by ncohen, 8 years ago)
  • sage/graphs/generic_graph.py

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1364034315 -3600
    # Node ID 0996caa09bb4446bab9272984cabc14d9a47c01a
    # Parent  9ba68ffc259df41d694855a2646c6db8c56a40f5
    Renames permgroup_element.list() to domain()
    
    diff --git a/sage/graphs/generic_graph.py b/sage/graphs/generic_graph.py
    a b  
    1591915919
    1592015920        Relabeling using a Sage permutation::
    1592115921
     15922            sage: G = graphs.PathGraph(3)
    1592215923            sage: from sage.groups.perm_gps.permgroup_named import SymmetricGroup
    1592315924            sage: S = SymmetricGroup(3)
    1592415925            sage: gamma = S('(1,2)')
     
    1605116052        elif isinstance(perm, PermutationGroupElement):
    1605216053            n = self.order()
    1605316054            ddict = {}
    16054             llist = perm.list()
    1605516055            for i in xrange(1,n):
    16056                 ddict[i] = llist[i-1]%n
     16056                ddict[i] = perm(i)%n
    1605716057            if n > 0:
    16058                 ddict[0] = llist[n-1]%n
     16058                ddict[0] = perm(n)%n
    1605916059            perm = ddict
    1606016060
    1606116061        elif callable(perm):
  • sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pyx

    diff --git a/sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pyx b/sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pyx
    a b  
    224224        sage: gens = [[1,2,3,0]]
    225225        sage: reps = []
    226226        sage: for p in SymmetricGroup(4):
    227         ...     p = [a-1 for a in p.list()]
     227        ...     p = [p(i)-1 for i in range(1,5)]
    228228        ...     r = coset_rep(p, gens)
    229229        ...     if r not in reps:
    230230        ...         reps.append(r)
     
    233233        sage: gens = [[1,0,2,3],[0,1,3,2]]
    234234        sage: reps = []
    235235        sage: for p in SymmetricGroup(4):
    236         ...     p = [a-1 for a in p.list()]
     236        ...     p = [p(i)-1 for i in range(1,5)]
    237237        ...     r = coset_rep(p, gens)
    238238        ...     if r not in reps:
    239239        ...         reps.append(r)
     
    242242        sage: gens = [[1,2,0,3]]
    243243        sage: reps = []
    244244        sage: for p in SymmetricGroup(4):
    245         ...     p = [a-1 for a in p.list()]
     245        ...     p = [p(i)-1 for i in range(1,5)]
    246246        ...     r = coset_rep(p, gens)
    247247        ...     if r not in reps:
    248248        ...         reps.append(r)
  • sage/groups/perm_gps/partn_ref/data_structures_pyx.pxi

    diff --git a/sage/groups/perm_gps/partn_ref/data_structures_pyx.pxi b/sage/groups/perm_gps/partn_ref/data_structures_pyx.pxi
    a b  
    18031803                raise AssertionError
    18041804            if test_contains:
    18051805                for i from 0 <= i < 3:
    1806                     permy = G.random_element().list()
     1806                    permy = G.random_element()
    18071807                    for j from 0 <= j < n:
    1808                         perm[j] = permy[j]-1
     1808                        perm[j] = permy(j+1)-1
    18091809                    if not SC_contains(SC, 0, perm, 0):
    18101810                        print "FAIL", L
    18111811                        print 'element', permy
  • sage/groups/perm_gps/partn_ref/double_coset.pyx

    diff --git a/sage/groups/perm_gps/partn_ref/double_coset.pyx b/sage/groups/perm_gps/partn_ref/double_coset.pyx
    a b  
    128128        sage: gens = [[1,2,3,0]]
    129129        sage: reps = [[0,1,2,3]]
    130130        sage: for p in SymmetricGroup(4):
    131         ...     p = [a-1 for a in p.list()]
     131        ...     p = [p(i)-1 for i in range(1,5)]
    132132        ...     found = False
    133133        ...     for r in reps:
    134134        ...         if coset_eq(p, r, gens):
     
    141141        sage: gens = [[1,0,2,3],[0,1,3,2]]
    142142        sage: reps = [[0,1,2,3]]
    143143        sage: for p in SymmetricGroup(4):
    144         ...     p = [a-1 for a in p.list()]
     144        ...     p = [p(i)-1 for i in range(1,5)]
    145145        ...     found = False
    146146        ...     for r in reps:
    147147        ...         if coset_eq(p, r, gens):
     
    154154        sage: gens = [[1,2,0,3]]
    155155        sage: reps = [[0,1,2,3]]
    156156        sage: for p in SymmetricGroup(4):
    157         ...     p = [a-1 for a in p.list()]
     157        ...     p = [p(i)-1 for i in range(1,5)]
    158158        ...     found = False
    159159        ...     for r in reps:
    160160        ...         if coset_eq(p, r, gens):
  • sage/groups/perm_gps/partn_ref/refinement_graphs.pyx

    diff --git a/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx b/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx
    a b  
    901901                seen[i] = 1
    902902        return partition
    903903    else:
    904         n = len(gamma.list())
     904        n = len(gamma.domain())
    905905        l = []
    906906        for i in range(1,n+1):
    907907            orb = gamma.orbit(i)
  • sage/groups/perm_gps/permgroup_element.pxd

    diff --git a/sage/groups/perm_gps/permgroup_element.pxd b/sage/groups/perm_gps/permgroup_element.pxd
    a b  
    1010    cdef __tuple
    1111    cdef PermutationGroupElement _new_c(self)
    1212    cpdef _gap_list(self)
    13     cpdef list(self)
     13    cpdef domain(self)
    1414    cdef public __custom_name
    1515    cpdef list _act_on_list_on_position(self, list x)
    1616    cpdef ClonableIntArray _act_on_array_on_position(self, ClonableIntArray x)
  • sage/groups/perm_gps/permgroup_element.pyx

    diff --git a/sage/groups/perm_gps/permgroup_element.pyx b/sage/groups/perm_gps/permgroup_element.pyx
    a b  
    6767from sage.interfaces.all import gap, is_GapElement, is_ExpectElement
    6868from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
    6969import sage.structure.coerce as coerce
     70from sage.misc.superseded import deprecated_function_alias
    7071
    7172import operator
    7273
     
    497498           sage: func(*args)
    498499           (1,2,3)(4,5)
    499500        """
    500         return make_permgroup_element_v2, (self._parent, self.list(), self._parent.domain())
     501        return make_permgroup_element_v2, (self._parent, self.domain(), self._parent.domain())
    501502       
    502503    cdef PermutationGroupElement _new_c(self):
    503504        cdef PermutationGroupElement other = PY_NEW_SAME_TYPE(self)
     
    917918        from sage.combinat.permutation import Permutation
    918919        return Permutation(self._gap_list()).cycle_string()
    919920
    920     cpdef list(self):
     921    list = deprecated_function_alias(14319, domain)
     922
     923    cpdef domain(self):
    921924        """
    922         Returns list of the images of the integers from 1 to n under this
    923         permutation as a list of Python ints.
    924        
     925        Returns the domain of self.
     926
    925927        EXAMPLES::
    926        
     928
    927929            sage: G = SymmetricGroup(4)
    928930            sage: x = G([2,1,4,3]); x
    929931            (1,2)(3,4)
    930             sage: v = x.list(); v
     932            sage: v = x.domain(); v
    931933            [2, 1, 4, 3]
    932934            sage: type(v[0])
    933935            <type 'int'>
    934936            sage: x = G([2,1]); x
    935937            (1,2)
    936             sage: x.list()
     938            sage: x.domain()
    937939            [2, 1, 3, 4]
    938940
    939941        TESTS::
     
    941943            sage: S = SymmetricGroup(0)
    942944            sage: x = S.one(); x
    943945            ()
    944             sage: x.list()
     946            sage: x.domain()
    945947            []
    946948        """
    947949        cdef int i
     
    991993            ('b', 'a')
    992994        """
    993995        if self.__tuple is None:
    994             self.__tuple = tuple(self.list())
     996            self.__tuple = tuple(self.domain())
    995997        return self.__tuple
    996998
    997999    def dict(self):