Révision 253 pobysoPythonSage/src/sageSLZ/sageSLZ.sage

sageSLZ.sage (revision 253)
487 487
        print "Less than 2 Coppersmith condition compliant vectors."
488 488
        print "Extra reduction starting..."
489 489
        reducedMatrix = reducedMatrixStep1.LLL(algorithm='fpLLL:wrapper')
490
        ### If uncommented, the following statement avoids performing
491
        #   an actual LLL reduction. This allows for demonstrating
492
        #   the behavior of our pseudo-reduction alone.
493
        #return ()
490 494
    else:
491
        print "First step of reduction affords enough vectors"
495
        print "First step of reduction afforded enough vectors"
492 496
        return ccReducedPolynomialsList
493 497
    #print ccReducedPolynomialsList
494 498
    ## Check again the Coppersmith condition for each row and build the reduced 
......
512 516
            #print l2Norm.n() , ">", nAtAlpha
513 517
            pass
514 518
    if len(ccReducedPolynomialsList) < 2: # Insufficient reduction.
515
        print "Less than 2 Coppersmith condition compliant vectors."
519
        print "Less than 2 Coppersmith condition compliant vectors after extra reduction."
516 520
        return ()
517 521
    else:
518 522
        return ccReducedPolynomialsList
......
2091 2095
#
2092 2096
def slz_pm1():
2093 2097
    """
2094
    Compute a uniform RV in {-1, 1}.
2098
    Compute a uniform RV in {-1, 1} (not zero).
2095 2099
    """
2096 2100
    ## function getrandbits(N) generates a long int with N random bits.
2097 2101
    return getrandbits(1) * 2-1
......
2314 2318
#
2315 2319
def slz_uniform(n):
2316 2320
    """
2317
    Compute a uniform RV in {-1, 1}.
2321
    Compute a uniform RV in [-2^(n-1), 2^(n-1)-1] (zero is included).
2318 2322
    """
2319 2323
    ## function getrandbits(n) generates a long int with n random bits.
2320 2324
    return getrandbits(n) - 2^(n-1)

Formats disponibles : Unified diff