Skip to content

Commit d4bee56

Browse files
committed
unify input of matrices and vectors
1 parent 6ba0eaf commit d4bee56

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/sage/combinat/k_regular_sequence.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ def __init__(self, parent, mu, left=None, right=None):
150150
151151
:doc:`k-regular sequence <k_regular_sequence>`,
152152
:class:`kRegularSequenceSpace`.
153+
154+
TESTS::
155+
156+
sage: Seq2(([[1, 0], [0, 1]], [[1, 1], [0, 1]]), (1, 0), (0, 1))
157+
2-regular sequence 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, ...
153158
"""
154159
super().__init__(parent=parent, mu=mu, left=left, right=right)
155160

src/sage/combinat/recognizable_series.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ def __init__(self, parent, mu, left, right):
441441
super(RecognizableSeries, self).__init__(parent=parent)
442442

443443
from copy import copy
444+
from sage.matrix.constructor import Matrix
444445
from sage.modules.free_module_element import vector
445446
from sage.sets.family import Family
446447

@@ -456,7 +457,7 @@ def immutable(m):
456457
return m
457458

458459
if isinstance(mu, dict):
459-
mu = dict((a, immutable(M)) for a, M in mu.items())
460+
mu = dict((a, immutable(Matrix(M))) for a, M in mu.items())
460461
mu = Family(mu)
461462

462463
if not mu.is_finite():

0 commit comments

Comments
 (0)