Should Encoders have a `vector_to_message` method?

Issue #159 new
Johan Rosenkilde created an issue

We have this somewhat dubious design choice of Encoder supporting any message_space, but for practical reasons allow that messages could be restricted within that message_space.

For instance, the new ReedMullerCode class has a polynomial encoder where messages are multivariate polynomials of low total degree. It would be a mess in Sage if we had to implement an efficient data structure for tightly representing any message space I might want.

However, one can imagine wanting to enumerate (the valid part of) a message space or drawing random elements (see #158). This could be done reasonably efficient and reasonably painless if just every Encoder has a vector_to_message method which converts an F^k message into an M-message, where M = self.message_space().

I could do that by first encoding using a vector encoder and then unencoding again using the M-encoder. But this is inefficient, and for most encoders my guess is that it would be easy to write the appropriate conversion (it has possibly already been written when implementing the mandatory vector-based-encoder, e.g. for both GeneralizedReedSolomonCode and ReedMullerCode).

Comments (0)

  1. Log in to comment