ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
test_pm_mathCumSum.F90
Go to the documentation of this file.
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3!!!! !!!!
4!!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5!!!! !!!!
6!!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7!!!! !!!!
8!!!! This file is part of the ParaMonte library. !!!!
9!!!! !!!!
10!!!! LICENSE !!!!
11!!!! !!!!
12!!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13!!!! !!!!
14!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
24
25!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26
28
29 use pm_mathCumSum ! LCOV_EXCL_LINE
30 use pm_err, only: err_type
31 use pm_test, only: test_type, LK
32 use pm_kind, only: LK
33 implicit none
34
35 private
36 public :: setTest
37 type(test_type) :: test
38
39!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40
41 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42
43 interface
44#if IK5_ENABLED
45 module function test_getCumSum_IK5() result(assertion); logical(LK) :: assertion; end function
46#endif
47#if IK4_ENABLED
48 module function test_getCumSum_IK4() result(assertion); logical(LK) :: assertion; end function
49#endif
50#if IK3_ENABLED
51 module function test_getCumSum_IK3() result(assertion); logical(LK) :: assertion; end function
52#endif
53#if IK2_ENABLED
54 module function test_getCumSum_IK2() result(assertion); logical(LK) :: assertion; end function
55#endif
56#if IK1_ENABLED
57 module function test_getCumSum_IK1() result(assertion); logical(LK) :: assertion; end function
58#endif
59 end interface
60
61 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62
63 interface
64#if CK5_ENABLED
65 module function test_getCumSum_CK5() result(assertion); logical(LK) :: assertion; end function
66#endif
67#if CK4_ENABLED
68 module function test_getCumSum_CK4() result(assertion); logical(LK) :: assertion; end function
69#endif
70#if CK3_ENABLED
71 module function test_getCumSum_CK3() result(assertion); logical(LK) :: assertion; end function
72#endif
73#if CK2_ENABLED
74 module function test_getCumSum_CK2() result(assertion); logical(LK) :: assertion; end function
75#endif
76#if CK1_ENABLED
77 module function test_getCumSum_CK1() result(assertion); logical(LK) :: assertion; end function
78#endif
79 end interface
80
81 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82
83 interface
84#if RK5_ENABLED
85 module function test_getCumSum_RK5() result(assertion); logical(LK) :: assertion; end function
86#endif
87#if RK4_ENABLED
88 module function test_getCumSum_RK4() result(assertion); logical(LK) :: assertion; end function
89#endif
90#if RK3_ENABLED
91 module function test_getCumSum_RK3() result(assertion); logical(LK) :: assertion; end function
92#endif
93#if RK2_ENABLED
94 module function test_getCumSum_RK2() result(assertion); logical(LK) :: assertion; end function
95#endif
96#if RK1_ENABLED
97 module function test_getCumSum_RK1() result(assertion); logical(LK) :: assertion; end function
98#endif
99 end interface
100
101 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
102
103!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
104
105 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
106
107 interface
108#if IK5_ENABLED
109 module function test_setCumSum_IK5() result(assertion); logical(LK) :: assertion; end function
110#endif
111#if IK4_ENABLED
112 module function test_setCumSum_IK4() result(assertion); logical(LK) :: assertion; end function
113#endif
114#if IK3_ENABLED
115 module function test_setCumSum_IK3() result(assertion); logical(LK) :: assertion; end function
116#endif
117#if IK2_ENABLED
118 module function test_setCumSum_IK2() result(assertion); logical(LK) :: assertion; end function
119#endif
120#if IK1_ENABLED
121 module function test_setCumSum_IK1() result(assertion); logical(LK) :: assertion; end function
122#endif
123 end interface
124
125 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
126
127 interface
128#if CK5_ENABLED
129 module function test_setCumSum_CK5() result(assertion); logical(LK) :: assertion; end function
130#endif
131#if CK4_ENABLED
132 module function test_setCumSum_CK4() result(assertion); logical(LK) :: assertion; end function
133#endif
134#if CK3_ENABLED
135 module function test_setCumSum_CK3() result(assertion); logical(LK) :: assertion; end function
136#endif
137#if CK2_ENABLED
138 module function test_setCumSum_CK2() result(assertion); logical(LK) :: assertion; end function
139#endif
140#if CK1_ENABLED
141 module function test_setCumSum_CK1() result(assertion); logical(LK) :: assertion; end function
142#endif
143 end interface
144
145 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
146
147 interface
148#if RK5_ENABLED
149 module function test_setCumSum_RK5() result(assertion); logical(LK) :: assertion; end function
150#endif
151#if RK4_ENABLED
152 module function test_setCumSum_RK4() result(assertion); logical(LK) :: assertion; end function
153#endif
154#if RK3_ENABLED
155 module function test_setCumSum_RK3() result(assertion); logical(LK) :: assertion; end function
156#endif
157#if RK2_ENABLED
158 module function test_setCumSum_RK2() result(assertion); logical(LK) :: assertion; end function
159#endif
160#if RK1_ENABLED
161 module function test_setCumSum_RK1() result(assertion); logical(LK) :: assertion; end function
162#endif
163 end interface
164
165 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
166
167!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
168
169contains
170
171!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
172
173 subroutine setTest()
174
176
177 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
178
179 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
180
181#if IK5_ENABLED
182 call test%run(test_getCumSum_IK5, SK_"test_getCumSum_IK5")
183#endif
184#if IK4_ENABLED
185 call test%run(test_getCumSum_IK4, SK_"test_getCumSum_IK4")
186#endif
187#if IK3_ENABLED
188 call test%run(test_getCumSum_IK3, SK_"test_getCumSum_IK3")
189#endif
190#if IK2_ENABLED
191 call test%run(test_getCumSum_IK2, SK_"test_getCumSum_IK2")
192#endif
193#if IK1_ENABLED
194 call test%run(test_getCumSum_IK1, SK_"test_getCumSum_IK1")
195#endif
196
197 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
198
199#if CK5_ENABLED
200 call test%run(test_getCumSum_CK5, SK_"test_getCumSum_CK5")
201#endif
202#if CK4_ENABLED
203 call test%run(test_getCumSum_CK4, SK_"test_getCumSum_CK4")
204#endif
205#if CK3_ENABLED
206 call test%run(test_getCumSum_CK3, SK_"test_getCumSum_CK3")
207#endif
208#if CK2_ENABLED
209 call test%run(test_getCumSum_CK2, SK_"test_getCumSum_CK2")
210#endif
211#if CK1_ENABLED
212 call test%run(test_getCumSum_CK1, SK_"test_getCumSum_CK1")
213#endif
214
215 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216
217#if RK5_ENABLED
218 call test%run(test_getCumSum_RK5, SK_"test_getCumSum_RK5")
219#endif
220#if RK4_ENABLED
221 call test%run(test_getCumSum_RK4, SK_"test_getCumSum_RK4")
222#endif
223#if RK3_ENABLED
224 call test%run(test_getCumSum_RK3, SK_"test_getCumSum_RK3")
225#endif
226#if RK2_ENABLED
227 call test%run(test_getCumSum_RK2, SK_"test_getCumSum_RK2")
228#endif
229#if RK1_ENABLED
230 call test%run(test_getCumSum_RK1, SK_"test_getCumSum_RK1")
231#endif
232
233 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
234
235!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
236
237 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238
239#if IK5_ENABLED
240 call test%run(test_setCumSum_IK5, SK_"test_setCumSum_IK5")
241#endif
242#if IK4_ENABLED
243 call test%run(test_setCumSum_IK4, SK_"test_setCumSum_IK4")
244#endif
245#if IK3_ENABLED
246 call test%run(test_setCumSum_IK3, SK_"test_setCumSum_IK3")
247#endif
248#if IK2_ENABLED
249 call test%run(test_setCumSum_IK2, SK_"test_setCumSum_IK2")
250#endif
251#if IK1_ENABLED
252 call test%run(test_setCumSum_IK1, SK_"test_setCumSum_IK1")
253#endif
254
255 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
256
257#if CK5_ENABLED
258 call test%run(test_setCumSum_CK5, SK_"test_setCumSum_CK5")
259#endif
260#if CK4_ENABLED
261 call test%run(test_setCumSum_CK4, SK_"test_setCumSum_CK4")
262#endif
263#if CK3_ENABLED
264 call test%run(test_setCumSum_CK3, SK_"test_setCumSum_CK3")
265#endif
266#if CK2_ENABLED
267 call test%run(test_setCumSum_CK2, SK_"test_setCumSum_CK2")
268#endif
269#if CK1_ENABLED
270 call test%run(test_setCumSum_CK1, SK_"test_setCumSum_CK1")
271#endif
272
273 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
274
275#if RK5_ENABLED
276 call test%run(test_setCumSum_RK5, SK_"test_setCumSum_RK5")
277#endif
278#if RK4_ENABLED
279 call test%run(test_setCumSum_RK4, SK_"test_setCumSum_RK4")
280#endif
281#if RK3_ENABLED
282 call test%run(test_setCumSum_RK3, SK_"test_setCumSum_RK3")
283#endif
284#if RK2_ENABLED
285 call test%run(test_setCumSum_RK2, SK_"test_setCumSum_RK2")
286#endif
287#if RK1_ENABLED
288 call test%run(test_setCumSum_RK1, SK_"test_setCumSum_RK1")
289#endif
290
291 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
292
293!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
294
295 call test%summarize()
296
297 end subroutine setTest
298
299end module test_pm_mathCumSum ! LCOV_EXCL_LINE
This module contains classes and procedures for reporting and handling errors.
Definition: pm_err.F90:52
character(*, SK), parameter MODULE_NAME
Definition: pm_err.F90:58
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
This module contains the procedures and interfaces for computing the cumulative sum of an array.
This module contains a simple unit-testing framework for the Fortran libraries, including the ParaMon...
Definition: pm_test.F90:42
This module contains tests of the module pm_mathCumSum.
This is the derived type for generating objects to gracefully and verbosely handle runtime unexpected...
Definition: pm_err.F90:157
This is the derived type test_type for generating objects that facilitate testing of a series of proc...
Definition: pm_test.F90:209