Skip to content

Commit c79c8b9

Browse files
authored
Merge pull request #821 from jalvesz/master
Fixes for extended and quad precision checking. Add CI cheks with fpm
2 parents 627d72c + be667e3 commit c79c8b9

File tree

4 files changed

+147
-507
lines changed

4 files changed

+147
-507
lines changed

.github/workflows/fpm-deployment.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ jobs:
3535
with:
3636
fpm-version: 'v0.10.0'
3737

38-
- run: |
38+
- run: | # Just for deployment: create stdlib-fpm folder
3939
python config/fypp_deployment.py --deploy_stdlib_fpm
40-
fpm test --profile release
40+
41+
- run: | # Use fpm gnu ci to check xdp and qp
42+
python config/fypp_deployment.py --with_xdp --with_qp
43+
fpm test --profile release --flag '-DWITH_XDP -DWITH_QP'
4144
4245
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm` branch.
4346
- name: Deploy 🚀

src/stdlib_specialfunctions_gamma.fypp

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#:set WITH_QP = False
2-
#:set WITH_XDP = False
31
#:include "common.fypp"
4-
#:set CI_KINDS_TYPES = INT_KINDS_TYPES + CMPLX_KINDS_TYPES
2+
#:set R_KINDS_TYPES = [KT for KT in REAL_KINDS_TYPES if KT[0] in ["sp","dp"]]
3+
#:set C_KINDS_TYPES = [KT for KT in CMPLX_KINDS_TYPES if KT[0] in ["sp","dp"]]
4+
#:set CI_KINDS_TYPES = INT_KINDS_TYPES + C_KINDS_TYPES
55
module stdlib_specialfunctions_gamma
66
use iso_fortran_env, only : qp => real128
77
use stdlib_kinds, only : sp, dp, int8, int16, int32, int64
@@ -15,7 +15,7 @@ module stdlib_specialfunctions_gamma
1515
integer(int32), parameter :: max_fact_int32 = 13_int32
1616
integer(int64), parameter :: max_fact_int64 = 21_int64
1717

18-
#:for k1, t1 in REAL_KINDS_TYPES
18+
#:for k1, t1 in R_KINDS_TYPES
1919
${t1}$, parameter :: tol_${k1}$ = epsilon(1.0_${k1}$)
2020
#:endfor
2121
real(qp), parameter :: tol_qp = epsilon(1.0_qp)
@@ -63,12 +63,12 @@ module stdlib_specialfunctions_gamma
6363
!! Lower incomplete gamma function
6464
!!
6565
#:for k1, t1 in INT_KINDS_TYPES
66-
#:for k2, t2 in REAL_KINDS_TYPES
66+
#:for k2, t2 in R_KINDS_TYPES
6767
module procedure ingamma_low_${t1[0]}$${k1}$${k2}$
6868
#:endfor
6969
#:endfor
7070

71-
#:for k1, t1 in REAL_KINDS_TYPES
71+
#:for k1, t1 in R_KINDS_TYPES
7272
module procedure ingamma_low_${t1[0]}$${k1}$
7373
#:endfor
7474
end interface lower_incomplete_gamma
@@ -79,12 +79,12 @@ module stdlib_specialfunctions_gamma
7979
!! Logarithm of lower incomplete gamma function
8080
!!
8181
#:for k1, t1 in INT_KINDS_TYPES
82-
#:for k2, t2 in REAL_KINDS_TYPES
82+
#:for k2, t2 in R_KINDS_TYPES
8383
module procedure l_ingamma_low_${t1[0]}$${k1}$${k2}$
8484
#:endfor
8585
#:endfor
8686

87-
#:for k1, t1 in REAL_KINDS_TYPES
87+
#:for k1, t1 in R_KINDS_TYPES
8888
module procedure l_ingamma_low_${t1[0]}$${k1}$
8989
#:endfor
9090
end interface log_lower_incomplete_gamma
@@ -95,12 +95,12 @@ module stdlib_specialfunctions_gamma
9595
!! Upper incomplete gamma function
9696
!!
9797
#:for k1, t1 in INT_KINDS_TYPES
98-
#:for k2, t2 in REAL_KINDS_TYPES
98+
#:for k2, t2 in R_KINDS_TYPES
9999
module procedure ingamma_up_${t1[0]}$${k1}$${k2}$
100100
#:endfor
101101
#:endfor
102102

103-
#:for k1, t1 in REAL_KINDS_TYPES
103+
#:for k1, t1 in R_KINDS_TYPES
104104
module procedure ingamma_up_${t1[0]}$${k1}$
105105
#:endfor
106106
end interface upper_incomplete_gamma
@@ -111,12 +111,12 @@ module stdlib_specialfunctions_gamma
111111
!! Logarithm of upper incomplete gamma function
112112
!!
113113
#:for k1, t1 in INT_KINDS_TYPES
114-
#:for k2, t2 in REAL_KINDS_TYPES
114+
#:for k2, t2 in R_KINDS_TYPES
115115
module procedure l_ingamma_up_${t1[0]}$${k1}$${k2}$
116116
#:endfor
117117
#:endfor
118118

119-
#:for k1, t1 in REAL_KINDS_TYPES
119+
#:for k1, t1 in R_KINDS_TYPES
120120
module procedure l_ingamma_up_${t1[0]}$${k1}$
121121
#:endfor
122122
end interface log_upper_incomplete_gamma
@@ -127,12 +127,12 @@ module stdlib_specialfunctions_gamma
127127
!! Regularized (normalized) lower incomplete gamma function, P
128128
!!
129129
#:for k1, t1 in INT_KINDS_TYPES
130-
#:for k2, t2 in REAL_KINDS_TYPES
130+
#:for k2, t2 in R_KINDS_TYPES
131131
module procedure regamma_p_${t1[0]}$${k1}$${k2}$
132132
#:endfor
133133
#:endfor
134134

135-
#:for k1, t1 in REAL_KINDS_TYPES
135+
#:for k1, t1 in R_KINDS_TYPES
136136
module procedure regamma_p_${t1[0]}$${k1}$
137137
#:endfor
138138
end interface regularized_gamma_p
@@ -143,12 +143,12 @@ module stdlib_specialfunctions_gamma
143143
!! Regularized (normalized) upper incomplete gamma function, Q
144144
!!
145145
#:for k1, t1 in INT_KINDS_TYPES
146-
#:for k2, t2 in REAL_KINDS_TYPES
146+
#:for k2, t2 in R_KINDS_TYPES
147147
module procedure regamma_q_${t1[0]}$${k1}$${k2}$
148148
#:endfor
149149
#:endfor
150150

151-
#:for k1, t1 in REAL_KINDS_TYPES
151+
#:for k1, t1 in R_KINDS_TYPES
152152
module procedure regamma_q_${t1[0]}$${k1}$
153153
#:endfor
154154
end interface regularized_gamma_q
@@ -159,12 +159,12 @@ module stdlib_specialfunctions_gamma
159159
! Incomplete gamma G function.
160160
! Internal use only
161161
!
162-
#:for k1, t1 in REAL_KINDS_TYPES
162+
#:for k1, t1 in R_KINDS_TYPES
163163
module procedure gpx_${t1[0]}$${k1}$ !for real p and x
164164
#:endfor
165165

166166
#:for k1, t1 in INT_KINDS_TYPES
167-
#:for k2, t2 in REAL_KINDS_TYPES
167+
#:for k2, t2 in R_KINDS_TYPES
168168
module procedure gpx_${t1[0]}$${k1}$${k2}$ !for integer p and real x
169169
#:endfor
170170
#:endfor
@@ -177,7 +177,7 @@ module stdlib_specialfunctions_gamma
177177
! Internal use only
178178
!
179179
#:for k1, t1 in INT_KINDS_TYPES
180-
#:for k2, t2 in REAL_KINDS_TYPES
180+
#:for k2, t2 in R_KINDS_TYPES
181181
module procedure l_gamma_${t1[0]}$${k1}$${k2}$
182182
#:endfor
183183
#:endfor
@@ -218,7 +218,7 @@ contains
218218

219219

220220

221-
#:for k1, t1 in CMPLX_KINDS_TYPES
221+
#:for k1, t1 in C_KINDS_TYPES
222222
#:if k1 == "sp"
223223
#:set k2 = "dp"
224224
#:elif k1 == "dp"
@@ -373,7 +373,7 @@ contains
373373

374374

375375
#:for k1, t1 in INT_KINDS_TYPES
376-
#:for k2, t2 in REAL_KINDS_TYPES
376+
#:for k2, t2 in R_KINDS_TYPES
377377

378378
impure elemental function l_gamma_${t1[0]}$${k1}$${k2}$(z, x) result(res)
379379
!
@@ -414,7 +414,7 @@ contains
414414

415415

416416

417-
#:for k1, t1 in CMPLX_KINDS_TYPES
417+
#:for k1, t1 in C_KINDS_TYPES
418418
#:if k1 == "sp"
419419
#:set k2 = "dp"
420420
#:elif k1 == "dp"
@@ -556,7 +556,7 @@ contains
556556

557557

558558

559-
#:for k1, t1 in REAL_KINDS_TYPES
559+
#:for k1, t1 in R_KINDS_TYPES
560560
#:if k1 == "sp"
561561
#:set k2 = "dp"
562562
#:elif k1 == "dp"
@@ -702,7 +702,7 @@ contains
702702

703703

704704
#:for k1, t1 in INT_KINDS_TYPES
705-
#:for k2, t2 in REAL_KINDS_TYPES
705+
#:for k2, t2 in R_KINDS_TYPES
706706
impure elemental function gpx_${t1[0]}$${k1}$${k2}$(p, x) result(res)
707707
!
708708
! Approximation of incomplete gamma G function with integer argument p.
@@ -841,7 +841,7 @@ contains
841841

842842

843843

844-
#:for k1, t1 in REAL_KINDS_TYPES
844+
#:for k1, t1 in R_KINDS_TYPES
845845
impure elemental function ingamma_low_${t1[0]}$${k1}$(p, x) result(res)
846846
!
847847
! Approximation of lower incomplete gamma function with real p.
@@ -878,7 +878,7 @@ contains
878878

879879

880880
#:for k1, t1 in INT_KINDS_TYPES
881-
#:for k2, t2 in REAL_KINDS_TYPES
881+
#:for k2, t2 in R_KINDS_TYPES
882882
impure elemental function ingamma_low_${t1[0]}$${k1}$${k2}$(p, x) &
883883
result(res)
884884
!
@@ -918,7 +918,7 @@ contains
918918

919919

920920

921-
#:for k1, t1 in REAL_KINDS_TYPES
921+
#:for k1, t1 in R_KINDS_TYPES
922922
impure elemental function l_ingamma_low_${t1[0]}$${k1}$(p, x) result(res)
923923

924924
${t1}$, intent(in) :: p, x
@@ -955,7 +955,7 @@ contains
955955

956956

957957
#:for k1, t1 in INT_KINDS_TYPES
958-
#:for k2, t2 in REAL_KINDS_TYPES
958+
#:for k2, t2 in R_KINDS_TYPES
959959
impure elemental function l_ingamma_low_${t1[0]}$${k1}$${k2}$(p, x) &
960960
result(res)
961961

@@ -987,7 +987,7 @@ contains
987987

988988

989989

990-
#:for k1, t1 in REAL_KINDS_TYPES
990+
#:for k1, t1 in R_KINDS_TYPES
991991
impure elemental function ingamma_up_${t1[0]}$${k1}$(p, x) result(res)
992992
!
993993
! Approximation of upper incomplete gamma function with real p.
@@ -1025,7 +1025,7 @@ contains
10251025

10261026

10271027
#:for k1, t1 in INT_KINDS_TYPES
1028-
#:for k2, t2 in REAL_KINDS_TYPES
1028+
#:for k2, t2 in R_KINDS_TYPES
10291029
impure elemental function ingamma_up_${t1[0]}$${k1}$${k2}$(p, x) &
10301030
result(res)
10311031
!
@@ -1067,7 +1067,7 @@ contains
10671067

10681068

10691069

1070-
#:for k1, t1 in REAL_KINDS_TYPES
1070+
#:for k1, t1 in R_KINDS_TYPES
10711071
impure elemental function l_ingamma_up_${t1[0]}$${k1}$(p, x) result(res)
10721072

10731073
${t1}$, intent(in) :: p, x
@@ -1105,7 +1105,7 @@ contains
11051105

11061106

11071107
#:for k1, t1 in INT_KINDS_TYPES
1108-
#:for k2, t2 in REAL_KINDS_TYPES
1108+
#:for k2, t2 in R_KINDS_TYPES
11091109
impure elemental function l_ingamma_up_${t1[0]}$${k1}$${k2}$(p, x) &
11101110
result(res)
11111111

@@ -1146,7 +1146,7 @@ contains
11461146

11471147

11481148

1149-
#:for k1, t1 in REAL_KINDS_TYPES
1149+
#:for k1, t1 in R_KINDS_TYPES
11501150
impure elemental function regamma_p_${t1[0]}$${k1}$(p, x) result(res)
11511151
!
11521152
! Approximation of regularized incomplete gamma function P(p,x) for real p
@@ -1181,7 +1181,7 @@ contains
11811181

11821182

11831183
#:for k1, t1 in INT_KINDS_TYPES
1184-
#:for k2, t2 in REAL_KINDS_TYPES
1184+
#:for k2, t2 in R_KINDS_TYPES
11851185
impure elemental function regamma_p_${t1[0]}$${k1}$${k2}$(p, x) result(res)
11861186
!
11871187
! Approximation of regularized incomplete gamma function P(p,x) for integer p
@@ -1217,7 +1217,7 @@ contains
12171217

12181218

12191219

1220-
#:for k1, t1 in REAL_KINDS_TYPES
1220+
#:for k1, t1 in R_KINDS_TYPES
12211221
impure elemental function regamma_q_${t1[0]}$${k1}$(p, x) result(res)
12221222
!
12231223
! Approximation of regularized incomplete gamma function Q(p,x) for real p
@@ -1252,7 +1252,7 @@ contains
12521252

12531253

12541254
#:for k1, t1 in INT_KINDS_TYPES
1255-
#:for k2, t2 in REAL_KINDS_TYPES
1255+
#:for k2, t2 in R_KINDS_TYPES
12561256
impure elemental function regamma_q_${t1[0]}$${k1}$${k2}$(p, x) result(res)
12571257
!
12581258
! Approximation of regularized incomplet gamma function Q(p,x) for integer p

0 commit comments

Comments
 (0)