From 420a6e3e120876103845932f7c51beb1ea8fc717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Thu, 18 Jan 2018 22:27:02 +0000 Subject: [PATCH] [dirty dipoles] Fix phases Former-commit-id: 9e38d24e105925f945c526f63496f7662479456e --- dipdip-dirty/lrhankel_recspace_dirty.c | 32 +++++++++++++++----------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/dipdip-dirty/lrhankel_recspace_dirty.c b/dipdip-dirty/lrhankel_recspace_dirty.c index ac06bdb..05b013e 100644 --- a/dipdip-dirty/lrhankel_recspace_dirty.c +++ b/dipdip-dirty/lrhankel_recspace_dirty.c @@ -8,6 +8,8 @@ #define MAXN 2 #define MAXKAPPA 5 +#define FF (-1) + typedef complex double (*lrhankelspec)(double, double, double, const complex double *, const complex double *, @@ -18,19 +20,16 @@ typedef complex double (*lrhankelspec)(double, double, double, complex double fk5q1n0l(double c, double k0, double k, const complex double *a, const complex double *b, const complex double *d, const complex double *e) { - // FIXME - return (e[0]-5*e[1]+10*e[2]-10*e[3]+5*e[4]-e[5])/k0; + return (FF*e[0]-5*e[1]+10*e[2]-10*e[3]+5*e[4]-e[5])/k0; } complex double fk5q1n1l(double c, double k0, double k, const complex double *a, const complex double *b, const complex double *d, const complex double *e) { - // FIXME - return (-d[0]+5*d[1]-10*d[2]+10*d[3]-5*d[4]+d[5])/(k0*k); + return (-FF*d[0]+5*d[1]-10*d[2]+10*d[3]-5*d[4]+d[5])/(k0*k); } complex double fk5q1n2l(double c, double k0, double k, - const complex double *a, const complex double *b, const complex double *d, const complex double *e) { double t = 2/(k*k); - // FIXME + const complex double *a, const complex double *b, const complex double *d, const complex double *e) { double t = 2/(k*k); - return ( (e[0] - t*a[0] + t*d[0]*a[0]) + return ( (FF*e[0] - t*a[0] + FF*t*d[0]*a[0]) -5 * (e[1] - t*a[1] + t*d[1]*a[1]) +10 *(e[2] - t*a[2] + t*d[2]*a[2]) -10 *(e[3] - t*a[3] + t*d[3]*a[3]) @@ -44,8 +43,7 @@ complex double fk5q2n0l(double c, double k0, double k, } complex double fk5q2n1l(double c, double k0, double k, const complex double *a, const complex double *b, const complex double *d, const complex double *e) { - // FIXME - return ( b[0]*a[0] + return ( FF *b[0]*a[0] - 5 *b[1]*a[1] +10 *b[2]*a[2] -10 *b[3]*a[3] @@ -83,13 +81,13 @@ complex double fk5q1n2s(double c, double k0, double k, - (e[5] - t*a[5] + t*d[5]*a[5]) )/k0; } -complex double fk5q2n0l(double c, double k0, double k, +complex double fk5q2n0s(double c, double k0, double k, const complex double *a, const complex double *b, const complex double *d, const complex double *e) { return 0; // FIXME } complex double fk5q2n1s(double c, double k0, double k, const complex double *a, const complex double *b, const complex double *d, const complex double *e) { - return ( b[0]*a[0] + return ( FF *b[0]*a[0] - 5 *b[1]*a[1] +10 *b[2]*a[2] -10 *b[3]*a[3] @@ -99,8 +97,7 @@ complex double fk5q2n1s(double c, double k0, double k, } complex double fk5q2n2s(double c, double k0, double k, const complex double *a, const complex double *b, const complex double *d, const complex double *e) { - // FIXME - return ( b[0]*a[0]*a[0] + return ( FF * b[0]*a[0]*a[0] + 5 * b[1]*a[1]*a[1] -10 * b[2]*a[2]*a[2] +10 * b[3]*a[3]*a[3] @@ -154,6 +151,15 @@ static lrhankelspec transfuns_f[MAXKAPPA+1][MAXQM+1][MAXN+1] = { {{fk5q1n0l,fk5q1n1l,fk5q1n2l},{fk5q2n0l/*FIXME*/,fk5q2n1l,fk5q2n2l}} }; +static lrhankelspec transfuns_n[MAXKAPPA+1][MAXQM+1][MAXN+1] = { + {{NULL,NULL,NULL},{NULL,NULL,NULL}}, + {{NULL,NULL,NULL},{NULL,NULL,NULL}}, + {{NULL,NULL,NULL},{NULL,NULL,NULL}}, + {{NULL,NULL,NULL},{NULL,NULL,NULL}}, + {{NULL,NULL,NULL},{NULL,NULL,NULL}}, + {{fk5q1n0s,fk5q1n1s,fk5q1n2s},{fk5q2n0s/*FIXME*/,fk5q2n1s,fk5q2n2s}} +}; + void lrhankel_recpart_fill(complex double *target, size_t maxn, size_t lrk_cutoff, complex double *hct,