fplll / fpylll

A Python interface for https://github.com/fplll/fplll
GNU General Public License v2.0
123 stars 62 forks source link

update_gso failures #260

Open clay3154 opened 11 months ago

clay3154 commented 11 months ago

Hello, developers.When i test something, i use swap_rows to change the lattice basis, and then there were some miscalculations. And i test follow code from fpylll import *

    A = IntegerMatrix(7,7)
    A.randomize("uniform",bits = 5)
    M = GSO.Mat(A)
    M.update_gso()

    L = LLL.Reduction(M)
    L()

    for i in range(M.d):
        print("[",M.get_r(i,i),"]",end="")

    M.B.swap_rows(3,4)
    M.B.swap_rows(2,6)
    M.B.swap_rows(1,5)

    M.update_gso()

    for i in range(M.d):
        print("[",M.get_r(i,i),"]"," ",end="")

the two output is same. how do i properly use the update_gso or I misunderstood it?Look forward to your reply.

malb commented 10 months ago

I think you need to wrap your M.B.swap_rows() ops in with M.row_ops(start, end) to inform the library you're making changes.