Changeset 5edfe12 in sasmodels for sasmodels/generate.py
- Timestamp:
- Nov 24, 2015 4:13:15 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 7f7f99f
- Parents:
- 92da231
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
rcd3dba0 r5edfe12 197 197 # TODO: identify model files which have changed since loading and reload them. 198 198 199 __all__ = ["make", "doc", "sources", "use_single" ]199 __all__ = ["make", "doc", "sources", "use_single", "use_long_double"] 200 200 201 201 import sys … … 206 206 C_KERNEL_TEMPLATE_PATH = joinpath(dirname(__file__), 'kernel_template.c') 207 207 208 F128 = np.dtype('float128') 208 209 F64 = np.dtype('float64') 209 210 F32 = np.dtype('float32') … … 322 323 source = re.sub(r'[^a-zA-Z_](\d*[.]\d+|\d+[.]\d*)([eE][+-]?\d+)?', 323 324 r'\g<0>f', source) 325 return source 326 327 def use_long_double(source): 328 """ 329 Convert code from double precision to long double precision. 330 """ 331 # Convert double keyword to float. Accept an 'n' parameter for vector 332 # values, where n is 2, 4, 8 or 16. Assume complex numbers are represented 333 # as cdouble which is typedef'd to double2. 334 source = re.sub(r'(^|[^a-zA-Z0-9_]c?)double(([248]|16)?($|[^a-zA-Z0-9_]))', 335 r'\1long double\2', source) 336 # Convert floating point constants to single by adding 'f' to the end. 337 # OS/X driver complains if you don't do this. 338 source = re.sub(r'[^a-zA-Z_](\d*[.]\d+|\d+[.]\d*)([eE][+-]?\d+)?', 339 r'\g<0>L', source) 324 340 return source 325 341
Note: See TracChangeset
for help on using the changeset viewer.