Anyhow, there is a bug in min_wt_vec_gap()
in the non-GUAVA part the vector v might never get initialised. The if-block if dist and dist < dist_min: dist_min = dist ans = list(v) might never gets executed, e.g. in the case codes.HammingCode(2, GF(2)).minimum_distance() it does not, as dist never drops below dist_min, and ans is left empty Start with dist_min = n+1 and the bug goes away. I'll open a ticket with a fix. Dima On Saturday, 23 May 2015 10:03:19 UTC+1, Dima Pasechnik wrote: > > GAP in Sage was upgraded in the meantime. > > On Friday, 22 May 2015 13:06:28 UTC+1, vdelecroix wrote: >> >> >> >> On 22/05/15 13:03, David Joyner wrote: >> > On Fri, May 22, 2015 at 3:46 AM, Vincent Delecroix >> > <20100.d...@gmail.com> wrote: >> >> Hello, >> >> >> >> >> >> >> >> On 22/05/15 04:33, Rob Beezer wrote: >> >>> >> >>> The code below fails on 6.7 with a RuntimeError. >> >>> >> >>> r = 2 >> >>> C = codes.HammingCode(r, GF(2)) >> >>> C.minimum_distance() >> >> >> >> >> >> This is a bug in the algorithm since it does not handle the case where >> all >> >> your vectors have non zero entries. >> > >> > This statement should be interpreted to mean that all the entries of >> > the generator matrix of C are non-zero. >> >> Nope. It will fail if and only if your linear code is 1 dimensional and >> the generating vector has no zero entry. This works >> >> sage: V = LinearCode(matrix(GF(5), 2, 3, [[1,2,3],[1,1,1]])) >> sage: V.minimum_distance() >> 2 >> >> >> It might be because of me in #17452 >> >> >> >>> For r > 5 it seems to hang interminably, while back in >> November/December >> >>> I could do r = 7 in a few seconds, and do r = 10 without waiting >> too >> >>> long. >> >> >> > >> >>From your traceback, it seems that there is a problem with calling >> > some C code in GAP's kernel? >> >> No. It is just an explicit RuntimeError raised by the current code. The >> name of the Python function in which this error is raised is >> min_wt_vec_gap. Which does not imply that it is a problem with GAP. >> >> Vincent >> > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.