Opened 5 years ago

Closed 4 years ago

#21156 closed defect (fixed)

AbstractLinearCode.dimension() is wrong if `_dimension` is not set

Reported by: jsrn Owned by:
Priority: major Milestone: sage-7.6
Component: coding theory Keywords: linear code, beginner, rd3
Cc: dlucas Merged in:
Authors: Bruno Grenet Reviewers: Johan Rosenkilde
Report Upstream: N/A Work issues:
Branch: b72b705 (Commits, GitHub, GitLab) Commit: b72b7054c90c6601202940a9c882dcd7ae4a2de3
Dependencies: Stopgaps:

Status badges

Description

The current implementation of AbstractLinearCode.dimension() simply accesses self._dimension. But there is no (longer a) requirement that this be set at construction time. The method should instead check if the special variable is set, and if it is not, compute the dimension as the number of rows in a generator matrix.

Change History (7)

comment:1 Changed 4 years ago by bruno

I implemented a fix.

comment:2 Changed 4 years ago by bruno

  • Branch set to u/bruno/abstractlinearcode_dimension___is_wrong_if___dimension__is_not_set
  • Commit set to 8c994a64bc02c20a769b06c17f462ec6ed980699
  • Status changed from new to needs_review

New commits:

4a8613e21156: Compute dimension if not already known
8c994a621156: Add tests (+ minor typo)

comment:3 Changed 4 years ago by git

  • Commit changed from 8c994a64bc02c20a769b06c17f462ec6ed980699 to fb83a2527af7bd9540017fd9bb7437210dc08d2d

Branch pushed to git repo; I updated commit sha1. New commits:

fb83a2521156: Better doctest

comment:4 Changed 4 years ago by jsrn

  • Branch changed from u/bruno/abstractlinearcode_dimension___is_wrong_if___dimension__is_not_set to u/jsrn/abstractlinearcode_dimension___is_wrong_if___dimension__is_not_set

comment:5 Changed 4 years ago by jsrn

  • Commit changed from fb83a2527af7bd9540017fd9bb7437210dc08d2d to b72b7054c90c6601202940a9c882dcd7ae4a2de3

Added a note about the _registered_encoder that bruno ran into when writing the doc test.

Otherwise good, setting positive review.


New commits:

b72b705Added note on class-level registration dictionaries to the doc.

comment:6 Changed 4 years ago by jsrn

  • Authors set to Bruno Grenet
  • Keywords rd3 added
  • Milestone changed from sage-7.3 to sage-7.6
  • Reviewers set to Johan Rosenkilde
  • Status changed from needs_review to positive_review

comment:7 Changed 4 years ago by vbraun

  • Branch changed from u/jsrn/abstractlinearcode_dimension___is_wrong_if___dimension__is_not_set to b72b7054c90c6601202940a9c882dcd7ae4a2de3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.