Changes in sasmodels/generate.py [e1ace4d:cd3dba0] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/generate.py

    re1ace4d rcd3dba0  
    197197# TODO: identify model files which have changed since loading and reload them. 
    198198 
    199 __all__ = ["make", "doc", "sources", "use_single", "use_long_double"] 
     199__all__ = ["make", "doc", "sources", "use_single"] 
    200200 
    201201import sys 
     
    206206C_KERNEL_TEMPLATE_PATH = joinpath(dirname(__file__), 'kernel_template.c') 
    207207 
     208F64 = np.dtype('float64') 
    208209F32 = np.dtype('float32') 
    209 F64 = np.dtype('float64') 
    210 try:  # CRUFT: older numpy does not support float128 
    211     F128 = np.dtype('float128') 
    212 except TypeError: 
    213     F128 = None 
    214  
    215210 
    216211# Scale and background, which are parameters common to every form factor 
     
    327322    source = re.sub(r'[^a-zA-Z_](\d*[.]\d+|\d+[.]\d*)([eE][+-]?\d+)?', 
    328323                    r'\g<0>f', source) 
    329     return source 
    330  
    331 def use_long_double(source): 
    332     """ 
    333     Convert code from double precision to long double precision. 
    334     """ 
    335     # Convert double keyword to float.  Accept an 'n' parameter for vector 
    336     # values, where n is 2, 4, 8 or 16. Assume complex numbers are represented 
    337     # as cdouble which is typedef'd to double2. 
    338     source = re.sub(r'(^|[^a-zA-Z0-9_]c?)double(([248]|16)?($|[^a-zA-Z0-9_]))', 
    339                     r'\1long double\2', source) 
    340     # Convert floating point constants to single by adding 'f' to the end. 
    341     # OS/X driver complains if you don't do this. 
    342     source = re.sub(r'[^a-zA-Z_](\d*[.]\d+|\d+[.]\d*)([eE][+-]?\d+)?', 
    343                     r'\g<0>L', source) 
    344324    return source 
    345325 
Note: See TracChangeset for help on using the changeset viewer.