From 49c448862fa2c32dc283b05fa7a749f064c6ec39 Mon Sep 17 00:00:00 2001 From: David Lucas Date: Mon, 22 Feb 2016 12:58:21 +0100 Subject: [PATCH] Also defined this shortcut in GRSEvaluationPolynomialEncoder --- src/sage/coding/grs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sage/coding/grs.py b/src/sage/coding/grs.py index 8d7434e29a9..e88853b7f82 100644 --- a/src/sage/coding/grs.py +++ b/src/sage/coding/grs.py @@ -658,6 +658,10 @@ def encode(self, p): r""" Transforms the polynomial ``p`` into a codeword of :meth:`code`. + One can use the following shortcut to encode a word with an encoder ``E``:: + + E(word) + INPUT: - ``p`` -- A polynomial from the message space of ``self`` of degree @@ -708,6 +712,9 @@ def encode(self, p): c = vector(C.base_ring(), [col_mults[i]*p(alphas[i]) for i in range(C.length())]) return c + #Alias for encode method + __call__ = encode + def unencode_nocheck(self, c): r""" Returns the message corresponding to the codeword ``c``.