Changeset 8375:76868822c7ef


Ignore:
Timestamp:
11/09/07 14:24:20 (6 years ago)
Author:
jvoight@…
Branch:
default
Message:

Added keep_fields to totallyreal and relative enumeration.

Location:
sage/rings/number_field
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • sage/rings/number_field/totallyreal.py

    r8373 r8375  
    8585    return dB 
    8686 
    87 def enumerate_totallyreal_fields(n, B, a = [], verbose=0, return_seqs=False, phc=False): 
     87def enumerate_totallyreal_fields(n, B, a = [], verbose=0, return_seqs=False, phc=False, keep_fields=False): 
    8888    r""" 
    8989    This function enumerates (primitive) totally real fields of  
     
    9797    If return_seqs, then return the polynomials as sequences (for easier 
    9898    exporting to a file). 
     99    If keep_fields, then keep fields up to B*log(B); if keep_fields is  
     100    an integer, then keep fields up to that integer. 
    99101 
    100102    NOTE:  
     
    191193    counts = [0,0,0,0] 
    192194 
     195    if keep_fields: 
     196        if type(keep_fields) == bool: 
     197            keepB = int(math.floor(B*math.log(B))) 
     198        else: 
     199            keepB = keep_fields 
     200 
    193201    # Trivial case 
    194202    if n == 1: 
     
    225233                    [zk,d] = nf.nfbasis_d() 
    226234 
    227                     if d <= B: 
     235                    if d <= B or (keep_fields and d <= keepB): 
    228236                        if verbose: 
    229237                            print "has discriminant", d, 
Note: See TracChangeset for help on using the changeset viewer.