Wrappers for testing z != 0 lattice sum related special functions.
Former-commit-id: a6be46f81850b1c01c72ea96c141c92a98f6ace8
This commit is contained in:
parent
85dbf79caa
commit
626ffd77cd
|
@ -0,0 +1,24 @@
|
||||||
|
from .qpms_cdefs cimport *
|
||||||
|
from libc.stdlib cimport malloc, free, calloc
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
cdef extern from "ewald.h":
|
||||||
|
void ewald3_2_sigma_long_Delta(qpms_csf_result *target, int maxn, cdouble x, cdouble z)
|
||||||
|
int complex_gamma_inc_e(double a, cdouble x, int m, qpms_csf_result *result)
|
||||||
|
|
||||||
|
def e32_Delta(int maxn, cdouble x, cdouble z):
|
||||||
|
cdef qpms_csf_result *target = <qpms_csf_result *>malloc((maxn+1)*sizeof(qpms_csf_result))
|
||||||
|
cdef np.ndarray[cdouble, ndim=1] target_np = np.empty((maxn+1,), dtype=complex, order='C')
|
||||||
|
ewald3_2_sigma_long_Delta(target, maxn, x, z)
|
||||||
|
cdef int i
|
||||||
|
for i in range(maxn+1):
|
||||||
|
target_np[i] = target[i].val
|
||||||
|
free(target)
|
||||||
|
return target_np
|
||||||
|
|
||||||
|
def gamma_inc(double a, cdouble x, int m=0):
|
||||||
|
cdef qpms_csf_result res
|
||||||
|
complex_gamma_inc_e(a, x, m, &res)
|
||||||
|
return res.val
|
||||||
|
|
||||||
|
|
6
setup.py
6
setup.py
|
@ -121,6 +121,10 @@ cyquaternions = Extension('qpms.cyquaternions',
|
||||||
#extra_link_args=['amos/libamos.a', 'qpms/libqpms.a'],
|
#extra_link_args=['amos/libamos.a', 'qpms/libqpms.a'],
|
||||||
libraries=['qpms', 'gsl', 'lapacke', 'blas', 'gslcblas', 'pthread',]
|
libraries=['qpms', 'gsl', 'lapacke', 'blas', 'gslcblas', 'pthread',]
|
||||||
)
|
)
|
||||||
|
cyewaldtest = Extension('qpms.cyewaldtest',
|
||||||
|
sources = ['qpms/cyewaldtest.pyx'],
|
||||||
|
libraries=['qpms', 'gsl', 'lapacke', 'blas', 'gslcblas', 'pthread',]
|
||||||
|
)
|
||||||
|
|
||||||
qpms_c = Extension('qpms.qpms_c',
|
qpms_c = Extension('qpms.qpms_c',
|
||||||
sources = [
|
sources = [
|
||||||
|
@ -144,7 +148,7 @@ setup(name='qpms',
|
||||||
#'quaternion','spherical_functions',
|
#'quaternion','spherical_functions',
|
||||||
'scipy>=0.18.0', 'sympy>=1.2'],
|
'scipy>=0.18.0', 'sympy>=1.2'],
|
||||||
#dependency_links=['https://github.com/moble/quaternion/archive/v2.0.tar.gz','https://github.com/moble/spherical_functions/archive/master.zip'],
|
#dependency_links=['https://github.com/moble/quaternion/archive/v2.0.tar.gz','https://github.com/moble/spherical_functions/archive/master.zip'],
|
||||||
ext_modules=cythonize([qpms_c, cywaves, cytranslations, cytmatrices, cycommon, cyquaternions, cybspec, cymaterials], include_path=['qpms', 'amos'], gdb_debug=True),
|
ext_modules=cythonize([qpms_c, cywaves, cytranslations, cytmatrices, cycommon, cyquaternions, cybspec, cymaterials, cyewaldtest], include_path=['qpms', 'amos'], gdb_debug=True),
|
||||||
cmdclass = {'build_ext': build_ext},
|
cmdclass = {'build_ext': build_ext},
|
||||||
zip_safe=False
|
zip_safe=False
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue