Opened 5 years ago

Last modified 5 years ago

#21159 closed defect

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

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

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: M = C.generator_matrix()
sage: M[0,0] = 0
sage: M.row(0) in C
False

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

Change History (0)

Note: See TracTickets for help on using tickets.