Misc fixes.

Former-commit-id: 36525fd6445d1bd19ffbd803644f8ddaada07be7
This commit is contained in:
Marek Nečada 2019-03-03 00:30:12 +00:00
parent 59cf2e0778
commit 8afa775428
5 changed files with 13 additions and 10 deletions

View File

@ -18,7 +18,7 @@ typedef struct {
//complex double *bkn; // coefficients of the derivatives //complex double *bkn; // coefficients of the derivatives
} qpms_sbessel_calculator_t; } qpms_sbessel_calculator_t;
qpms_sbessel_calculator_t *qpms_sbessel_calculator_init(); qpms_sbessel_calculator_t *qpms_sbessel_calculator_init(void);
void qpms_sbessel_calculator_pfree(qpms_sbessel_calculator_t *c); void qpms_sbessel_calculator_pfree(qpms_sbessel_calculator_t *c);
qpms_errno_t qpms_sbessel_calc_fill(qpms_sbessel_calculator_t *c, qpms_bessel_t typ, qpms_l_t lmax, qpms_errno_t qpms_sbessel_calc_fill(qpms_sbessel_calculator_t *c, qpms_bessel_t typ, qpms_l_t lmax,

View File

@ -210,8 +210,8 @@ qpms_tmatrix_interpolator_t *qpms_tmatrix_interpolator_create(const size_t incou
bool n0_real = false, n0_imag = false; bool n0_real = false, n0_imag = false;
for (size_t i = 0; i < incount; ++i) { for (size_t i = 0; i < incount; ++i) {
complex double telem = ta[i].m[n * row + col]; complex double telem = ta[i].m[n * row + col];
if (y_real[i] = creal(telem)) n0_real = true; if ((y_real[i] = creal(telem))) n0_real = true;
if (y_imag[i] = cimag(telem)) n0_imag = true; if ((y_imag[i] = cimag(telem))) n0_imag = true;
} }
if (n0_real) { if (n0_real) {
gsl_spline *s = gsl_spline *s =
@ -467,8 +467,8 @@ qpms_scatsys_t *qpms_scatsys_apply_symmetry(const qpms_scatsys_t *orig, const qp
ptrdiff_t shift = ss->otspace - old_otspace; ptrdiff_t shift = ss->otspace - old_otspace;
if(shift) if(shift)
for (size_t oi = 0; oi < ss->orbit_type_count; ++oi) { for (size_t oi = 0; oi < ss->orbit_type_count; ++oi) {
(char *) (ss->orbit_types[i].action) += shift; ss->orbit_types[oi].action = (void *)(((char *) (ss->orbit_types[oi].action)) + shift);
(char *) (ss->orbit_types[i].tmatrices) += shift; ss->orbit_types[oi].tmatrices = (void *)(((char *) (ss->orbit_types[oi].tmatrices)) + shift);
} }
} }

View File

@ -61,10 +61,10 @@ bool qpms_vswf_set_spec_isidentical(const qpms_vswf_set_spec_t *a,
qpms_vswf_set_spec_t *qpms_vswf_set_spec_copy(const qpms_vswf_set_spec_t *or){ qpms_vswf_set_spec_t *qpms_vswf_set_spec_copy(const qpms_vswf_set_spec_t *or){
qpms_vswf_set_spec_t *c = malloc(sizeof(qpms_vswf_set_spec_t)); qpms_vswf_set_spec_t *c = malloc(sizeof(qpms_vswf_set_spec_t));
if (!c) abort; // return NULL if (!c) abort(); // return NULL
*c = *or; *c = *or;
c->ilist = malloc(sizeof(qpms_uvswfi_t) * c->n); c->ilist = malloc(sizeof(qpms_uvswfi_t) * c->n);
memcpy(c->ilist, or->ilist, sizeof(qpms_vswfi_t)*c->n); memcpy(c->ilist, or->ilist, sizeof(qpms_uvswfi_t)*c->n);
c->capacity = c->n; c->capacity = c->n;
return c; return c;
} }
@ -208,7 +208,7 @@ qpms_errno_t qpms_vswf_fill_alternative(csphvec_t *const longtarget, csphvec_t *
complex double besderfac = *(pbes-1) - l * besfac; complex double besderfac = *(pbes-1) - l * besfac;
double sqrtlfac = sqrt(l*(l+1)); double sqrtlfac = sqrt(l*(l+1));
for(qpms_m_t m = -l; m <= l; ++m) { for(qpms_m_t m = -l; m <= l; ++m) {
complex double eimf = cexp(m * kr.phi * I); complex double eimf = cexp(m * kr.phi * I); // FIXME unused variable?!!!
if (longtarget) { if (longtarget) {
*plong = csphvec_add(csphvec_scale(besderfac-besfac, *p3), *plong = csphvec_add(csphvec_scale(besderfac-besfac, *p3),
csphvec_scale(sqrtlfac * besfac, *p2)); csphvec_scale(sqrtlfac * besfac, *p2));

View File

@ -12,7 +12,7 @@
// Methods for qpms_vswf_spec_t // Methods for qpms_vswf_spec_t
/// Creates a qpms_vswf_set_spec_t structure with an empty list of wave indices. /// Creates a qpms_vswf_set_spec_t structure with an empty list of wave indices.
qpms_vswf_set_spec_t *qpms_vswf_set_spec_init(); qpms_vswf_set_spec_t *qpms_vswf_set_spec_init(void);
/// Appends a VSWF index to a \ref qpms_vswf_set_spec_t, also updating metadata. /// Appends a VSWF index to a \ref qpms_vswf_set_spec_t, also updating metadata.
qpms_errno_t qpms_vswf_set_spec_append(qpms_vswf_set_spec_t *self, qpms_uvswfi_t u); qpms_errno_t qpms_vswf_set_spec_append(qpms_vswf_set_spec_t *self, qpms_uvswfi_t u);
/// Destroys a \ref qpms_vswf_set_spec_t. /// Destroys a \ref qpms_vswf_set_spec_t.

View File

@ -23,7 +23,10 @@ qpms_c = Extension('qpms_c',
# FIXME http://stackoverflow.com/questions/4259170/python-setup-script-extensions-how-do-you-include-a-h-file # FIXME http://stackoverflow.com/questions/4259170/python-setup-script-extensions-how-do-you-include-a-h-file
'qpms/translations.c', 'qpms/translations.c',
'qpms/symmetries.c', 'qpms/symmetries.c',
'qpms/wigner.c'], 'qpms/wigner.c',
'qpms/scatsystem.c',
'qpms/vswf.c', # FIXME many things from vswf.c are not required by this module, but they have many dependencies (following in this list); maybe I want to move all the "basespec stuff"
'qpms/legendre.c'],
extra_compile_args=['-std=c99','-ggdb', '-O0', extra_compile_args=['-std=c99','-ggdb', '-O0',
'-DQPMS_COMPILE_PYTHON_EXTENSIONS', # this is required '-DQPMS_COMPILE_PYTHON_EXTENSIONS', # this is required
#'-DQPMS_USE_OMP', #'-DQPMS_USE_OMP',