Changes in sasmodels/generate.py [e1ace4d:cd3dba0] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
re1ace4d rcd3dba0 197 197 # TODO: identify model files which have changed since loading and reload them. 198 198 199 __all__ = ["make", "doc", "sources", "use_single" , "use_long_double"]199 __all__ = ["make", "doc", "sources", "use_single"] 200 200 201 201 import sys … … 206 206 C_KERNEL_TEMPLATE_PATH = joinpath(dirname(__file__), 'kernel_template.c') 207 207 208 F64 = np.dtype('float64') 208 209 F32 = np.dtype('float32') 209 F64 = np.dtype('float64')210 try: # CRUFT: older numpy does not support float128211 F128 = np.dtype('float128')212 except TypeError:213 F128 = None214 215 210 216 211 # Scale and background, which are parameters common to every form factor … … 327 322 source = re.sub(r'[^a-zA-Z_](\d*[.]\d+|\d+[.]\d*)([eE][+-]?\d+)?', 328 323 r'\g<0>f', source) 329 return source330 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 vector336 # values, where n is 2, 4, 8 or 16. Assume complex numbers are represented337 # 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)344 324 return source 345 325
Note: See TracChangeset
for help on using the changeset viewer.