#20201: Improving Efficiency of LinearCode.NearestNeighborDecoder method
-------------------------------------+-------------------------------------
       Reporter:  arpitdm            |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-7.2
      Component:  coding theory      |   Resolution:
       Keywords:  beginner           |    Merged in:
        Authors:  Arpit Merchant     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/arpitdm/improving_efficiency_of_linearcode_nearestneighbordecoder_method|  
9fcf54ddeae6ce3bf0815390caf4e2c24fcdd0aa
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by arpitdm):

 I was thinking that the first idea is more convenient. The following
 should suffice, right?

 c_min = self.code().zero()
 h_min = r.hamming_weight()
 for c in self.code():
     if (c-r).hamming_weight() < h_min:
           h_min = (c-r).hamming_weight()
           c_min = c
 c_min.set_immutable()
 return c_min

 Also, I was just testing commits after I fixed that pkgconfig error and in
 that confusion, I forgot to remove the try-except catch. Sorry.

--
Ticket URL: <http://trac.sagemath.org/ticket/20201#comment:17>
Sage <http://www.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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to