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

Commit de71938

Browse files
author
David Lucas
committed
Same shortcut for C(m)
1 parent 49c4488 commit de71938

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/sage/coding/linear_code.py

+7
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,10 @@ def encode(self, word, encoder_name=None, **kwargs):
19791979
The default encoder always has `F^{k}` as message space, with `k` the dimension
19801980
of ``self`` and `F` the base ring of ``self``.
19811981
1982+
One can use the following shortcut to encode a word ::
1983+
1984+
C(word)
1985+
19821986
OUTPUT:
19831987
19841988
- a vector of ``self``.
@@ -2002,6 +2006,9 @@ def encode(self, word, encoder_name=None, **kwargs):
20022006
E = self.encoder(encoder_name, **kwargs)
20032007
return E.encode(word)
20042008

2009+
#Alias for encode method
2010+
__call__ = encode
2011+
20052012
@cached_method
20062013
def encoder(self, encoder_name=None, **kwargs):
20072014
r"""

0 commit comments

Comments
 (0)