Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
also improve the doc of left_right_symmetry
Browse files Browse the repository at this point in the history
  • Loading branch information
darijgr committed Apr 20, 2015
1 parent 99f6de5 commit dc0ebfe
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/sage/combinat/ordered_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,14 @@ def to_poset(self, root_to_leaf=False):
@combinatorial_map(order=2, name="Left-right symmetry")
def left_right_symmetry(self):
r"""
Return the symmetric tree of ``self``
Return the symmetric tree of ``self``.
The symmetric tree `s(T)` of an ordered tree `T` is
defined as follows:
If `T` is an ordered tree with children `C_1, C_2, \ldots, C_k`
(listed from left to right), then the symmetric tree `s(T)` of
`T` is the ordered tree with children
`s(C_k), s(C_{k-1}), \ldots, s(C_1)` (from left to right).
EXAMPLES::
Expand Down Expand Up @@ -1189,7 +1196,26 @@ def _auto_parent(cls):
@combinatorial_map(order=2, name="Left-right symmetry")
def left_right_symmetry(self):
r"""
Return the symmetric tree of ``self``
Return the symmetric tree of ``self``.
The symmetric tree `s(T)` of a labelled ordered tree `T` is
defined as follows:
If `T` is a labelled ordered tree with children
`C_1, C_2, \ldots, C_k` (listed from left to right), then the
symmetric tree `s(T)` of `T` is a labelled ordered tree with
children `s(C_k), s(C_{k-1}), \ldots, s(C_1)` (from left to
right), and with the same root label as `T`.
.. NOTE::
If you have a subclass of :meth:`LabelledOrderedTree`
which also inherits from another subclass of
:meth:`OrderedTree` which does not come with a labelling,
then (depending on the method resolution order) it might
happen that this method gets overridden by an
implementation from that other subclass, and thus forgets
about the labels. In this case you need to manually
override this method on your subclass.
EXAMPLES::
Expand Down

0 comments on commit dc0ebfe

Please sign in to comment.