Warning: if you do not have a copy of our bitbucket repository, these examples will not work!
{{{id=1| F = GF(256, 'a') n,k = 255,200 alphas = F.list()[:n] C = GeneralizedReedSolomonCode(alphas, k) print C /// }}} {{{id=5| %time print C.minimum_distance() /// }}} {{{id=2| M = C.generator_matrix() /// }}} {{{id=10| Clin = LinearCode(M) /// }}} {{{id=9| %time Clin.minimum_distance() /// }}}Decoding example
{{{id=11| F = GF(13, 'a') n,k = 12,8 alphas = F.list()[:n] C = GeneralizedReedSolomonCode(alphas, k) print C /// }}} {{{id=7| c = C.random_element() print c /// }}} {{{id=3| y = copy(c) y[0] += 1 print y /// }}} {{{id=12| print y in C /// }}} {{{id=4| cdec = C.decode_to_code(y) print cdec /// }}} {{{id=8| c == cdec /// }}}