# Ticket #14255: trac_14255-combinatorial_maps-cs.patch

File trac_14255-combinatorial_maps-cs.patch, 2.4 KB (added by stumpc5, 9 years ago)
• ## sage/combinat/combinatorial_map.py

```# HG changeset patch
# User Christian Stump <christian.stump at gmail.com>
# Date 1363034670 -3600
# Node ID 4d360c5a6194e5084d9c26bd5672b27ea3cb5f4c
# Parent  53ce861557b5ddffd612b1b909fbfb62bb83363f
Trac 14255 Improving combinatorial maps

diff --git a/sage/combinat/combinatorial_map.py b/sage/combinat/combinatorial_map.py```
 a class CombinatorialMap(object): sage: p.left_tableau.__repr__() 'Combinatorial map: Robinson-Schensted insertion tableau' """ name = self._name if self._name else self.__name__ return "Combinatorial map: %s" % name return "Combinatorial map: %s" %self.name() def _sage_src_lines_(self): """ class CombinatorialMap(object): else: return self._f(*args, **kwds) def unbounded_map(self): r""" Return the unbounded version of ``self``. You can use this method to return a function which takes as input an element in the domain of the combinatorial map. See the example below. EXAMPLES:: sage: from sage.combinat.permutation import Permutation sage: pi = Permutation([1,3,2]) sage: f = pi.reverse sage: F = f.unbounded_map() sage: F(pi) [2, 3, 1] """ return self._f def order(self): """ Returns the order of ``self``, or ``None`` if the order is not known. class CombinatorialMap(object): def name(self): """ If given, returns the name of a combinatorial map; ``None`` otherwise. Returns the name of a combinatorial map. This is used for the string representation of ``self``. EXAMPLES:: class CombinatorialMap(object): ...       def to_self_2(): pass sage: CombinatorialClass.to_self_1.name() 'map1' sage: CombinatorialClass.to_self_2.name() is None True sage: CombinatorialClass.to_self_2.name() 'to_self_2' """ return self._name if self._name is not None: return self._name else: return self._f.__name__ def combinatorial_maps_in_class(cls): """