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

Commit

Permalink
docstring of _product_of_matrices_
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Aug 10, 2016
1 parent d8ae454 commit 03c6418
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/sage/combinat/k_regular_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,32 @@ def __getitem__(self, n):

@cached_method
def _product_of_matrices_(self, m):
r"""
Return the product of matrices according to the `k`-ary
digit expansion of `m`.
INPUT:
- ``m`` -- a nonnegative integer.
OUTPUT:
A matrix.
TESTS::
sage: Seq2 = kRegularSequences(2, ZZ)
sage: M0 = Matrix([[1, 0], [0, 1]])
sage: M1 = Matrix([[0, -1], [1, 2]])
sage: S = Seq2((M0, M1))
sage: S._product_of_matrices_(0) == M0
True
sage: S._product_of_matrices_(1) == M1
True
sage: S._product_of_matrices_(3) == M1^2
True
"""
k = self.parent().k
if m < 0:
raise ValueError
Expand Down

0 comments on commit 03c6418

Please sign in to comment.