ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_mathRound.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
27
28!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29
31
32 use pm_kind, only: SK, IK
34
35 implicit none
36
37 character(*, SK), parameter :: MODULE_NAME = "@pm_mathRound"
38
39!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40
99 interface pnint
100
101 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
102
103#if RK5_ENABLED
104 impure elemental module function pnint_RNGD_IKD_RK5(val) result(whole)
105#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
106 !DEC$ ATTRIBUTES DLLEXPORT :: pnint_RNGD_IKD_RK5
107#endif
108 use pm_kind, only: IKG => IK, RKG => RK5
109 real(RKG) , intent(in) :: val
110 integer(IKG) :: whole
111 end function
112#endif
113
114#if RK4_ENABLED
115 impure elemental module function pnint_RNGD_IKD_RK4(val) result(whole)
116#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
117 !DEC$ ATTRIBUTES DLLEXPORT :: pnint_RNGD_IKD_RK4
118#endif
119 use pm_kind, only: IKG => IK, RKG => RK4
120 real(RKG) , intent(in) :: val
121 integer(IKG) :: whole
122 end function
123#endif
124
125#if RK3_ENABLED
126 impure elemental module function pnint_RNGD_IKD_RK3(val) result(whole)
127#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
128 !DEC$ ATTRIBUTES DLLEXPORT :: pnint_RNGD_IKD_RK3
129#endif
130 use pm_kind, only: IKG => IK, RKG => RK3
131 real(RKG) , intent(in) :: val
132 integer(IKG) :: whole
133 end function
134#endif
135
136#if RK2_ENABLED
137 impure elemental module function pnint_RNGD_IKD_RK2(val) result(whole)
138#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
139 !DEC$ ATTRIBUTES DLLEXPORT :: pnint_RNGD_IKD_RK2
140#endif
141 use pm_kind, only: IKG => IK, RKG => RK2
142 real(RKG) , intent(in) :: val
143 integer(IKG) :: whole
144 end function
145#endif
146
147#if RK1_ENABLED
148 impure elemental module function pnint_RNGD_IKD_RK1(val) result(whole)
149#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
150 !DEC$ ATTRIBUTES DLLEXPORT :: pnint_RNGD_IKD_RK1
151#endif
152 use pm_kind, only: IKG => IK, RKG => RK1
153 real(RKG) , intent(in) :: val
154 integer(IKG) :: whole
155 end function
156#endif
157
158 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
159
160#if RK5_ENABLED
161 impure elemental module function pnint_RNGX_IKD_RK5(rng, val) result(whole)
162#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
163 !DEC$ ATTRIBUTES DLLEXPORT :: pnint_RNGX_IKD_RK5
164#endif
165 use pm_kind, only: IKG => IK, RKG => RK5
166 type(xoshiro256ssw_type), intent(inout) :: rng
167 real(RKG) , intent(in) :: val
168 integer(IKG) :: whole
169 end function
170#endif
171
172#if RK4_ENABLED
173 impure elemental module function pnint_RNGX_IKD_RK4(rng, val) result(whole)
174#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
175 !DEC$ ATTRIBUTES DLLEXPORT :: pnint_RNGX_IKD_RK4
176#endif
177 use pm_kind, only: IKG => IK, RKG => RK4
178 type(xoshiro256ssw_type), intent(inout) :: rng
179 real(RKG) , intent(in) :: val
180 integer(IKG) :: whole
181 end function
182#endif
183
184#if RK3_ENABLED
185 impure elemental module function pnint_RNGX_IKD_RK3(rng, val) result(whole)
186#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
187 !DEC$ ATTRIBUTES DLLEXPORT :: pnint_RNGX_IKD_RK3
188#endif
189 use pm_kind, only: IKG => IK, RKG => RK3
190 type(xoshiro256ssw_type), intent(inout) :: rng
191 real(RKG) , intent(in) :: val
192 integer(IKG) :: whole
193 end function
194#endif
195
196#if RK2_ENABLED
197 impure elemental module function pnint_RNGX_IKD_RK2(rng, val) result(whole)
198#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
199 !DEC$ ATTRIBUTES DLLEXPORT :: pnint_RNGX_IKD_RK2
200#endif
201 use pm_kind, only: IKG => IK, RKG => RK2
202 type(xoshiro256ssw_type), intent(inout) :: rng
203 real(RKG) , intent(in) :: val
204 integer(IKG) :: whole
205 end function
206#endif
207
208#if RK1_ENABLED
209 impure elemental module function pnint_RNGX_IKD_RK1(rng, val) result(whole)
210#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
211 !DEC$ ATTRIBUTES DLLEXPORT :: pnint_RNGX_IKD_RK1
212#endif
213 use pm_kind, only: IKG => IK, RKG => RK1
214 type(xoshiro256ssw_type), intent(inout) :: rng
215 real(RKG) , intent(in) :: val
216 integer(IKG) :: whole
217 end function
218#endif
219
220 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
221
222 end interface
223
224!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
225
226end module pm_mathRound
Generate and return the probabilistically-rounded to the nearest integer value of the input real numb...
This module contains classes and procedures for computing various statistical quantities related to t...
character(*, SK), parameter MODULE_NAME
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter RK5
Definition: pm_kind.F90:478
integer, parameter RK4
Definition: pm_kind.F90:489
integer, parameter RK2
Definition: pm_kind.F90:511
integer, parameter RK3
Definition: pm_kind.F90:500
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
integer, parameter RK1
Definition: pm_kind.F90:522
This module contains procedures and generic interfaces for rounding real values to whole integers.
This is the derived type for declaring and generating objects of type xoshiro256ssw_type containing a...