On Sun, Feb 25, 2018 at 4:11 PM, Juan Grados <
jua...@gmail.com> wrote:
> How can I improve the time for the next code?. Basically, I want to solve a
> large undetermined binary linear system and then I need to calculate its
> hamming weight.
>
> A = random_matrix(GF(2), 10, 12, density=0.55)
> b = random_vector(GF(2), 10)
> particular_soln = A.solve_right(b, check=False)
> A_right_kernel = A.right_kernel()
> for homogeneous_soln in A_right_kernel:
> v = (particular_soln + homogeneous_soln)
> print len(v.nonzero_positions())
>
You are computing the min wt of a coset of a binary linear code.
I don't know of a fast stand alone function that does this.
Printing slows you down a lot. Just make the list of wts using list
comprehension and find its minimum later.
For real speed, you make want to modify the C code in
GAP's AClosestVectorCombinationsMatFFEVecFFE.
>
> --
> ---------------------------------------------------------------------
> MSc. Juan del Carmen Grados Vásquez
> Laboratório Nacional de Computação Científica
> Tel:
+55 21 97633 3228
> (
http://www.lncc.br/)
>
http://juaninf.blogspot.com
> ---------------------------------------------------------------------
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-algebra" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
sage-algebra...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.