Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1651 closed defect (fixed)

[with bundle, with positive review] bug in decode

Reported by: wdj Owned by: wdj
Priority: minor Milestone: sage-2.10.2
Component: coding theory Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Reported by Harald Schilly:

Here what I've tried (documentation does it a bit more "difficult", but should be the same -- at least I hope so) http://www.sagemath.org/doc/html/const/node37.html

C = HammingCode?(2,GF(5)) v = matrix(GF(5),1,0,0,2,1,0?) C.decode(v)

works (at least no errors), but

v = vector(GF(5),[1,0,0,2,1,0]) C.decode(v)

says:

TypeError?: Gap produced error output Permutation: <expr> must be a positive integer (not a integer) executing $sage333:=(1, 0, 0, 2, 1, 0);;

I can see the different braces in the output, but internally a 1xn/nx1 matrix should handled in some way the same as a vector.

Attachments (3)

linear_code20080102.hg (1.4 KB) - added by wdj 12 years ago.
patch for bug fix of decode in linear_code.py
1651-doctest.patch (789 bytes) - added by mhansen 12 years ago.
linear_code20080127.hg (946 bytes) - added by wdj 12 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 12 years ago by wdj

I fixed this bug. The patch is at http://sage.math.washington.edu/home/wdj/patches/linear-codes20071210.hg It passes sage -t.

Changed 12 years ago by wdj

patch for bug fix of decode in linear_code.py

comment:2 Changed 12 years ago by mhansen

  • Summary changed from bug in decode to [with bundle, needs review] bug in decode

Changed 12 years ago by mhansen

comment:3 Changed 12 years ago by ncalexan

  • Summary changed from [with bundle, needs review] bug in decode to [with bundle, with mostly positive review] bug in decode

Seems reasonable, I say apply. The formatting on the 1651-doctest patch is not the best, and I don't think the docstring to decode() is clear about what the acceptable inputs are.

Changed 12 years ago by wdj

comment:4 Changed 12 years ago by wdj

I added an attachment which includes (1) my fix of the H Schilly bug, (2) M Hansen's docstring addition (reformatted, as the referee suggested), (3) an additional doctest (as suggested by the referee).

comment:5 Changed 12 years ago by mabshoff

Could we get somebody to review this updated patch?

Cheers,

Michael

comment:6 Changed 12 years ago by ncalexan

  • Summary changed from [with bundle, with mostly positive review] bug in decode to [with bundle, with positive review] bug in decode

Thumbs up from me!

comment:7 Changed 12 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed

Merged linear_code20080127.hg in Sage 2.10.2.alpha0

comment:8 Changed 12 years ago by mabshoff

Arrg, it was actually merged in Sage 2.10.2.alpha1

Note: See TracTickets for help on using tickets.