Opened 7 years ago

Closed 7 years ago

#13663 closed enhancement (fixed)

Implement __len__ in LinearCode

Reported by: ppurka Owned by: wdj
Priority: major Milestone: sage-5.5
Component: coding theory Keywords:
Cc: dimpase Merged in: sage-5.5.beta2
Authors: Punarbasu Purkayastha Reviewers: Dmitrii Pasechnik
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by ppurka)

The default len(C) where C is some LinearCode instance is really slow.

sage: RS = ReedSolomonCode(15,3,GF(16,'a'))
sage: timeit('len(RS)')
5 loops, best of 3: 1.06 s per loop

Attached patch fixes this by defining a __len__ method.

sage: RS = ReedSolomonCode(15,3,GF(16,'a'))
sage: timeit('len(RS)')
625 loops, best of 3: 3.09 µs per loop

Apply trac_13663-len_in_LinearCode.patch to devel/sage

Attachments (1)

trac_13663-len_in_LinearCode.patch (781 bytes) - added by ppurka 7 years ago.
apply to devel/sage

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by ppurka

apply to devel/sage

comment:1 Changed 7 years ago by ppurka

  • Authors set to Punarbasu Purkayastha
  • Description modified (diff)
  • Status changed from new to needs_review

comment:2 Changed 7 years ago by ppurka

  • Cc dimpase added

comment:3 Changed 7 years ago by dimpase

  • Status changed from needs_review to positive_review

comment:4 Changed 7 years ago by jdemeyer

  • Reviewers set to Dmitrii Pasechnik

comment:5 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.5.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.