BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
minoreval.cpp
Go to the documentation of this file.
1/*
2 * minoreval.cpp - integral coefficient functions
3 *
4 * this file is part of PJFry library
5 * Copyright 2011 Valery Yundin
6 */
7
8#include "minor.h"
9#include "cache.h"
10
11/* ========================================================
12 * ========================================================
13 *
14 * PENTAGON coefficients - 5 point
15 *
16 * ========================================================
17 * ========================================================
18 */
19
20/* --------------------------------------------------------
21 5-point coefficients rank-0
22 * --------------------------------------------------------
23 */
25{
26 ncomplex ivalue=0;
27 ncomplex sum1=0;
28 const double d00=M1(0, 0);
29 for (int s=1; s<=5; s++) {
30 sum1+=M1(0, s)*I4s(ep, s);
31 }
32 ivalue=sum1/d00;
33 return ivalue;
34}
35
36/* --------------------------------------------------------
37 5-point coefficients rank-1
38 * --------------------------------------------------------
39 */
40ncomplex Minor5::evalE(int ep, int i)
41{
42 ncomplex ivalue=0;
43 ncomplex sum1=0;
44 const double d00=M1(0, 0);
45 for (int s=1; s<=5; s++) {
46 sum1+=M2(0, i, 0, s)*I4s(ep, s);
47 }
48 ivalue=-sum1/d00;
49 return ivalue;
50}
51
52/* --------------------------------------------------------
53 5-point coefficients rank-2
54 * --------------------------------------------------------
55 */
56ncomplex Minor5::evalE(int ep, int i, int j)
57{
58 ncomplex ivalue=0;
59 const double d00=M1(0, 0);
60 if (i==0 && j==0) {
61 ncomplex sum1=0;
62 for (int s=1; s<=5; s++) {
63 sum1+=M1(0, s)*I4Ds(ep, s);
64 }
65 ivalue=-sum1/(2*d00);
66 }
67 else {
68 assert(i!=0 && j!=0); // E01, E02, etc do not exist
69 ncomplex sum1=0;
70 for (int s=1; s<=5; s++) {
71 sum1+=M2(0, i, s, j)*I4Ds(ep, s);
72 sum1+=M2(0, s, 0, j)*I4Dsi(ep, s, i);
73 }
74// if (i!=j) { // is symmetrization needed?
75// ncomplex sumX=0;
76// for (int s=1; s<=5; s++) {
77// sumX+=M2(0, j, s, i)*I4Ds(ep, s);
78// sumX+=M2(0, s, 0, i)*I4Dsi(ep, s, j);
79// }
80// sum1=0.5*(sum1+sumX);
81// }
82 ivalue=sum1/d00;
83 }
84 return ivalue;
85}
86
87/* --------------------------------------------------------
88 5-point coefficients rank-3
89 * --------------------------------------------------------
90 */
91ncomplex Minor5::evalE(int ep, int i, int j, int k)
92{
93 ncomplex ivalue=0;
94 const double d00=M1(0, 0);
95 if (i==0 && j==0) {
96 assert(i==0 && j==0 && k!=0); // E000 does not exist, E100 is a wrong syntax
97
98 /* // Fleischer's formula 6.13
99 ncomplex sum1=0;
100 for (int s=1; s<=5; s++) {
101 sum1+=0.5*M2(0, s, 0, k)*I4Ds(ep, s);
102 sum1+=-M1(s, k)*I4D2s(ep, s); // (4-1)/3=1 // NB d-1=3 and d=4
103 }
104 ivalue=sum1/d00;
105 */
106 // This variant looks simpler (does not depend on I4D2s)
107 ncomplex sum1=0;
108 for (int s=1; s<=5; s++) {
109 sum1+=0.5*M2(0, s, 0, k)*I4Ds(ep, s);
110 sum1+=M1(s, 0)*I4D2si(ep, s, k);
111 }
112 ivalue=sum1/(3*d00);
113 }
114 else {
115 assert(i!=0 && j!=0 && k!=0); // E110, E012, etc do not exist
116 ncomplex sum1=0;
117 ncomplex sumX=0;
118 ncomplex sumY=0;
119 if (i == j) {
120 for (int s=1; s<=5; s++) {
121 sum1+=2*M2(0, j, s, k)*I4D2si(ep, s, i);
122 sum1+=M2(0, s, 0, k)*I4D2sij(ep, s, i, j);
123 }
124 if (i != k) {
125 for (int s=1; s<=5; s++) {
126 sumX+=M2(0, j, s, i)*I4D2si(ep, s, k);
127 sumX+=M2(0, k, s, i)*I4D2si(ep, s, j);
128 sumX+=M2(0, s, 0, i)*I4D2sij(ep, s, k, j);
129 }
130 sum1=(sum1+2.*sumX)/3.;
131 }
132 } else { // i!=j
133 for (int s=1; s<=5; s++) {
134 sum1+=M2(0, j, s, k)*I4D2si(ep, s, i);
135 sum1+=M2(0, i, s, k)*I4D2si(ep, s, j);
136 sum1+=M2(0, s, 0, k)*I4D2sij(ep, s, i, j);
137 }
138 if (i != k) {
139 for (int s=1; s<=5; s++) {
140 sumX+=M2(0, j, s, i)*I4D2si(ep, s, k);
141 sumX+=M2(0, k, s, i)*I4D2si(ep, s, j);
142 sumX+=M2(0, s, 0, i)*I4D2sij(ep, s, k, j);
143 }
144 }
145 else { sumX=sum1; }
146 if (j != k) {
147 for (int s=1; s<=5; s++) {
148 sumY+=M2(0, k, s, j)*I4D2si(ep, s, i);
149 sumY+=M2(0, i, s, j)*I4D2si(ep, s, k);
150 sumY+=M2(0, s, 0, j)*I4D2sij(ep, s, i, k);
151 }
152 }
153 else { sumY=sum1; }
154 sum1=(sum1+sumX+sumY)/3.;
155 }
156 ivalue=-sum1/d00;
157 }
158 return ivalue;
159}
160
161/* --------------------------------------------------------
162 5-point coefficients rank-4
163 * --------------------------------------------------------
164 */
165ncomplex Minor5::evalE(int ep, int i, int j, int k, int l)
166{
167 ncomplex ivalue=0;
168 const double d00=M1(0, 0);
169
170 if (i==0 && j==0) {
171 if (k==0 && l==0) {
172 ncomplex sum1=0;
173 for (int s=1; s<=5; s++) {
174#ifndef USE_GOLEM_MODE
175// Cancel pole and finite part with E00ij - LoopTools-like convention
176 sum1+=M1(s, 0)*(I4D2s(ep, s)+(ep==0 ? (-1./6.+1./4.) : (ep==1? -1./6.: 0.)));
177#else
178// Golem95 convention
179 sum1+=M1(s, 0)*(I4D2s(ep, s)+(ep==0 ? -1./9. : 0.));
180#endif
181 }
182 ivalue=0.25*sum1/d00;
183 }
184 else {
185 assert(i==0 && j==0 && k!=0 && l!=0); // E0001 does not exist, E1200 is a wrong syntax
186 ncomplex sum1=0;
187
188 for (int s=1; s<=5; s++) {
189#ifndef USE_GOLEM_MODE
190// Cancel pole and finite part with E0000 - LoopTools-like convention
191 sum1+=0.5*(M2(0, k, s, l)+M2(0, l, s, k))*(I4D2s(ep, s)+(ep==0 ? (-1./6.+1./4.) : (ep==1? -1./6.: 0.)));
192#else
193// Golem95 convention
194 sum1+=0.5*(M2(0, k, s, l)+M2(0, l, s, k))*(I4D2s(ep, s)+(ep==0 ? -1./9. : 0.));
195#endif
196 sum1+=0.5*(M2(0, s, 0, l)*I4D2si(ep, s, k)+M2(0, s, 0, k)*I4D2si(ep, s, l));
197 sum1+=0.5*M1(s, 0)*(I4D3sij(ep, s, k, l)+I4D3sij(ep, s, l, k));
198 }
199 ivalue=-0.25*sum1/d00;
200 }
201 }
202 else {
203 assert(i!=0 && j!=0 && k!=0 && l!=0); // E110, E012, etc do not exist
204 ncomplex sum1234=0;
205 for (int s=1; s<=5; s++) {
206 ncomplex sum1=M2(0,k,s,l)*I4D3sij(ep,s,i,j)
207 +M2(0,i,s,l)*I4D3sij(ep,s,k,j)
208 +M2(0,j,s,l)*I4D3sij(ep,s,i,k)
209 +M2(0,s,0,l)*I4D3sijk(ep,s,i,j,k);
210 ncomplex sum2=sum1;
211 if (l!=k) {
212 sum2=M2(0,l,s,k)*I4D3sij(ep,s,i,j)
213 +M2(0,i,s,k)*I4D3sij(ep,s,l,j)
214 +M2(0,j,s,k)*I4D3sij(ep,s,i,l)
215 +M2(0,s,0,k)*I4D3sijk(ep,s,i,j,l);
216 }
217 ncomplex sum3=sum1;
218 if (j==k) {
219 sum3=sum2;
220 }
221 else if (l!=j) {
222 sum3=M2(0,k,s,j)*I4D3sij(ep,s,i,l)
223 +M2(0,i,s,j)*I4D3sij(ep,s,k,l)
224 +M2(0,l,s,j)*I4D3sij(ep,s,i,k)
225 +M2(0,s,0,j)*I4D3sijk(ep,s,i,l,k);
226 }
227 ncomplex sum4=sum1;
228 if (i==j) {
229 sum4=sum3;
230 }
231 else if (l!=i) {
232 sum4=M2(0,k,s,i)*I4D3sij(ep,s,l,j)
233 +M2(0,l,s,i)*I4D3sij(ep,s,k,j)
234 +M2(0,j,s,i)*I4D3sij(ep,s,l,k)
235 +M2(0,s,0,i)*I4D3sijk(ep,s,l,j,k);
236 }
237 sum1234+=sum1+sum2+sum3+sum4;
238 }
239 ivalue=sum1234/(4*d00);
240 }
241 return ivalue;
242}
243
244/* --------------------------------------------------------
245 5-point coefficients rank-5
246 * --------------------------------------------------------
247 */
248ncomplex Minor5::evalE(int ep, int i, int j, int k, int l, int m)
249{
250 ncomplex ivalue=0;
251 const double d00=M1(0, 0);
252
253 if (i==0 && j==0) {
254 if (k==0 && l==0) {
255 assert(m!=0); // E00000 does not exist
256 ncomplex sum1=0;
257 for (int s=1; s<=5; s++) {
258 sum1+=+M2(0, s, 0, m)*I4D2s(ep, s)
259 +M1(s, 0)*(4.*I4D3si(ep, s, m)-2.*(ep<2 ? I4D3si(ep+1, s, m) : 0.));
260 }
261 ivalue=-sum1/(20.*d00);
262 }
263 else {
264 assert(i==0 && j==0 && k!=0 && l!=0 && m!=0); // E00012 does not exist, E00100 is a wrong syntax
265 ncomplex sum1=0;
266 ncomplex sumX=0;
267 ncomplex sumY=0;
268 if (k == l) {
269 for (int s=1; s<=5; s++) {
270 sum1+=+2*M2(0, k, s, m)*I4D3si(ep, s, l)
271 +M2(0, s, 0, m)*I4D3sij(ep, s, k, l);
272 }
273 if (ep==0) sum1+=1./24.*(M1(k, m)-M2(0, k, l, m));
274 if (k != m) {
275 for (int s=1; s<=5; s++) {
276 sumX+=+M2(0, m, s, k)*I4D3si(ep, s, l)
277 +M2(0, l, s, k)*I4D3si(ep, s, m)
278 +M2(0, s, 0, k)*I4D3sij(ep, s, m, l);
279 }
280 if (ep==0) sumX+=1./48.*(M1(m, k)+M1(l, k)-M2(0, l, m, k));
281 sum1=(sum1+2.*sumX)/3.;
282 }
283 } else { // k!=l
284 for (int s=1; s<=5; s++) {
285 sum1+=+M2(0, k, s, m)*I4D3si(ep, s, l)
286 +M2(0, l, s, m)*I4D3si(ep, s, k)
287 +M2(0, s, 0, m)*I4D3sij(ep, s, k, l);
288 }
289 if (ep==0) sum1+=1./48.*(M1(k, m)+M1(l, m)-M2(0, k, l, m)-M2(0, l, k, m));
290 if (k != m) {
291 for (int s=1; s<=5; s++) {
292 sumX+=+M2(0, m, s, k)*I4D3si(ep, s, l)
293 +M2(0, l, s, k)*I4D3si(ep, s, m)
294 +M2(0, s, 0, k)*I4D3sij(ep, s, m, l);
295 }
296 if (ep==0) sumX+=1./48.*(M1(m, k)+M1(l, k)-M2(0, m, l, k)-M2(0, l, m, k));
297 }
298 else { sumX=sum1; }
299 if (l != m) {
300 for (int s=1; s<=5; s++) {
301 sumY+=+M2(0, k, s, l)*I4D3si(ep, s, m)
302 +M2(0, m, s, l)*I4D3si(ep, s, k)
303 +M2(0, s, 0, l)*I4D3sij(ep, s, k, m);
304 }
305 if (ep==0) sumY+=1./48.*(M1(k, l)+M1(m, l)-M2(0, k, m, l)-M2(0, m, k, l));
306 }
307 else { sumY=sum1; }
308 sum1=(sum1+sumX+sumY)/3.;
309 }
310 sumX=0;
311 for (int s=1; s<=5; s++) {
312 sumX+=M1(s,0)*I4D4sijk(ep, s, k, l, m);
313 }
314 sum1=3.*sum1+2.*sumX;
315 ivalue=sum1/(10.*d00);
316 }
317 }
318 else {
319 assert(i!=0 && j!=0 && k!=0 && l!=0 && m!=0);
320 ncomplex sum12345=0;
321 for (int s=1; s<=5; s++) {
322 ncomplex sum1=+M2(0, l, s, m)*I4D4sijk(ep, s, i, j, k)
323 +M2(0, i, s, m)*I4D4sijk(ep, s, l, j, k)
324 +M2(0, j, s, m)*I4D4sijk(ep, s, i, l, k)
325 +M2(0, k, s, m)*I4D4sijk(ep, s, i, j, l)
326 +M2(0, s, 0, m)*I4D4sijkl(ep, s, i, j, k, l);
327 ncomplex sum2=sum1;
328 if (m!=l) {
329 sum2=+M2(0, m, s, l)*I4D4sijk(ep, s, i, j, k)
330 +M2(0, i, s, l)*I4D4sijk(ep, s, m, j, k)
331 +M2(0, j, s, l)*I4D4sijk(ep, s, i, m, k)
332 +M2(0, k, s, l)*I4D4sijk(ep, s, i, j, m)
333 +M2(0, s, 0, l)*I4D4sijkl(ep, s, i, j, k, m);
334 }
335 ncomplex sum3=sum1;
336 if (k==l) {
337 sum3=sum2;
338 }
339 else if (m!=k) {
340 sum3=+M2(0, l, s, k)*I4D4sijk(ep, s, i, j, m)
341 +M2(0, i, s, k)*I4D4sijk(ep, s, l, j, m)
342 +M2(0, j, s, k)*I4D4sijk(ep, s, i, l, m)
343 +M2(0, m, s, k)*I4D4sijk(ep, s, i, j, l)
344 +M2(0, s, 0, k)*I4D4sijkl(ep, s, i, j, m, l);
345 }
346 ncomplex sum4=sum1;
347 if (j==k) {
348 sum4=sum3;
349 }
350 else if (m!=j) {
351 sum4=+M2(0, l, s, j)*I4D4sijk(ep, s, i, m, k)
352 +M2(0, i, s, j)*I4D4sijk(ep, s, l, m, k)
353 +M2(0, m, s, j)*I4D4sijk(ep, s, i, l, k)
354 +M2(0, k, s, j)*I4D4sijk(ep, s, i, m, l)
355 +M2(0, s, 0, j)*I4D4sijkl(ep, s, i, m, k, l);
356 }
357 ncomplex sum5=sum1;
358 if (i==j) {
359 sum5=sum4;
360 }
361 else if (m!=i) {
362 sum5=+M2(0, l, s, i)*I4D4sijk(ep, s, m, j, k)
363 +M2(0, m, s, i)*I4D4sijk(ep, s, l, j, k)
364 +M2(0, j, s, i)*I4D4sijk(ep, s, m, l, k)
365 +M2(0, k, s, i)*I4D4sijk(ep, s, m, j, l)
366 +M2(0, s, 0, i)*I4D4sijkl(ep, s, m, j, k, l);
367 }
368 sum12345+=sum1+sum2+sum3+sum4+sum5;
369 }
370 ivalue=-sum12345/(5*d00);
371 }
372 return ivalue;
373}
374
375/* ========================================================
376 * ========================================================
377 *
378 * BOX coefficients - 4 point
379 *
380 * ========================================================
381 * ========================================================
382 */
383#ifdef USE_GOLEM_MODE_6
384 int psix;
385 #define ix(i) i<pm5->psix ? i : i-1
386#else
387 #define ix(i) i
388#endif
389/* --------------------------------------------------------
390 4-point scalar for GolemMode
391 * --------------------------------------------------------
392 */
393#ifdef USE_GOLEM_MODE
394ncomplex Minor4::A(int ep)
395{
396 ncomplex ivalue=pm5->I4s(ep, ps);
397 return ivalue;
398}
399#endif /* USE_GOLEM_MODE */
400
401/* --------------------------------------------------------
402 4-point coefficients rank-1
403 * --------------------------------------------------------
404 */
405// Global chord indexing, golem-like
406#ifdef USE_GOLEM_MODE
407ncomplex Minor4::A(int ep, int i)
408{
409 ncomplex ivalue=-pm5->I4Dsi(ep, ps, ix(i+offs));
410 return ivalue;
411}
412#endif /* USE_GOLEM_MODE */
413
414// Local chord indexing
416{
417 ncomplex ivalue=0;
418 if (i>=ps || ps==5) i=i+1;
419 ivalue=-pm5->I4Dsi(ep, ps, i);
420 return ivalue;
421}
422
423/* --------------------------------------------------------
424 4-point coefficients rank-2
425 * --------------------------------------------------------
426 */
427// Global chord indexing, golem-like
428#ifdef USE_GOLEM_MODE
429ncomplex Minor4::A(int ep, int i, int j)
430{
431 ncomplex ivalue=pm5->I4D2sij(ep, ps, ix(i+offs), ix(j+offs));
432 return ivalue;
433}
434
435ncomplex Minor4::B(int ep)
436{
437 ncomplex ivalue=-0.5*pm5->I4Ds(ep, ps);
438 return ivalue;
439}
440#endif /* USE_GOLEM_MODE */
441
442// Local chord indexing
443ncomplex Minor4::evalD(int ep, int i, int j)
444{
445 ncomplex ivalue=0;
446
447 if (i==0 && j==0) {
448 ivalue=-0.5*pm5->I4Ds(ep, ps);
449 }
450 else {
451 assert(i!=0 && j!=0); // D01, D02, etc do not exist
452 if (i>=ps || ps==5) i=i+1;
453 if (j>=ps || ps==5) j=j+1;
454
455 ivalue=pm5->I4D2sij(ep, ps, i, j);
456 }
457 return ivalue;
458}
459
460/* --------------------------------------------------------
461 4-point coefficients rank-3
462 * --------------------------------------------------------
463 */
464// Global chord indexing, golem-like
465#ifdef USE_GOLEM_MODE
466ncomplex Minor4::A(int ep, int i, int j, int k)
467{
468 ncomplex ivalue=-pm5->I4D3sijk(ep, ps, ix(i+offs), ix(j+offs), ix(k+offs));
469 return ivalue;
470}
471
472ncomplex Minor4::B(int ep, int k)
473{
474 ncomplex ivalue=0.5*pm5->I4D2si(ep, ps, ix(k+offs));
475 return ivalue;
476}
477#endif /* USE_GOLEM_MODE */
478
479// Local chord indexing
480ncomplex Minor4::evalD(int ep, int i, int j, int k)
481{
482 ncomplex ivalue=0;
483
484 if (i==0 && j==0) {
485 assert(k!=0); // D000 does not exist, D100 is a wrong syntax
486 if (k>=ps || ps==5) k=k+1;
487
488 ivalue=0.5*pm5->I4D2si(ep, ps, k);
489 }
490 else {
491 assert(i!=0 && j!=0 && k!=0); // D110, D012, etc do not exist
492 if (i>=ps || ps==5) i=i+1;
493 if (j>=ps || ps==5) j=j+1;
494 if (k>=ps || ps==5) k=k+1;
495 ivalue=-pm5->I4D3sijk(ep, ps, i, j, k);
496 }
497 return ivalue;
498}
499
500/* --------------------------------------------------------
501 4-point coefficients rank-4
502 * --------------------------------------------------------
503 */
504// Global chord indexing, golem-like
505#ifdef USE_GOLEM_MODE
506ncomplex Minor4::A(int ep, int i, int j, int k, int l)
507{
508 ncomplex ivalue=pm5->I4D4sijkl(ep, ps, ix(i+offs), ix(j+offs), ix(k+offs), ix(l+offs));
509 return ivalue;
510}
511
512ncomplex Minor4::B(int ep, int k, int l)
513{
514 ncomplex ivalue=-0.5*pm5->I4D3sij(ep, ps, ix(k+offs), ix(l+offs));
515 return ivalue;
516}
517
518ncomplex Minor4::C(int ep)
519{
520 ncomplex ivalue=0.25*pm5->I4D2s(ep, ps);
521 return ivalue;
522}
523#endif /* USE_GOLEM_MODE */
524
525// Local chord indexing
526ncomplex Minor4::evalD(int ep, int i, int j, int k, int l)
527{
528 ncomplex ivalue=0;
529 if (i==0 && j==0) {
530 if (k==0 && l==0) {
531 ivalue=0.25*pm5->I4D2s(ep, ps);
532 }
533 else {
534 assert(i==0 && j==0 && k!=0 && l!=0); // D0001 does not exist, D1200 is a wrong syntax
535 if (k>=ps || ps==5) k=k+1;
536 if (l>=ps || ps==5) l=l+1;
537
538 ivalue=-0.5*pm5->I4D3sij(ep, ps, k, l);
539 }
540 }
541 else {
542 assert(i!=0 && j!=0 && k!=0 && l!=0); // D110, D012, etc do not exist
543 if (i>=ps || ps==5) i=i+1;
544 if (j>=ps || ps==5) j=j+1;
545 if (k>=ps || ps==5) k=k+1;
546 if (l>=ps || ps==5) l=l+1;
547 ivalue=pm5->I4D4sijkl(ep, ps, i, j, k, l);
548 }
549 return ivalue;
550}
551
552/* ========================================================
553 * ========================================================
554 *
555 * TRIANGLE coefficients - 3 point
556 *
557 * ========================================================
558 * ========================================================
559 */
560/* --------------------------------------------------------
561 3-point scalar for GolemMode
562 * --------------------------------------------------------
563 */
564#ifdef USE_GOLEM_MODE
565ncomplex Minor3::A(int ep)
566{
567 ncomplex ivalue=pm5->I3st(ep, ps, pt);
568 return ivalue;
569}
570#endif /* USE_GOLEM_MODE */
571
572/* --------------------------------------------------------
573 3-point coefficients rank-1
574 * --------------------------------------------------------
575 */
576// Global chord indexing, golem-like
577#ifdef USE_GOLEM_MODE
578ncomplex Minor3::A(int ep, int i)
579{
580 ncomplex ivalue=-pm5->I3Dsti(ep, ps, pt, ix(i+offs));
581 return ivalue;
582}
583#endif /* USE_GOLEM_MODE */
584
585// Local chord indexing
587{
588 ncomplex ivalue=0;
589 if (i>=ps) i=i+1;
590 if (i>=pt || pt==5) {
591 i=i+1;
592 if (i==ps) i=i+1;
593 }
594 ivalue=-pm5->I3Dsti(ep, ps, pt, i);
595 return ivalue;
596}
597
598/* --------------------------------------------------------
599 3-point coefficients rank-2
600 * --------------------------------------------------------
601 */
602// Global chord indexing, golem-like
603#ifdef USE_GOLEM_MODE
604ncomplex Minor3::A(int ep, int i, int j)
605{
606 ncomplex ivalue=pm5->I3D2stij(ep, ps, pt, ix(i+offs), ix(j+offs));
607 return ivalue;
608}
609
610ncomplex Minor3::B(int ep)
611{
612 ncomplex ivalue=-0.5*pm5->I3Dst(ep, ps, pt);
613 return ivalue;
614}
615#endif /* USE_GOLEM_MODE */
616
617// Local chord indexing
618ncomplex Minor3::evalC(int ep, int i, int j)
619{
620 ncomplex ivalue=0;
621
622 if (i==0 && j==0) {
623 ivalue=-0.5*pm5->I3Dst(ep, ps, pt);
624 }
625 else {
626 assert(i!=0 && j!=0); // C01, C02, etc do not exist
627 int tmp;
628 tswap(i,j,tmp);
629
630 if (i>=ps) i=i+1;
631 if (i>=pt || pt==5) {
632 i=i+1;
633 if (i==ps) i=i+1;
634 }
635 if (j>=ps) j=j+1;
636 if (j>=pt || pt==5) {
637 j=j+1;
638 if (j==ps) j=j+1;
639 }
640
641 ivalue=pm5->I3D2stij(ep, ps, pt, i, j);
642 }
643 return ivalue;
644}
645
646/* --------------------------------------------------------
647 3-point coefficients rank-3
648 * --------------------------------------------------------
649 */
650// Global chord indexing, golem-like
651#ifdef USE_GOLEM_MODE
652ncomplex Minor3::A(int ep, int i, int j, int k)
653{
654 ncomplex ivalue=-pm5->I3D3stijk(ep, ps, pt, ix(i+offs), ix(j+offs), ix(k+offs));
655 return ivalue;
656}
657
658ncomplex Minor3::B(int ep, int k)
659{
660 ncomplex ivalue=0.5*pm5->I3D2sti(ep, ps, pt, ix(k+offs));
661 return ivalue;
662}
663#endif /* USE_GOLEM_MODE */
664
665// Local chord indexing
666ncomplex Minor3::evalC(int ep, int i, int j, int k)
667{
668 ncomplex ivalue=0;
669
670 if (i==0 && j==0) {
671 assert(i==0 && j==0 && k!=0); // C000 does not exist, C100 is a wrong syntax
672 if (k>=ps) k=k+1;
673 if (k>=pt || pt==5) {
674 k=k+1;
675 if (k==ps) k=k+1;
676 }
677
678 ivalue=0.5*pm5->I3D2sti(ep, ps, pt, k);
679 }
680 else {
681 assert(i!=0 && j!=0 && k!=0); // D110, D012, etc do not exist
682 if (i>=ps) i=i+1;
683 if (i>=pt || pt==5) {
684 i=i+1;
685 if (i==ps) i=i+1;
686 }
687 if (j>=ps) j=j+1;
688 if (j>=pt || pt==5) {
689 j=j+1;
690 if (j==ps) j=j+1;
691 }
692 if (k>=ps) k=k+1;
693 if (k>=pt || pt==5) {
694 k=k+1;
695 if (k==ps) k=k+1;
696 }
697 ivalue=-pm5->I3D3stijk(ep, ps, pt, i, j, k);
698 }
699 return ivalue;
700}
701
702/* ========================================================
703 * ========================================================
704 *
705 * BUBBLE coefficients - 2 point
706 *
707 * ========================================================
708 * ========================================================
709 */
710/* --------------------------------------------------------
711 2-point scalar for GolemMode
712 * --------------------------------------------------------
713 */
714#ifdef USE_GOLEM_MODE
715ncomplex Minor2::A(int ep)
716{
717 ncomplex ivalue=pm5->I2stu(ep, ps, pt, pu);
718 return ivalue;
719}
720#endif /* USE_GOLEM_MODE */
721
722/* --------------------------------------------------------
723 2-point coefficients rank-1
724 * --------------------------------------------------------
725 */
726#ifdef USE_GOLEM_MODE
727ncomplex Minor2::A(int ep, int i)
728{
729 ncomplex ivalue=-pm5->I2Dstui(ep, ps, pt, pu, ix(i+offs));
730 return ivalue;
731}
732#endif /* USE_GOLEM_MODE */
733
734// Local chord indexing
736{
737 ncomplex ivalue=0;
738
739 if (i>=ps) i=i+1;
740 if (i>=pt) {
741 i=i+1;
742 if (i==ps) i=i+1;
743 }
744 if (i>=pu || pu==5) {
745 i=i+1;
746 if (i==ps) i=i+1;
747 if (i==pt) i=i+1;
748 }
749 ivalue=-pm5->I2Dstui(ep, ps, pt, pu, i);
750 return ivalue;
751}
752
753/* --------------------------------------------------------
754 2-point coefficients rank-2
755 * --------------------------------------------------------
756 */
757#ifdef USE_GOLEM_MODE
758ncomplex Minor2::A(int ep, int i, int j)
759{
760 ncomplex ivalue=pm5->I2D2stuij(ep, ps, pt, pu, ix(i+offs), ix(j+offs));
761 return ivalue;
762}
763
764ncomplex Minor2::B(int ep)
765{
766 ncomplex ivalue=-0.5*pm5->I2Dstu(ep, ps, pt, pu);
767 return ivalue;
768}
769#endif /* USE_GOLEM_MODE */
770
771// Local chord indexing
772ncomplex Minor2::evalB(int ep, int i, int j)
773{
774 ncomplex ivalue=0;
775
776 if (i==0 && j==0) {
777 ivalue=-0.5*pm5->I2Dstu(ep, ps, pt, pu);
778 }
779 else {
780 assert(i!=0 && j!=0); // B01, B02, etc do not exist
781 if (i>=ps) i=i+1;
782 if (i>=pt) {
783 i=i+1;
784 if (i==ps) i=i+1;
785 }
786 if (i>=pu || pu==5) {
787 i=i+1;
788 if (i==ps) i=i+1;
789 if (i==pt) i=i+1;
790 }
791 ivalue=pm5->I2D2stuij(ep, ps, pt, pu, i, i);
792 }
793 return ivalue;
794}
795
XmlRpcServer s
Definition: HelloServer.cpp:11
ncomplex evalB(int ep)
ncomplex evalC(int ep)
ncomplex evalD(int ep)
double M2(int i, int j, int l, int m) PURE
Definition: minor.cpp:471
ncomplex I4D3sijk(int ep, int s, int i, int j, int k)
Definition: minor.cpp:2180
ncomplex I4D2si(int ep, int s, int i)
Definition: minor.cpp:1302
ncomplex I4D3sij(int ep, int s, int i, int j)
Definition: minor.cpp:1952
ncomplex evalE(int ep)
Definition: minoreval.cpp:24
ncomplex I4D4sijk(int ep, int s, int i, int j, int k)
Definition: minor.cpp:3003
ncomplex I4s(int ep, int s)
Definition: minor.cpp:809
double M1(int i, int l) PURE
Definition: minor.cpp:462
ncomplex I4D3si(int ep, int s, int i)
Definition: minor.cpp:1907
ncomplex I4D2sij(int ep, int s, int i, int j)
Definition: minor.cpp:1460
ncomplex I4Ds(int ep, int s)
Definition: minor.cpp:956
ncomplex I4D4sijkl(int ep, int s, int i, int j, int k, int l)
Definition: minor.cpp:3275
ncomplex I4Dsi(int ep, int s, int i)
Definition: minor.cpp:1046
ncomplex I4D2s(int ep, int s)
Definition: minor.cpp:1208
std::complex< double > ncomplex
Definition: common.h:25
#define tswap(x, y, t)
Definition: minor.h:36
#define ix(i)
Definition: minoreval.cpp:387