Test_SigmaFactorCache Namespace Reference


Functions

def Test

Variables

tuple beg = time.time( )
tuple fin = time.time( )

Function Documentation

def Test_SigmaFactorCache::Test (  ) 

Definition at line 12 of file Test_SigmaFactorCache.py.

00012            :
00013 
00014     print "SigmaFactorCache.Test:"
00015 
00016     sfc = SigmaFactorCache.SigmaFactorCache( )
00017 
00018     for q in ( 1, 3 ):
00019         for p in ( 3, 5, 7, 11 ):
00020             n = Number.Number( p, q )
00021             f = Factors.Factors( ( p ** ( q + 1 ) - 1 ) / ( p - 1 ))
00022             sfc.add( n, f )
00023     print "%s" % sfc
00024 
00025     for p in ( 7, 5, 3 ):
00026         for q in ( 1, 3 ):
00027             n = Number.Number( p, q )
00028             try:
00029                 ( d, f ) = sfc.at( n )
00030                 print "  %s %s" % ( n, f )
00031             except:
00032                 continue
00033     print
00034 
00035     print "%s" % sfc
00036     # FC.1: 35 57.95 39.20
00037     # FC.2: 0:  0.55  0.24
00038 
00039     if False:
00040         min = 1000001
00041         max = 2000000
00042         beg = time.time( )
00043         for n in range( min, max, 2 ):
00044             f = Factors( n )
00045             sfc.at_put( n, f )
00046         fin = time.time( )
00047         print "  %s" % ( fin - beg )
00048 
00049         beg = time.time( )
00050         for n in range( min, max, 2 ):
00051             f = sfc.at( n)
00052         fin = time.time( )
00053         print "  %s" % ( fin - beg )
00054 
if __name__ == '__main__':


Variable Documentation

tuple Test_SigmaFactorCache::beg = time.time( )

Definition at line 62 of file Test_SigmaFactorCache.py.

tuple Test_SigmaFactorCache::fin = time.time( )

Definition at line 71 of file Test_SigmaFactorCache.py.


Generated on Sun Mar 22 09:59:14 2009 for Multiperfect Number Generator by  doxygen 1.5.8