45 #define PMSIGNC(a,b,c,d) { a.r=c.r+d.r; a.i=c.i+d.i; b.r=c.r-d.r; b.i=c.i-d.i; }
47 #define MULPMSIGNC(a,b,c) { a.r=b.r*c.r-b.i*c.i; a.i=b.r*c.i+b.i*c.r; }
50 #define PMSIGNC(a,b,c,d) { a.r=c.r-d.r; a.i=c.i-d.i; b.r=c.r+d.r; b.i=c.i+d.i; }
52 #define MULPMSIGNC(a,b,c) { a.r=b.r*c.r+b.i*c.i; a.i=b.r*c.i-b.i*c.r; }
55 static void X(2) (
size_t ido,
size_t l1,
const cmplx *cc,
cmplx *ch,
63 PMC (
CH(0,k,0),
CH(0,k,1),
CC(0,0,k),
CC(0,1,k))
73 static void X(3)(
size_t ido,
size_t l1,
const cmplx *cc,
cmplx *ch,
77 static const double taur=-0.5, taui=
PSIGN 0.86602540378443864676;
79 cmplx c2, c3, d2, d3, t2;
108 static void X(4)(
size_t ido,
size_t l1,
const cmplx *cc,
cmplx *ch,
113 cmplx c2, c3, c4, t1, t2, t3, t4;
126 for (i=0; i<ido; ++i)
131 PMC(
CH(i,k,0),c3,t2,t3)
139 static void X(5)(
size_t ido,
size_t l1,
const cmplx *cc,
cmplx *ch,
143 static const double tr11= 0.3090169943749474241,
144 ti11=
PSIGN 0.95105651629515357212,
145 tr12=-0.8090169943749474241,
146 ti12=
PSIGN 0.58778525229247312917;
148 cmplx c2, c3, c4, c5, d2, d3, d4, d5, t2, t3, t4, t5;
153 PMC (t2,t5,
CC(0,1,k),
CC(0,4,k))
154 PMC (t3,t4,
CC(0,2,k),
CC(0,3,k))
155 CH(0,k,0).r=
CC(0,0,k).r+t2.
r+t3.
r;
156 CH(0,k,0).i=
CC(0,0,k).i+t2.
i+t3.
i;
157 c2.
r=
CC(0,0,k).r+tr11*t2.
r+tr12*t3.
r;
158 c2.
i=
CC(0,0,k).i+tr11*t2.
i+tr12*t3.
i;
159 c3.
r=
CC(0,0,k).r+tr12*t2.
r+tr11*t3.
r;
160 c3.
i=
CC(0,0,k).i+tr12*t2.
i+tr11*t3.
i;
161 c5.
r=ti11*t5.
r+ti12*t4.
r;
162 c5.
i=ti11*t5.
i+ti12*t4.
i;
163 c4.
r=ti12*t5.
r-ti11*t4.
r;
164 c4.
i=ti12*t5.
i-ti11*t4.
i;
172 for (i=0; i<ido; ++i)
174 PMC (t2,t5,
CC(i,1,k),
CC(i,4,k))
175 PMC (t3,t4,
CC(i,2,k),
CC(i,3,k))
176 CH(i,k,0).r=
CC(i,0,k).r+t2.
r+t3.
r;
177 CH(i,k,0).i=
CC(i,0,k).i+t2.
i+t3.
i;
178 c2.
r=
CC(i,0,k).r+tr11*t2.
r+tr12*t3.
r;
179 c2.
i=
CC(i,0,k).i+tr11*t2.
i+tr12*t3.
i;
180 c3.
r=
CC(i,0,k).r+tr12*t2.
r+tr11*t3.
r;
181 c3.
i=
CC(i,0,k).i+tr12*t2.
i+tr11*t3.
i;
182 c5.
r=ti11*t5.
r+ti12*t4.
r;
183 c5.
i=ti11*t5.
i+ti12*t4.
i;
184 c4.
r=ti12*t5.
r-ti11*t4.
r;
185 c4.
i=ti12*t5.
i-ti11*t4.
i;
197 static void X(6)(
size_t ido,
size_t l1,
const cmplx *cc,
cmplx *ch,
201 static const double taui=
PSIGN 0.86602540378443864676;
202 cmplx ta1,ta2,ta3,
a0,a1,a2,tb1,tb2,tb3,b0,b1,b2,d1,d2,d3,d4,d5;
208 PMC(ta1,ta3,
CC(0,2,k),
CC(0,4,k))
209 ta2.
r =
CC(0,0,k).r - .5*ta1.
r;
210 ta2.
i =
CC(0,0,k).i - .5*ta1.
i;
215 PMC(tb1,tb3,
CC(0,5,k),
CC(0,1,k))
216 tb2.
r =
CC(0,3,k).r - .5*tb1.
r;
217 tb2.
i =
CC(0,3,k).i - .5*tb1.
i;
228 for (i=0; i<ido; ++i)
230 PMC(ta1,ta3,
CC(i,2,k),
CC(i,4,k))
231 ta2.
r =
CC(i,0,k).r - .5*ta1.
r;
232 ta2.
i =
CC(i,0,k).i - .5*ta1.
i;
237 PMC(tb1,tb3,
CC(i,5,k),
CC(i,1,k))
238 tb2.
r =
CC(i,3,k).r - .5*tb1.
r;
239 tb2.
i =
CC(i,3,k).i - .5*tb1.
i;
255 static void X(g)(
size_t ido,
size_t ip,
size_t l1,
const cmplx *cc,
cmplx *ch,
258 const size_t cdim=ip;
260 cmplx *ccl=tarr, *wal=tarr+ip;
261 size_t i,j,k,l,jc,lc;
262 size_t ipph = (ip+1)/2;
265 wal[i]=wa[ido*(i-1)];
267 for (i=0; i<ido; ++i)
271 for(j=1,jc=ip-1; j<ipph; ++j,--jc)
273 PMC (ccl[j],ccl[jc],
CC(i,j,k),
CC(i,jc,k))
277 for (j=1, jc=ip-1; j<=ipph; ++j,--jc)
279 cmplx abr=ccl[0], abi={0.,0.};
281 for (l=1,lc=ip-1; l<ipph; ++l,--lc)
284 if (iang>ip) iang-=ip;
285 abr.
r += ccl[l ].
r*wal[iang].r;
286 abr.
i += ccl[l ].
i*wal[iang].r;
287 abi.r += ccl[lc].
r*wal[iang].i;
288 abi.i += ccl[lc].
i*wal[iang].i;
291 { abi.i=-abi.i; abi.r=-abi.r; }
294 PMC(
CH(i,k,j),
CH(i,k,jc),abr,abi)
305 size_t idij=(j-1)*ido+1;
306 for(i=1; i<ido; ++i, ++idij)
#define RALLOC(type, num)
#define MULPMSIGNC(a, b, c)
#define PMSIGNC(a, b, c, d)
constexpr double a0
Bohr radius in m.