Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimum distance of all 0 code raised mysterious error message #6486

Closed
wdjoyner opened this issue Jul 8, 2009 · 5 comments
Closed

minimum distance of all 0 code raised mysterious error message #6486

wdjoyner opened this issue Jul 8, 2009 · 5 comments

Comments

@wdjoyner
Copy link

wdjoyner commented Jul 8, 2009

This should return a more useful error message:

sage: G = matrix(GF(2),[[0,0,0]])
sage: C = LinearCode(G)
sage: C.list()
[(0, 0, 0)]
sage: C.minimum_distance()
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)

/home/wdj/.sage/temp/tinah/7902/_home_wdj__sage_init_sage_0.py in <module>()

/home/wdj/sagefiles/sage-4.1.rc1/local/lib/python2.6/site-packages/sage/coding/linear_code.pyc in minimum_distance(self, method)
   1681             return ZZ(d)
   1682         Gstr = "%s*Z(%s)^0"%(gapG, q)
-> 1683         return hamming_weight(min_wt_vec_gap(Gstr,n,k,F))
   1684
   1685     def module_composition_factors(self,gp):

/home/wdj/sagefiles/sage-4.1.rc1/local/lib/python2.6/site-packages/sage/coding/linear_code.pyc in min_wt_vec_gap(Gmat, n, k, F, method)
    379         #print [gap.eval("v["+str(i+1)+"]") for i in range(n)]
    380         all.append([v._matrix_(F),m._matrix_(F),int(dist)])
--> 381     ans = all[0]
    382     for x in all:
    383         if x[2]<ans[2] and x[2]>0:

IndexError: list index out of range

Component: coding theory

Author: Sebastian Pancratz

Reviewer: Craig Citro

Merged: sage-4.3.2.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/6486

@sagetrac-spancratz
Copy link
Mannequin

sagetrac-spancratz mannequin commented Jan 19, 2010

Attachment: trac6486.patch.gz

Adds some documentation and handles the min distance problem

@craigcitro
Copy link
Member

Reviewer: Craig Citro

@craigcitro
Copy link
Member

Author: Sebastian Pancratz

@craigcitro
Copy link
Member

comment:2

This looks good. Tons of nice cleanup, and it's clearly the right fix for the bug on the ticket.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jan 23, 2010

Merged: sage-4.3.2.alpha0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants