68
86
INTEGER,INTENT(IN)::n,ntot,i
69
87
INTEGER,DIMENSION(ntot,n),INTENT(OUT)::sol
70
88
REAL(KIND(1d0)),DIMENSION(ntot),INTENT(OUT)::factor
71
INTEGER::ifirst=0,j,k,ntemptot
89
INTEGER::ifirst=0,j,jk,k,ntemptot
90
INTEGER::maxxiarray,inum,nnum,maxxiarray1,maxxiarray2
91
INTEGER::maxfactor_xiarray
73
93
! calculate xiarray_i_n first
74
94
IF(ifirst.EQ.0)THEN
79
CALL calc_all_integers(2,1,0,xiarray_0_2(1:1,1:2))
80
factor_xiarray_0_2(1)=1d0
81
CALL calc_all_integers(2,2,1,xiarray_1_2(1:2,1:2))
83
factor_xiarray_1_2(j)=DBLE(factorial(1))
85
factor_xiarray_1_2(j)=factor_xiarray_1_2(j)/&
86
DBLE(factorial(xiarray_1_2(j,k)))
89
CALL calc_all_integers(2,3,2,xiarray_2_2(1:3,1:2))
91
factor_xiarray_2_2(j)=DBLE(factorial(2))
93
factor_xiarray_2_2(j)=factor_xiarray_2_2(j)/&
94
DBLE(factorial(xiarray_2_2(j,k)))
97
CALL calc_all_integers(2,4,3,xiarray_3_2(1:4,1:2))
99
factor_xiarray_3_2(j)=DBLE(factorial(3))
101
factor_xiarray_3_2(j)=factor_xiarray_3_2(j)/&
102
DBLE(factorial(xiarray_3_2(j,k)))
105
CALL calc_all_integers(2,5,4,xiarray_4_2(1:5,1:2))
107
factor_xiarray_4_2(j)=DBLE(factorial(4))
109
factor_xiarray_4_2(j)=factor_xiarray_4_2(j)/&
110
DBLE(factorial(xiarray_4_2(j,k)))
113
CALL calc_all_integers(2,6,5,xiarray_5_2(1:6,1:2))
115
factor_xiarray_5_2(j)=DBLE(factorial(5))
117
factor_xiarray_5_2(j)=factor_xiarray_5_2(j)/&
118
DBLE(factorial(xiarray_5_2(j,k)))
121
CALL calc_all_integers(2,7,6,xiarray_6_2(1:7,1:2))
123
factor_xiarray_6_2(j)=DBLE(factorial(6))
125
factor_xiarray_6_2(j)=factor_xiarray_6_2(j)/&
126
DBLE(factorial(xiarray_6_2(j,k)))
137
CALL calc_all_integers(3,1,0,xiarray_0_3(1:1,1:3))
138
factor_xiarray_0_3(1)=1d0
139
CALL calc_all_integers(3,3,1,xiarray_1_3(1:3,1:3))
141
factor_xiarray_1_3(j)=DBLE(factorial(1))
143
factor_xiarray_1_3(j)=factor_xiarray_1_3(j)/&
144
DBLE(factorial(xiarray_1_3(j,k)))
147
CALL calc_all_integers(3,6,2,xiarray_2_3(1:6,1:3))
149
factor_xiarray_2_3(j)=DBLE(factorial(2))
151
factor_xiarray_2_3(j)=factor_xiarray_2_3(j)/&
152
DBLE(factorial(xiarray_2_3(j,k)))
155
CALL calc_all_integers(3,10,3,xiarray_3_3(1:10,1:3))
157
factor_xiarray_3_3(j)=DBLE(factorial(3))
159
factor_xiarray_3_3(j)=factor_xiarray_3_3(j)/&
160
DBLE(factorial(xiarray_3_3(j,k)))
163
CALL calc_all_integers(3,15,4,xiarray_4_3(1:15,1:3))
165
factor_xiarray_4_3(j)=DBLE(factorial(4))
167
factor_xiarray_4_3(j)=factor_xiarray_4_3(j)/&
168
DBLE(factorial(xiarray_4_3(j,k)))
171
CALL calc_all_integers(3,21,5,xiarray_5_3(1:21,1:3))
173
factor_xiarray_5_3(j)=DBLE(factorial(5))
175
factor_xiarray_5_3(j)=factor_xiarray_5_3(j)/&
176
DBLE(factorial(xiarray_5_3(j,k)))
179
CALL calc_all_integers(3,28,6,xiarray_6_3(1:28,1:3))
181
factor_xiarray_6_3(j)=DBLE(factorial(6))
183
factor_xiarray_6_3(j)=factor_xiarray_6_3(j)/&
184
DBLE(factorial(xiarray_6_3(j,k)))
195
CALL calc_all_integers(4,1,0,xiarray_0_4(1:1,1:4))
196
factor_xiarray_0_4(1)=1d0
197
CALL calc_all_integers(4,4,1,xiarray_1_4(1:4,1:4))
199
factor_xiarray_1_4(j)=DBLE(factorial(1))
201
factor_xiarray_1_4(j)=factor_xiarray_1_4(j)/&
202
DBLE(factorial(xiarray_1_4(j,k)))
205
CALL calc_all_integers(4,10,2,xiarray_2_4(1:10,1:4))
207
factor_xiarray_2_4(j)=DBLE(factorial(2))
209
factor_xiarray_2_4(j)=factor_xiarray_2_4(j)/&
210
DBLE(factorial(xiarray_2_4(j,k)))
213
CALL calc_all_integers(4,20,3,xiarray_3_4(1:20,1:4))
215
factor_xiarray_3_4(j)=DBLE(factorial(3))
217
factor_xiarray_3_4(j)=factor_xiarray_3_4(j)/&
218
DBLE(factorial(xiarray_3_4(j,k)))
221
CALL calc_all_integers(4,35,4,xiarray_4_4(1:35,1:4))
223
factor_xiarray_4_4(j)=DBLE(factorial(4))
225
factor_xiarray_4_4(j)=factor_xiarray_4_4(j)/&
226
DBLE(factorial(xiarray_4_4(j,k)))
229
CALL calc_all_integers(4,56,5,xiarray_5_4(1:56,1:4))
231
factor_xiarray_5_4(j)=DBLE(factorial(5))
233
factor_xiarray_5_4(j)=factor_xiarray_5_4(j)/&
234
DBLE(factorial(xiarray_5_4(j,k)))
237
CALL calc_all_integers(4,84,6,xiarray_6_4(1:84,1:4))
239
factor_xiarray_6_4(j)=DBLE(factorial(6))
241
factor_xiarray_6_4(j)=factor_xiarray_6_4(j)/&
242
DBLE(factorial(xiarray_6_4(j,k)))
253
CALL calc_all_integers(5,1,0,xiarray_0_5(1:1,1:5))
254
factor_xiarray_0_5(1)=1d0
255
CALL calc_all_integers(5,5,1,xiarray_1_5(1:5,1:5))
257
factor_xiarray_1_5(j)=DBLE(factorial(1))
259
factor_xiarray_1_5(j)=factor_xiarray_1_5(j)/&
260
DBLE(factorial(xiarray_1_5(j,k)))
263
CALL calc_all_integers(5,15,2,xiarray_2_5(1:15,1:5))
265
factor_xiarray_2_5(j)=DBLE(factorial(2))
267
factor_xiarray_2_5(j)=factor_xiarray_2_5(j)/&
268
DBLE(factorial(xiarray_2_5(j,k)))
271
CALL calc_all_integers(5,35,3,xiarray_3_5(1:35,1:5))
273
factor_xiarray_3_5(j)=DBLE(factorial(3))
275
factor_xiarray_3_5(j)=factor_xiarray_3_5(j)/&
276
DBLE(factorial(xiarray_3_5(j,k)))
279
CALL calc_all_integers(5,70,4,xiarray_4_5(1:70,1:5))
281
factor_xiarray_4_5(j)=DBLE(factorial(4))
283
factor_xiarray_4_5(j)=factor_xiarray_4_5(j)/&
284
DBLE(factorial(xiarray_4_5(j,k)))
287
CALL calc_all_integers(5,126,5,xiarray_5_5(1:126,1:5))
289
factor_xiarray_5_5(j)=DBLE(factorial(5))
291
factor_xiarray_5_5(j)=factor_xiarray_5_5(j)/&
292
DBLE(factorial(xiarray_5_5(j,k)))
295
CALL calc_all_integers(5,210,6,xiarray_6_5(1:210,1:5))
297
factor_xiarray_6_5(j)=DBLE(factorial(6))
299
factor_xiarray_6_5(j)=factor_xiarray_6_5(j)/&
300
DBLE(factorial(xiarray_6_5(j,k)))
308
ntot_xiarray(5,5)=126
309
ntot_xiarray(6,5)=210
95
maxxiarray=(MAXRANK_IREGI+1)*(MAXNLOOP_IREGI-1)
96
IF(.NOT.ALLOCATED(xiarray))THEN
97
ALLOCATE(xiarray(maxxiarray))
99
maxfactor_xiarray=(MAXRANK_IREGI+1)*(MAXNLOOP_IREGI-2)
100
IF(.NOT.ALLOCATED(factor_xiarray))THEN
101
ALLOCATE(factor_xiarray(MAXRANK_IREGI+2:maxfactor_xiarray+MAXRANK_IREGI+1))
104
! C(i+n-1)^(n-1)=(i+n-1)!/(n-1)!/i!
106
inum=MOD(j-1,MAXRANK_IREGI+1) ! i
107
nnum=(j-1)/(MAXRANK_IREGI+1)+1 ! n
108
maxxiarray1=xiarray_arg1(inum,nnum)
110
IF(.NOT.ALLOCATED(xiarray(j)%xiarray_i_n))THEN
111
ALLOCATE(xiarray(j)%xiarray_i_n(maxxiarray1,maxxiarray2))
114
xiarray(j)%xiarray_i_n(1,1)=j-1
117
CALL calc_all_integers(nnum,maxxiarray1,inum,&
118
xiarray(j)%xiarray_i_n(1:maxxiarray1,1:maxxiarray2))
119
IF(.NOT.ALLOCATED(factor_xiarray(j)%factor_xiarray_i_n))THEN
120
ALLOCATE(factor_xiarray(j)%factor_xiarray_i_n(maxxiarray1))
123
factor_xiarray(j)%factor_xiarray_i_n(jk)=DBLE(factorial(inum))
125
factor_xiarray(j)%factor_xiarray_i_n(jk)=factor_xiarray(j)%factor_xiarray_i_n(jk)/&
126
DBLE(factorial(xiarray(j)%xiarray_i_n(jk,k)))
129
ntot_xiarray(inum,nnum)=maxxiarray1
312
IF(n.EQ.1.AND.i.GT.10)THEN
313
WRITE(*,*)"ERROR:i is out of the range 10 for n=1 in all_integers"
133
IF(n.GT.MAXNLOOP_IREGI-1.OR.n.LT.1)THEN
134
WRITE(*,100)"ERROR: n is out of range 1<=n<=",MAXNLOOP_IREGI-1," in all_integers"
137
IF(i.GT.MAXRANK_IREGI.OR.i.LT.0)THEN
138
WRITE(*,100)"ERROR: r is out of range 0<=r<=",MAXRANK_IREGI," in all_integers"
316
141
IF(n.EQ.1.AND.ntot.NE.1)THEN
317
142
WRITE(*,*)"ERROR:ntot should be 1 when n=1 in all_integers"
320
IF(n.GE.2.AND.n.LE.5.AND.i.GT.6)THEN
321
WRITE(*,*)"ERROR: i is out of the range 6 for 2<=n<=5 in all_integers"
324
IF(n.GE.2.AND.n.LE.5)THEN
145
IF(n.GE.2.AND.n.LE.MAXNLOOP_IREGI-1)THEN
325
146
! Make it work in MadLoop, otherwise it is wrong
326
147
IF(ntot.NE.ntot_xiarray(i,n))THEN
327
148
WRITE(*,*)"ERROR: ntot is not correct in all_integers"
331
IF(n.GT.5.OR.n.LT.1)THEN
332
WRITE(*,*)"ERROR: n is out of range 1<=n<=5 in all_integers"
152
j=(n-1)*(MAXRANK_IREGI+1)+i+1
337
sol(1:ntot,1:n)=x1array(i:i,1:n)
155
sol(1:ntot,1:n)=xiarray(j)%xiarray_i_n(1:1,1:n)
342
sol(1:ntot,1:n)=xiarray_0_2(1:ntot,1:n)
343
factor(1:ntot)=factor_xiarray_0_2(1:ntot)
345
sol(1:ntot,1:n)=xiarray_1_2(1:ntot,1:n)
346
factor(1:ntot)=factor_xiarray_1_2(1:ntot)
348
sol(1:ntot,1:n)=xiarray_2_2(1:ntot,1:n)
349
factor(1:ntot)=factor_xiarray_2_2(1:ntot)
351
sol(1:ntot,1:n)=xiarray_3_2(1:ntot,1:n)
352
factor(1:ntot)=factor_xiarray_3_2(1:ntot)
354
sol(1:ntot,1:n)=xiarray_4_2(1:ntot,1:n)
355
factor(1:ntot)=factor_xiarray_4_2(1:ntot)
357
sol(1:ntot,1:n)=xiarray_5_2(1:ntot,1:n)
358
factor(1:ntot)=factor_xiarray_5_2(1:ntot)
360
sol(1:ntot,1:n)=xiarray_6_2(1:ntot,1:n)
361
factor(1:ntot)=factor_xiarray_6_2(1:ntot)
366
sol(1:ntot,1:n)=xiarray_0_3(1:ntot,1:n)
367
factor(1:ntot)=factor_xiarray_0_3(1:ntot)
369
sol(1:ntot,1:n)=xiarray_1_3(1:ntot,1:n)
370
factor(1:ntot)=factor_xiarray_1_3(1:ntot)
372
sol(1:ntot,1:n)=xiarray_2_3(1:ntot,1:n)
373
factor(1:ntot)=factor_xiarray_2_3(1:ntot)
375
sol(1:ntot,1:n)=xiarray_3_3(1:ntot,1:n)
376
factor(1:ntot)=factor_xiarray_3_3(1:ntot)
378
sol(1:ntot,1:n)=xiarray_4_3(1:ntot,1:n)
379
factor(1:ntot)=factor_xiarray_4_3(1:ntot)
381
sol(1:ntot,1:n)=xiarray_5_3(1:ntot,1:n)
382
factor(1:ntot)=factor_xiarray_5_3(1:ntot)
384
sol(1:ntot,1:n)=xiarray_6_3(1:ntot,1:n)
385
factor(1:ntot)=factor_xiarray_6_3(1:ntot)
390
sol(1:ntot,1:n)=xiarray_0_4(1:ntot,1:n)
391
factor(1:ntot)=factor_xiarray_0_4(1:ntot)
393
sol(1:ntot,1:n)=xiarray_1_4(1:ntot,1:n)
394
factor(1:ntot)=factor_xiarray_1_4(1:ntot)
396
sol(1:ntot,1:n)=xiarray_2_4(1:ntot,1:n)
397
factor(1:ntot)=factor_xiarray_2_4(1:ntot)
399
sol(1:ntot,1:n)=xiarray_3_4(1:ntot,1:n)
400
factor(1:ntot)=factor_xiarray_3_4(1:ntot)
402
sol(1:ntot,1:n)=xiarray_4_4(1:ntot,1:n)
403
factor(1:ntot)=factor_xiarray_4_4(1:ntot)
405
sol(1:ntot,1:n)=xiarray_5_4(1:ntot,1:n)
406
factor(1:ntot)=factor_xiarray_5_4(1:ntot)
408
sol(1:ntot,1:n)=xiarray_6_4(1:ntot,1:n)
409
factor(1:ntot)=factor_xiarray_6_4(1:ntot)
414
sol(1:ntot,1:n)=xiarray_0_5(1:ntot,1:n)
415
factor(1:ntot)=factor_xiarray_0_5(1:ntot)
417
sol(1:ntot,1:n)=xiarray_1_5(1:ntot,1:n)
418
factor(1:ntot)=factor_xiarray_1_5(1:ntot)
420
sol(1:ntot,1:n)=xiarray_2_5(1:ntot,1:n)
421
factor(1:ntot)=factor_xiarray_2_5(1:ntot)
423
sol(1:ntot,1:n)=xiarray_3_5(1:ntot,1:n)
424
factor(1:ntot)=factor_xiarray_3_5(1:ntot)
426
sol(1:ntot,1:n)=xiarray_4_5(1:ntot,1:n)
427
factor(1:ntot)=factor_xiarray_4_5(1:ntot)
429
sol(1:ntot,1:n)=xiarray_5_5(1:ntot,1:n)
430
factor(1:ntot)=factor_xiarray_5_5(1:ntot)
432
sol(1:ntot,1:n)=xiarray_6_5(1:ntot,1:n)
433
factor(1:ntot)=factor_xiarray_6_5(1:ntot)
158
sol(1:ntot,1:n)=xiarray(j)%xiarray_i_n(1:ntot,1:n)
159
factor(1:ntot)=factor_xiarray(j)%factor_xiarray_i_n(1:ntot)
162
100 FORMAT(2X,A31,I2,A16)
437
163
END SUBROUTINE all_Integers
439
165
SUBROUTINE calc_factorial_pair
442
factorial_pair(1:10,0)=1d0
168
factorial_pair(1:MAXINDICES_IREGI,0)=1d0
169
DO i=1,MAXINDICES_IREGI
445
171
factorial_pair(i,j)=DBLE(factorial(i+j-1))&
446
172
/DBLE(factorial(i-1))/DBLE(factorial(j))