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

Commit

Permalink
remove output_function
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Aug 16, 2016
1 parent a2c8e91 commit 089a0ea
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/sage/combinat/recognizable_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,6 @@ def __init__(self, parent, mu, left=None, right=None):
....: transpose=True)
[1] + 3*[01] + [10] + 5*[11] + 9*[001] + 3*[010] + ...
Using an output function::
sage: Rec = RecognizableSeriesSpace(
....: ZZ, [0, 1], output_function=lambda o: o[0, 0])
sage: Rec((Matrix([[3, 6], [0, 1]]), Matrix([[0, -6], [1, 5]])),
....: Matrix([[0, 1]]), Matrix([[1], [0]]),
....: transpose=True)
[1] + 3*[01] + [10] + 5*[11] + 9*[001] + 3*[010] + ...
.. SEEALSO::
:doc:`recognizable series <recognizable_series>`,
Expand Down Expand Up @@ -406,7 +397,7 @@ def __getitem__(self, w):
result = self.left * result
if self.right is not None:
result = result * self.right
return self.parent()._output_function_(result)
return result


@cached_method
Expand Down Expand Up @@ -819,7 +810,7 @@ class RecognizableSeriesSpace(UniqueRepresentation, Parent):
def __classcall__(cls,
coefficients=None, alphabet=None,
indices=None, algebra=None,
output_function=None, category=None):
category=None):
r"""
Normalizes the input in order to ensure a unique
representation.
Expand Down Expand Up @@ -854,10 +845,10 @@ def key_to_cmp(a, b, key):
category = category or algebra.category()

return super(RecognizableSeriesSpace, cls).__classcall__(
cls, algebra, output_function, category)
cls, algebra, category)


def __init__(self, algebra, output_function, category):
def __init__(self, algebra, category):
r"""
The space of recognizable series on the given alphabet and
with the given coefficients.
Expand All @@ -876,9 +867,6 @@ def __init__(self, algebra, output_function, category):
If specified, then ``coefficients``
and ``indices`` are determined by this ``algebra``.
- ``output_function`` -- (default: ``None'') If specified,
then this is applied on each coefficient.
- ``category`` -- (default: ``None``) the category of this
space. If ``None``, then the category of the ``algebra``
is used.
Expand Down Expand Up @@ -906,10 +894,6 @@ def __init__(self, algebra, output_function, category):
:class:`RecognizableSeries`.
"""
self._algebra_ = algebra
if output_function is None:
self._output_function_ = lambda o: o
else:
self._output_function_ = output_function
super(RecognizableSeriesSpace, self).__init__(
category=category, base=algebra.base())

Expand Down

0 comments on commit 089a0ea

Please sign in to comment.