[dirty dipoles] Fix phases

Former-commit-id: 9e38d24e105925f945c526f63496f7662479456e
This commit is contained in:
Marek Nečada 2018-01-18 22:27:02 +00:00
parent 86610bd66d
commit 420a6e3e12
1 changed files with 19 additions and 13 deletions

View File

@ -8,6 +8,8 @@
#define MAXN 2 #define MAXN 2
#define MAXKAPPA 5 #define MAXKAPPA 5
#define FF (-1)
typedef complex double (*lrhankelspec)(double, double, double, typedef complex double (*lrhankelspec)(double, double, double,
const complex double *, const complex 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, 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) { const complex double *a, const complex double *b, const complex double *d, const complex double *e) {
// FIXME return (FF*e[0]-5*e[1]+10*e[2]-10*e[3]+5*e[4]-e[5])/k0;
return (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, 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) { const complex double *a, const complex double *b, const complex double *d, const complex double *e) {
// FIXME return (-FF*d[0]+5*d[1]-10*d[2]+10*d[3]-5*d[4]+d[5])/(k0*k);
return (-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, 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); const complex double *a, const complex double *b, const complex double *d, const complex double *e) {
// FIXME
double t = 2/(k*k); 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]) -5 * (e[1] - t*a[1] + t*d[1]*a[1])
+10 *(e[2] - t*a[2] + t*d[2]*a[2]) +10 *(e[2] - t*a[2] + t*d[2]*a[2])
-10 *(e[3] - t*a[3] + t*d[3]*a[3]) -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, 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) { const complex double *a, const complex double *b, const complex double *d, const complex double *e) {
// FIXME return ( FF *b[0]*a[0]
return ( b[0]*a[0]
- 5 *b[1]*a[1] - 5 *b[1]*a[1]
+10 *b[2]*a[2] +10 *b[2]*a[2]
-10 *b[3]*a[3] -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]) - (e[5] - t*a[5] + t*d[5]*a[5])
)/k0; )/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) { const complex double *a, const complex double *b, const complex double *d, const complex double *e) {
return 0; // FIXME return 0; // FIXME
} }
complex double fk5q2n1s(double c, double k0, double k, 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) { 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] - 5 *b[1]*a[1]
+10 *b[2]*a[2] +10 *b[2]*a[2]
-10 *b[3]*a[3] -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, 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) { const complex double *a, const complex double *b, const complex double *d, const complex double *e) {
// FIXME return ( FF * b[0]*a[0]*a[0]
return ( b[0]*a[0]*a[0]
+ 5 * b[1]*a[1]*a[1] + 5 * b[1]*a[1]*a[1]
-10 * b[2]*a[2]*a[2] -10 * b[2]*a[2]*a[2]
+10 * b[3]*a[3]*a[3] +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}} {{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, void lrhankel_recpart_fill(complex double *target,
size_t maxn, size_t lrk_cutoff, size_t maxn, size_t lrk_cutoff,
complex double *hct, complex double *hct,