Opened 5 years ago

Last modified 5 years ago

#21159 closed defect

Cached generator matrices and parity check matrices should be immutable — at Version 1

Reported by: jsrn Owned by:
Priority: major Milestone: sage-7.6
Component: coding theory Keywords: linear code, beginner, rd3
Cc: dlucas Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jsrn)

In all linear code classes, constructed generator matrices and parity check matrices are cached for efficiency. However, they are often not immutable, leading to incorrect behaviour if the user inadvertently changes them.

sage: C = codes.GeneralizedReedSolomonCode(GF(7).list(), 3)
sage: C.generator_matrix()[0,0] = 0
sage: C.generator_matrix().row(0) in C

All such cached matrices should be made immutable by G.set_immutable(True).

Change History (1)

comment:1 Changed 5 years ago by jsrn

  • Description modified (diff)
Note: See TracTickets for help on using tickets.