Return evenly spaced integer
or character
sequence starting at start
with jump sizes of step
.
The value of the last element of the output array is determined by the size of the array: range(size(range)) = start + step * (size(range) - 1)
.
If range
is of type character
, then replace size
with len
in the above formula.
- Parameters
-
[out] | range | : The output sequence that can be,
-
a scalar
character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) of length type parameter 1 ,
-
a
contiguous array of rank 1 of type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64),
containing the evenly-spaced sequence within the interval starting with start and with jumps of size step .
|
[in] | stop | : The input scalar of the same type and kind as start representing the end point of the output range .
If stop is of type character , then it must be of length type parameter 1 .
|
[in] | step | : The non-zero input scalar of type integer representing the size of the interval between adjacent values in the output range .
-
If
range is of type character , then step must have the default integer kind IK.
-
If
range is of type integer , then step must have the same type kind parameter as range .
(optional, default = 1 ) |
Possible calling interfaces ⛓
Return evenly spaced integer or character sequence starting at start with jump sizes of step.
This module contains procedures and generic interfaces for generating ranges of discrete character,...
- Warning
- The condition
step /= 0
must hold for the corresponding input arguments.
The condition len(start) == 1
must hold for the corresponding input character
arguments.
These conditions are verified only if the library is built with the preprocessor macro CHECK_ENABLED=1
.
-
The
pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.
By default, these procedures are pure
in release
build and impure
in debug
and testing
builds.
- See also
- getRange
setRange
getLinSpace
setLinSpace
getLogSpace
setLogSpace
Example usage ⛓
10 type(display_type) :: disp
25 call disp%show(
"call setRange(range, 0.)")
34 call disp%show(
"call setRange(range, 1.)")
43 call disp%show(
"call setRange(range, -huge(1.))")
52 call disp%show(
"call setRange(range, 0., -2.5)")
61 call disp%show(
"call setRange(range, 0., +2.5)")
78 call disp%show(
"call setRange(range, 'A')")
85 call disp%show(
"call setRange(range, 'A', 2)")
92 call disp%show(
"call setRange(range, 'A', 3)")
99 call disp%show(
"call setRange(range, 'A', 3)")
106 call disp%show(
"call setRange(range, 'Z', -2)")
122 call disp%show(
"call setRange(range, 0)")
129 call disp%show(
"call setRange(range, 0, 2)")
136 call disp%show(
"call setRange(range, 0, 3)")
143 call disp%show(
"call setRange(range, 0, 3)")
150 call disp%show(
"call setRange(range, 0, -2)")
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
11+0.00000000,
+0.140129846E-44,
+0.280259693E-44,
+0.420389539E-44,
+0.560519386E-44,
+0.700649232E-44,
+0.840779079E-44,
+0.980908925E-44,
+0.112103877E-43,
+0.126116862E-43
18+1.00000000,
+1.00000012,
+1.00000024,
+1.00000036,
+1.00000048,
+1.00000060,
+1.00000072,
+1.00000083,
+1.00000095,
+1.00000107
25-0.340282347E+39,
-0.340282326E+39,
-0.340282306E+39,
-0.340282286E+39,
-0.340282266E+39,
-0.340282245E+39,
-0.340282225E+39,
-0.340282205E+39,
-0.340282184E+39,
-0.340282164E+39
32+0.00000000,
-2.50000000,
-5.00000000,
-7.50000000,
-10.0000000,
-12.5000000,
-15.0000000,
-17.5000000,
-20.0000000,
-22.5000000
39+0.00000000,
+2.50000000,
+5.00000000,
+7.50000000,
+10.0000000,
+12.5000000,
+15.0000000,
+17.5000000,
+20.0000000,
+22.5000000
- Test:
- test_pm_arrayRange
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
- Copyright
- Computational Data Science Lab
- Author:
- Fatemeh Bagheri, Tuesday 08:49 PM, August 10, 2021, Dallas, TX
Definition at line 695 of file pm_arrayRange.F90.