Add options to enable double precision if required.

这个提交包含在:
Craig Warren
2017-02-21 12:29:12 +00:00
父节点 4d0fc78c0b
当前提交 3dd219db0d
共有 2 个文件被更改,包括 20 次插入0 次删除

查看文件

@@ -25,5 +25,10 @@ cimport numpy as np
# Fractal and dispersive coefficient arrays use complex numbers (complextype) which are represented as two floats
# Main field arrays use floats (floattype) and complex numbers (complextype)
# Single precision
ctypedef np.float32_t floattype_t
ctypedef np.complex64_t complextype_t
# Double precision
#ctypedef np.float64_t floattype_t
#ctypedef np.complex128_t complextype_t

查看文件

@@ -30,5 +30,20 @@ z0 = np.sqrt(m0 / e0)
# Fractal and dispersive coefficient arrays use complex numbers (complextype) which are represented as two floats
# Main field arrays use floats (floattype) and complex numbers (complextype)
# Single precision
# For numpy arrays
floattype = np.float32
complextype = np.complex64
# For C (CUDA) arrays
cfloattype = 'float'
ccomplextype = 'pycuda::complex<float>'
# Double precision
# For numpy arrays
#floattype = np.float64
#complextype = np.complex128
# For C (CUDA) arrays
#cfloattype = 'double'
#ccomplextype = 'pycuda::complex<double>'