#6486: minimum distance of all 0 code raised mysterious error message
---------------------------+------------------------------------------------
 Reporter:  wdj            |       Owner:  rlm       
     Type:  defect         |      Status:  new       
 Priority:  major          |   Milestone:  sage-4.1.1
Component:  coding theory  |    Keywords:            
 Reviewer:                 |      Author:            
   Merged:                 |  
---------------------------+------------------------------------------------
 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
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6486>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to