cntl

LLL algorithm in NTL library


I am learning to use the NTL library currently, especially for the LLL algorithm later. Does anyone have any idea of the usage of the LLL function in the NTL library? Thanks in advance.


Solution

  • From the "documentation":

    long 
    [G_]LLL_{FP,QP,XD,RR} (mat_ZZ& B, [ mat_ZZ& U, ] double delta = 0.99, 
                       long deep = 0, LLLCheckFct check = 0, long verbose = 0);
    

    You can use the LLL function by calling e.g.

    LLL_FP(B)
    

    The suffix FP marks the precision, since the calculations are done in floating point arithmetic. This is done for speedup the LLL algorithm. If you need better prezision, you can choose one of the other suffixes QP, XD or RR.

    Notice that B has to be a matrix of type ZZ. NTL uses the rows of the matrix as basis of the lattice. (I ran into this problem, due to Prof. C.P. Schnorr writes a lattice basis as columns)

    After thereduction the LLL-reduced basis overrides your input matrix B. If you need the transition matrix U, that do the reducktioin U*B = B_LLL, you can call

    LLL_FP(B, U)
    

    I hope this helps.