On Apr 16, 5:28 pm, Alec Mihailovs <[email protected]> wrote:
>
> Also, perhaps, just simple linsolve can be used (in my decode) if it
> exists in Sage and works for overdetermined systems of linear
> equations.

Yes, I found it - it is called solve_left, and it can be used as
follows,

def decode1(w,erasures=[]):
    pos=[i for i in range(27) if not i in erasures]
    G1=G.matrix_from_columns(pos)
    if G1.rank()!=10:
        print "Too many erasures"
        return None
    else:
        return
G1.solve_left(vector(GF(3),w.list_from_positions(pos)))

However, it is slower than decode,

timeit('decode(w)')
                 125 loops, best of 3: 3.87 ms per loop
timeit('decode1(w)')
                125 loops, best of 3: 6.98 ms per loop

Alec



-- 
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-support
URL: http://www.sagemath.org

Reply via email to