ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_arrayChoice::setChoice Interface Reference

Select a single (or multiple) element(s) from the input array of intrinsic type of arbitrary kind randomly uniformly or optionally according to the specified Probability Mass Function (PMF) of the input array.
More...

Detailed Description

Select a single (or multiple) element(s) from the input array of intrinsic type of arbitrary kind randomly uniformly or optionally according to the specified Probability Mass Function (PMF) of the input array.

Parameters
[in,out]rng: The input/output scalar that can be an object of,
  1. type rngf_type, implying the use of intrinsic Fortran uniform RNG.
  2. type xoshiro256ssw_type, implying the use of xoshiro256** uniform RNG.
[out]choice: The output scalar or vector of the same type and kind as the input array whose value is randomly selected from the elements of array.
[in]array: The input contiguous array of non-zero size of shape (:) of either
  1. type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU), or
  2. type logical of kind any supported by the processor (e.g., LK), or
  3. type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64), or
  4. type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128), or
  5. type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
or a scalar of,
  1. type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) of non-zero length,
  2. type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64) of non-zero value,
whose element(s) will be selected randomly and returned in the output choice.
The input array must be of non-zero length or size (unless it is a scalar non-negative integer of arbitrary kind).
[in]unique: The input scalar logical of default kind LK.
If .true., the elements of the output choice will be uniquely selected from the input array.
If .true., the size/length of the output choice must be larger than or equal to the size/length of the input array, otherwise, unique selection impossible.
(optional, default = .false._LK. It can be present if and only if the input argument is array-like (i.e., either scalar character or vector).)


Possible calling interfaces

call setChoice(rng, choice, array) ! `choice` is a scalar.
call setChoice(rng, choice, array, unique = unique) ! `choice` is array-like (sliceable, e.g., vector, or a scalar `character`) and longer than or equal-length to `array`.
!
Select a single (or multiple) element(s) from the input array of intrinsic type of arbitrary kind ran...
This module contains procedures and generic interfaces for selecting uniformly-distributed or arbitra...
Warning
The condition 0 < size(array) for non-character input array or 0 < len(array) for character input array must hold.
The condition len(choice) == len(array) for an input choice vector of character must hold.
These conditions are verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
See also
isHead
getChange
setChange
getChoice
setChoice
getUnifRand
setUnifRand
getShuffled
setShuffled
getRemapped
setRemapped


Example usage

1program example
2
3 use pm_kind, only: LK ! All kinds are supported.
4 use pm_kind, only: SK ! All kinds are supported.
5 use pm_kind, only: IK ! All kinds are supported.
6 use pm_kind, only: CK ! All kinds are supported.
7 use pm_kind, only: RK ! All kinds are supported.
8 use pm_io, only: display_type
9 use pm_arrayRange, only: getRange
10 use pm_distUnif, only: getUnifRand
11 use pm_arrayResize, only: setResized
14
15 implicit none
16
17 type(display_type) :: disp
18 integer(IK) :: count, itry, ntry = 10
19 type(xoshiro256ssw_type) :: rng
20 disp = display_type(file = "main.out.F90")
21 rng = xoshiro256ssw_type()
22
23 block
24 character(:), allocatable :: choice, array
25 do itry = 1, ntry
26
27 call disp%skip
28 call disp%show("count = getUnifRand(4, 10)")
29 count = getUnifRand(4, 10)
30 call disp%show("array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.")
31 array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
32 call disp%show("array")
33 call disp%show( array, deliml = SK_"""" )
34 call disp%show("call setResized(choice, 1)")
35 call setResized(choice, 1)
36 call disp%show("call setChoice(rng, choice, array)")
37 call setChoice(rng, choice, array)
38 call disp%show("choice")
39 call disp%show( choice, deliml = SK_"""" )
40 call disp%show("count = getUnifRand(1, 2 * len(array))")
41 count = getUnifRand(1, 2 * len(array))
42 call disp%show("count")
43 call disp%show( count )
44 call disp%show("call setResized(choice, count)")
45 call setResized(choice, count)
46 call disp%show("call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.")
47 call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
48 call disp%show("choice")
49 call disp%show( choice, deliml = SK_"""" )
50 call disp%show("count = getUnifRand(1, len(array))")
51 count = getUnifRand(1, len(array))
52 call disp%show("count")
53 call disp%show( count )
54 call disp%show("call setResized(choice, count)")
55 call setResized(choice, count)
56 call disp%show("call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.")
57 call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
58 call disp%show("choice")
59 call disp%show( choice, deliml = SK_"""" )
60
61 end do
62 end block
63
64 block
65 character(2), allocatable :: choice(:), array(:)
66 do itry = 1, ntry
67
68 call disp%skip
69 call disp%show("count = getUnifRand(4, 10)")
70 count = getUnifRand(4, 10)
71 call disp%show("array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.")
72 array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
73 call disp%show("array")
74 call disp%show( array, deliml = SK_"""" )
75 call disp%show("call setResized(choice, 1)")
76 call setResized(choice, 1)
77 call disp%show("choice = [getChoice(array)]")
78 choice = [getChoice(array)]
79 call disp%show("choice")
80 call disp%show( choice, deliml = SK_"""" )
81 call disp%show("count = getUnifRand(1, len(array))")
82 count = getUnifRand(1, len(array))
83 call disp%show("count")
84 call disp%show( count )
85 call disp%show("call setResized(choice, count)")
86 call setResized(choice, count)
87 call disp%show("call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.")
88 call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
89 call disp%show("choice")
90 call disp%show( choice, deliml = SK_"""" )
91 call disp%show("count = getUnifRand(1, size(array))")
92 count = getUnifRand(1, size(array))
93 call disp%show("count")
94 call disp%show( count )
95 call disp%show("call setResized(choice, count)")
96 call setResized(choice, count)
97 call disp%show("call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.")
98 call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
99 call disp%show("choice")
100 call disp%show( choice, deliml = SK_"""" )
101
102 end do
103 end block
104
105 block
106 integer, allocatable :: choice(:), array(:)
107 do itry = 1, ntry
108
109 call disp%skip
110 call disp%show("array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.")
111 array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
112 call disp%show("array")
113 call disp%show( array )
114 call disp%show("call setResized(choice, 1)")
115 call setResized(choice, 1)
116 call disp%show("choice = [getChoice(array)]")
117 choice = [getChoice(array)]
118 call disp%show("choice")
119 call disp%show( choice )
120 call disp%show("count = getUnifRand(1, 2 * size(array))")
121 count = getUnifRand(1, 2 * size(array))
122 call disp%show("count")
123 call disp%show( count )
124 call disp%show("call setResized(choice, count)")
125 call setResized(choice, count)
126 call disp%show("call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.")
127 call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
128 call disp%show("choice")
129 call disp%show( choice )
130 call disp%show("count = getUnifRand(1, size(array))")
131 count = getUnifRand(1, size(array))
132 call disp%show("count")
133 call disp%show( count )
134 call disp%show("call setResized(choice, count)")
135 call setResized(choice, count)
136 call disp%show("call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.")
137 call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
138 call disp%show("choice")
139 call disp%show( choice )
140
141 end do
142 end block
143
144 block
145 logical, allocatable :: choice(:), array(:)
146 do itry = 1, ntry
147
148 call disp%skip
149 call disp%show("array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.")
150 array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
151 call disp%show("array")
152 call disp%show( array )
153 call disp%show("call setResized(choice, 1)")
154 call setResized(choice, 1)
155 call disp%show("choice = [getChoice(array)]")
156 choice = [getChoice(array)]
157 call disp%show("choice")
158 call disp%show( choice )
159 call disp%show("count = getUnifRand(1, 2 * size(array))")
160 count = getUnifRand(1, 2 * size(array))
161 call disp%show("count")
162 call disp%show( count )
163 call disp%show("call setResized(choice, count)")
164 call setResized(choice, count)
165 call disp%show("call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.")
166 call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
167 call disp%show("choice")
168 call disp%show( choice )
169 call disp%show("count = getUnifRand(1, size(array))")
170 count = getUnifRand(1, size(array))
171 call disp%show("count")
172 call disp%show( count )
173 call disp%show("call setResized(choice, count)")
174 call setResized(choice, count)
175 call disp%show("call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.")
176 call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
177 call disp%show("choice")
178 call disp%show( choice )
179
180 end do
181 end block
182
183 block
184 complex, allocatable :: choice(:), array(:)
185 do itry = 1, ntry
186
187 call disp%skip
188 call disp%show("array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.")
189 array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
190 call disp%show("array")
191 call disp%show( array )
192 call disp%show("call setResized(choice, 1)")
193 call setResized(choice, 1)
194 call disp%show("choice = [getChoice(array)]")
195 choice = [getChoice(array)]
196 call disp%show("choice")
197 call disp%show( choice )
198 call disp%show("count = getUnifRand(1, 2 * size(array))")
199 count = getUnifRand(1, 2 * size(array))
200 call disp%show("count")
201 call disp%show( count )
202 call disp%show("call setResized(choice, count)")
203 call setResized(choice, count)
204 call disp%show("call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.")
205 call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
206 call disp%show("choice")
207 call disp%show( choice )
208 call disp%show("count = getUnifRand(1, size(array))")
209 count = getUnifRand(1, size(array))
210 call disp%show("count")
211 call disp%show( count )
212 call disp%show("call setResized(choice, count)")
213 call setResized(choice, count)
214 call disp%show("call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.")
215 call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
216 call disp%show("choice")
217 call disp%show( choice )
218
219 end do
220 end block
221
222 block
223 real, allocatable :: choice(:), array(:)
224 do itry = 1, ntry
225
226 call disp%skip
227 call disp%show("array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.")
228 array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
229 call disp%show("array")
230 call disp%show( array )
231 call disp%show("call setResized(choice, 1)")
232 call setResized(choice, 1)
233 call disp%show("choice = [getChoice(array)]")
234 choice = [getChoice(array)]
235 call disp%show("choice")
236 call disp%show( choice )
237 call disp%show("count = getUnifRand(1, 2 * size(array))")
238 count = getUnifRand(1, 2 * size(array))
239 call disp%show("count")
240 call disp%show( count )
241 call disp%show("call setResized(choice, count)")
242 call setResized(choice, count)
243 call disp%show("call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.")
244 call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
245 call disp%show("choice")
246 call disp%show( choice )
247 call disp%show("count = getUnifRand(1, size(array))")
248 count = getUnifRand(1, size(array))
249 call disp%show("count")
250 call disp%show( count )
251 call disp%show("call setResized(choice, count)")
252 call setResized(choice, count)
253 call disp%show("call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.")
254 call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
255 call disp%show("choice")
256 call disp%show( choice )
257
258 end do
259 end block
260
261end program example
Select a single (or multiple) element(s) from the input array of intrinsic type of arbitrary kind ran...
Generate minimally-spaced character, integer, real sequences or sequences at fixed intervals of size ...
Allocate or resize (shrink or expand) an input allocatable scalar string or array of rank 1....
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
This module contains procedures and generic interfaces for generating ranges of discrete character,...
This module contains procedures and generic interfaces for resizing allocatable arrays of various typ...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
Definition: pm_kind.F90:543
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter CK
The default complex kind in the ParaMonte library: real64 in Fortran, c_double_complex in C-Fortran I...
Definition: pm_kind.F90:542
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
This is the derived type for declaring and generating objects of type xoshiro256ssw_type containing a...
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2count = getUnifRand(4, 10)
3array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
4array
5"QDHJBRR"
6call setResized(choice, 1)
7call setChoice(rng, choice, array)
8choice
9"R"
10count = getUnifRand(1, 2 * len(array))
11count
12+8
13call setResized(choice, count)
14call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
15choice
16"JDRHQRRB"
17count = getUnifRand(1, len(array))
18count
19+4
20call setResized(choice, count)
21call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
22choice
23"BRQH"
24
25count = getUnifRand(4, 10)
26array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
27array
28"NFQJPM"
29call setResized(choice, 1)
30call setChoice(rng, choice, array)
31choice
32"P"
33count = getUnifRand(1, 2 * len(array))
34count
35+7
36call setResized(choice, count)
37call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
38choice
39"QJFJFQM"
40count = getUnifRand(1, len(array))
41count
42+3
43call setResized(choice, count)
44call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
45choice
46"PJN"
47
48count = getUnifRand(4, 10)
49array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
50array
51"OEKPD"
52call setResized(choice, 1)
53call setChoice(rng, choice, array)
54choice
55"P"
56count = getUnifRand(1, 2 * len(array))
57count
58+5
59call setResized(choice, count)
60call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
61choice
62"EKPDD"
63count = getUnifRand(1, len(array))
64count
65+1
66call setResized(choice, count)
67call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
68choice
69"D"
70
71count = getUnifRand(4, 10)
72array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
73array
74"DGVIGCEFJ"
75call setResized(choice, 1)
76call setChoice(rng, choice, array)
77choice
78"G"
79count = getUnifRand(1, 2 * len(array))
80count
81+13
82call setResized(choice, count)
83call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
84choice
85"VDGJGJCGGDDFG"
86count = getUnifRand(1, len(array))
87count
88+3
89call setResized(choice, count)
90call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
91choice
92"GJE"
93
94count = getUnifRand(4, 10)
95array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
96array
97"MKLEZKHDFE"
98call setResized(choice, 1)
99call setChoice(rng, choice, array)
100choice
101"K"
102count = getUnifRand(1, 2 * len(array))
103count
104+14
105call setResized(choice, count)
106call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
107choice
108"ZKELDDZLEMDELE"
109count = getUnifRand(1, len(array))
110count
111+1
112call setResized(choice, count)
113call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
114choice
115"Z"
116
117count = getUnifRand(4, 10)
118array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
119array
120"BYMDLWUMHC"
121call setResized(choice, 1)
122call setChoice(rng, choice, array)
123choice
124"B"
125count = getUnifRand(1, 2 * len(array))
126count
127+17
128call setResized(choice, count)
129call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
130choice
131"YBHLDBHHLMMYWLCDC"
132count = getUnifRand(1, len(array))
133count
134+8
135call setResized(choice, count)
136call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
137choice
138"LYMUHBMW"
139
140count = getUnifRand(4, 10)
141array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
142array
143"NZRZSIURG"
144call setResized(choice, 1)
145call setChoice(rng, choice, array)
146choice
147"I"
148count = getUnifRand(1, 2 * len(array))
149count
150+10
151call setResized(choice, count)
152call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
153choice
154"RGUGZURUZZ"
155count = getUnifRand(1, len(array))
156count
157+4
158call setResized(choice, count)
159call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
160choice
161"SRZG"
162
163count = getUnifRand(4, 10)
164array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
165array
166"XKCG"
167call setResized(choice, 1)
168call setChoice(rng, choice, array)
169choice
170"K"
171count = getUnifRand(1, 2 * len(array))
172count
173+8
174call setResized(choice, count)
175call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
176choice
177"GXGCGGXG"
178count = getUnifRand(1, len(array))
179count
180+2
181call setResized(choice, count)
182call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
183choice
184"KC"
185
186count = getUnifRand(4, 10)
187array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
188array
189"MJCAXHFQO"
190call setResized(choice, 1)
191call setChoice(rng, choice, array)
192choice
193"A"
194count = getUnifRand(1, 2 * len(array))
195count
196+4
197call setResized(choice, count)
198call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
199choice
200"XOAM"
201count = getUnifRand(1, len(array))
202count
203+5
204call setResized(choice, count)
205call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
206choice
207"FACXM"
208
209count = getUnifRand(4, 10)
210array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
211array
212"DYZPJLBHCJ"
213call setResized(choice, 1)
214call setChoice(rng, choice, array)
215choice
216"L"
217count = getUnifRand(1, 2 * len(array))
218count
219+1
220call setResized(choice, count)
221call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
222choice
223"J"
224count = getUnifRand(1, len(array))
225count
226+5
227call setResized(choice, count)
228call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
229choice
230"YDCJZ"
231
232count = getUnifRand(4, 10)
233array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
234array
235"JZ", "OS", "BS", "TR", "BL"
236call setResized(choice, 1)
237choice = [getChoice(array)]
238choice
239"TR"
240count = getUnifRand(1, len(array))
241count
242+2
243call setResized(choice, count)
244call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
245choice
246"BL", "BS"
247count = getUnifRand(1, size(array))
248count
249+4
250call setResized(choice, count)
251call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
252choice
253"OS", "BS", "BL", "JZ"
254
255count = getUnifRand(4, 10)
256array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
257array
258"MU", "DG", "BJ", "QC", "OY", "CC", "TK", "UI", "EI"
259call setResized(choice, 1)
260choice = [getChoice(array)]
261choice
262"QC"
263count = getUnifRand(1, len(array))
264count
265+1
266call setResized(choice, count)
267call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
268choice
269"UI"
270count = getUnifRand(1, size(array))
271count
272+5
273call setResized(choice, count)
274call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
275choice
276"EI", "OY", "MU", "CC", "QC"
277
278count = getUnifRand(4, 10)
279array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
280array
281"XW", "GN", "PI", "VM", "RY"
282call setResized(choice, 1)
283choice = [getChoice(array)]
284choice
285"VM"
286count = getUnifRand(1, len(array))
287count
288+1
289call setResized(choice, count)
290call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
291choice
292"PI"
293count = getUnifRand(1, size(array))
294count
295+1
296call setResized(choice, count)
297call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
298choice
299"GN"
300
301count = getUnifRand(4, 10)
302array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
303array
304"BH", "TB", "YK", "PS", "XR", "DC"
305call setResized(choice, 1)
306choice = [getChoice(array)]
307choice
308"YK"
309count = getUnifRand(1, len(array))
310count
311+2
312call setResized(choice, count)
313call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
314choice
315"PS", "XR"
316count = getUnifRand(1, size(array))
317count
318+4
319call setResized(choice, count)
320call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
321choice
322"DC", "BH", "PS", "TB"
323
324count = getUnifRand(4, 10)
325array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
326array
327"XQ", "PO", "OC", "LS", "GI", "PP", "XZ", "PX"
328call setResized(choice, 1)
329choice = [getChoice(array)]
330choice
331"OC"
332count = getUnifRand(1, len(array))
333count
334+2
335call setResized(choice, count)
336call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
337choice
338"OC", "LS"
339count = getUnifRand(1, size(array))
340count
341+2
342call setResized(choice, count)
343call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
344choice
345"GI", "XZ"
346
347count = getUnifRand(4, 10)
348array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
349array
350"AV", "UO", "BX", "BE", "PX", "NJ", "FS"
351call setResized(choice, 1)
352choice = [getChoice(array)]
353choice
354"AV"
355count = getUnifRand(1, len(array))
356count
357+1
358call setResized(choice, count)
359call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
360choice
361"BE"
362count = getUnifRand(1, size(array))
363count
364+2
365call setResized(choice, count)
366call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
367choice
368"BX", "FS"
369
370count = getUnifRand(4, 10)
371array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
372array
373"OK", "WK", "FN", "IA", "WY", "DN", "CW", "OO", "FJ"
374call setResized(choice, 1)
375choice = [getChoice(array)]
376choice
377"OK"
378count = getUnifRand(1, len(array))
379count
380+2
381call setResized(choice, count)
382call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
383choice
384"DN", "WY"
385count = getUnifRand(1, size(array))
386count
387+7
388call setResized(choice, count)
389call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
390choice
391"WK", "DN", "FJ", "FN", "OK", "IA", "OO"
392
393count = getUnifRand(4, 10)
394array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
395array
396"LM", "HR", "XS", "RD", "EO", "AA", "DF"
397call setResized(choice, 1)
398choice = [getChoice(array)]
399choice
400"XS"
401count = getUnifRand(1, len(array))
402count
403+1
404call setResized(choice, count)
405call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
406choice
407"XS"
408count = getUnifRand(1, size(array))
409count
410+2
411call setResized(choice, count)
412call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
413choice
414"LM", "AA"
415
416count = getUnifRand(4, 10)
417array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
418array
419"PG", "KO", "FM", "CC", "PS", "CM"
420call setResized(choice, 1)
421choice = [getChoice(array)]
422choice
423"CC"
424count = getUnifRand(1, len(array))
425count
426+1
427call setResized(choice, count)
428call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
429choice
430"PS"
431count = getUnifRand(1, size(array))
432count
433+6
434call setResized(choice, count)
435call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
436choice
437"FM", "CC", "CM", "KO", "PG", "PS"
438
439count = getUnifRand(4, 10)
440array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
441array
442"IO", "BA", "CA", "FD", "VG", "SP", "JK", "PZ"
443call setResized(choice, 1)
444choice = [getChoice(array)]
445choice
446"BA"
447count = getUnifRand(1, len(array))
448count
449+2
450call setResized(choice, count)
451call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
452choice
453"VG", "CA"
454count = getUnifRand(1, size(array))
455count
456+8
457call setResized(choice, count)
458call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
459choice
460"JK", "VG", "BA", "PZ", "CA", "IO", "SP", "FD"
461
462array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
463array
464+13, +11, +10, +17, +10, +14, +19
465call setResized(choice, 1)
466choice = [getChoice(array)]
467choice
468+11
469count = getUnifRand(1, 2 * size(array))
470count
471+3
472call setResized(choice, count)
473call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
474choice
475+14, +13, +19
476count = getUnifRand(1, size(array))
477count
478+2
479call setResized(choice, count)
480call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
481choice
482+11, +13
483
484array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
485array
486+16, +4, +7, +10, +3, +15, +18, +2, +8
487call setResized(choice, 1)
488choice = [getChoice(array)]
489choice
490+4
491count = getUnifRand(1, 2 * size(array))
492count
493+7
494call setResized(choice, count)
495call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
496choice
497+2, +10, +15, +8, +16, +3, +15
498count = getUnifRand(1, size(array))
499count
500+5
501call setResized(choice, count)
502call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
503choice
504+10, +15, +3, +16, +4
505
506array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
507array
508+4, +4, +19, +4, +12, +19
509call setResized(choice, 1)
510choice = [getChoice(array)]
511choice
512+4
513count = getUnifRand(1, 2 * size(array))
514count
515+4
516call setResized(choice, count)
517call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
518choice
519+4, +19, +19, +12
520count = getUnifRand(1, size(array))
521count
522+6
523call setResized(choice, count)
524call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
525choice
526+4, +19, +4, +4, +19, +12
527
528array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
529array
530+10, +3, +20, +16
531call setResized(choice, 1)
532choice = [getChoice(array)]
533choice
534+3
535count = getUnifRand(1, 2 * size(array))
536count
537+7
538call setResized(choice, count)
539call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
540choice
541+10, +20, +20, +10, +20, +10, +16
542count = getUnifRand(1, size(array))
543count
544+3
545call setResized(choice, count)
546call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
547choice
548+16, +10, +20
549
550array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
551array
552+19, +1, +10, +18, +17, +1, +9, +14, +20, +8
553call setResized(choice, 1)
554choice = [getChoice(array)]
555choice
556+10
557count = getUnifRand(1, 2 * size(array))
558count
559+16
560call setResized(choice, count)
561call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
562choice
563+19, +1, +19, +18, +14, +9, +18, +1, +1, +9, +20, +20, +1, +14, +1, +9
564count = getUnifRand(1, size(array))
565count
566+7
567call setResized(choice, count)
568call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
569choice
570+1, +8, +14, +18, +10, +1, +19
571
572array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
573array
574+8, +17, +10, +1, +15, +4, +15
575call setResized(choice, 1)
576choice = [getChoice(array)]
577choice
578+10
579count = getUnifRand(1, 2 * size(array))
580count
581+11
582call setResized(choice, count)
583call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
584choice
585+4, +8, +10, +15, +15, +1, +17, +4, +15, +17, +8
586count = getUnifRand(1, size(array))
587count
588+7
589call setResized(choice, count)
590call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
591choice
592+17, +8, +1, +10, +15, +4, +15
593
594array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
595array
596+12, +5, +17, +11, +20
597call setResized(choice, 1)
598choice = [getChoice(array)]
599choice
600+20
601count = getUnifRand(1, 2 * size(array))
602count
603+2
604call setResized(choice, count)
605call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
606choice
607+11, +5
608count = getUnifRand(1, size(array))
609count
610+3
611call setResized(choice, count)
612call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
613choice
614+17, +12, +20
615
616array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
617array
618+20, +11, +3, +18, +14
619call setResized(choice, 1)
620choice = [getChoice(array)]
621choice
622+18
623count = getUnifRand(1, 2 * size(array))
624count
625+3
626call setResized(choice, count)
627call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
628choice
629+20, +11, +14
630count = getUnifRand(1, size(array))
631count
632+3
633call setResized(choice, count)
634call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
635choice
636+3, +18, +14
637
638array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
639array
640+4, +15, +8, +15, +6
641call setResized(choice, 1)
642choice = [getChoice(array)]
643choice
644+8
645count = getUnifRand(1, 2 * size(array))
646count
647+7
648call setResized(choice, count)
649call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
650choice
651+8, +4, +15, +6, +6, +6, +15
652count = getUnifRand(1, size(array))
653count
654+4
655call setResized(choice, count)
656call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
657choice
658+6, +4, +8, +15
659
660array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
661array
662+4, +2, +19, +6, +9
663call setResized(choice, 1)
664choice = [getChoice(array)]
665choice
666+6
667count = getUnifRand(1, 2 * size(array))
668count
669+6
670call setResized(choice, count)
671call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
672choice
673+19, +2, +6, +2, +6, +19
674count = getUnifRand(1, size(array))
675count
676+2
677call setResized(choice, count)
678call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
679choice
680+4, +6
681
682array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
683array
684F, T, T, T, T, T
685call setResized(choice, 1)
686choice = [getChoice(array)]
687choice
688T
689count = getUnifRand(1, 2 * size(array))
690count
691+2
692call setResized(choice, count)
693call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
694choice
695T, T
696count = getUnifRand(1, size(array))
697count
698+1
699call setResized(choice, count)
700call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
701choice
702T
703
704array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
705array
706F, F, F, T, T, T, T
707call setResized(choice, 1)
708choice = [getChoice(array)]
709choice
710T
711count = getUnifRand(1, 2 * size(array))
712count
713+7
714call setResized(choice, count)
715call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
716choice
717F, T, T, T, F, T, T
718count = getUnifRand(1, size(array))
719count
720+1
721call setResized(choice, count)
722call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
723choice
724F
725
726array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
727array
728F, T, F, T, F, F, T
729call setResized(choice, 1)
730choice = [getChoice(array)]
731choice
732F
733count = getUnifRand(1, 2 * size(array))
734count
735+14
736call setResized(choice, count)
737call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
738choice
739T, F, T, F, T, F, T, T, F, T, T, F, F, F
740count = getUnifRand(1, size(array))
741count
742+4
743call setResized(choice, count)
744call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
745choice
746F, T, T, T
747
748array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
749array
750F, F, F, F, F, F, F, F, T
751call setResized(choice, 1)
752choice = [getChoice(array)]
753choice
754T
755count = getUnifRand(1, 2 * size(array))
756count
757+3
758call setResized(choice, count)
759call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
760choice
761F, F, F
762count = getUnifRand(1, size(array))
763count
764+5
765call setResized(choice, count)
766call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
767choice
768F, F, F, F, F
769
770array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
771array
772T, F, T, F, T, F, F, T, F, T
773call setResized(choice, 1)
774choice = [getChoice(array)]
775choice
776T
777count = getUnifRand(1, 2 * size(array))
778count
779+3
780call setResized(choice, count)
781call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
782choice
783T, F, F
784count = getUnifRand(1, size(array))
785count
786+8
787call setResized(choice, count)
788call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
789choice
790F, T, F, T, F, F, T, T
791
792array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
793array
794F, F, F, F, T, F
795call setResized(choice, 1)
796choice = [getChoice(array)]
797choice
798T
799count = getUnifRand(1, 2 * size(array))
800count
801+5
802call setResized(choice, count)
803call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
804choice
805F, F, F, F, T
806count = getUnifRand(1, size(array))
807count
808+2
809call setResized(choice, count)
810call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
811choice
812F, F
813
814array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
815array
816T, T, T, T
817call setResized(choice, 1)
818choice = [getChoice(array)]
819choice
820T
821count = getUnifRand(1, 2 * size(array))
822count
823+1
824call setResized(choice, count)
825call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
826choice
827T
828count = getUnifRand(1, size(array))
829count
830+3
831call setResized(choice, count)
832call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
833choice
834T, T, T
835
836array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
837array
838T, T, F, T, F, T, T, T, T
839call setResized(choice, 1)
840choice = [getChoice(array)]
841choice
842F
843count = getUnifRand(1, 2 * size(array))
844count
845+5
846call setResized(choice, count)
847call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
848choice
849F, T, F, T, T
850count = getUnifRand(1, size(array))
851count
852+5
853call setResized(choice, count)
854call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
855choice
856T, T, T, F, T
857
858array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
859array
860T, F, F, T, T
861call setResized(choice, 1)
862choice = [getChoice(array)]
863choice
864F
865count = getUnifRand(1, 2 * size(array))
866count
867+2
868call setResized(choice, count)
869call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
870choice
871T, T
872count = getUnifRand(1, size(array))
873count
874+2
875call setResized(choice, count)
876call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
877choice
878T, T
879
880array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
881array
882T, F, F, F, T, F
883call setResized(choice, 1)
884choice = [getChoice(array)]
885choice
886F
887count = getUnifRand(1, 2 * size(array))
888count
889+10
890call setResized(choice, count)
891call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
892choice
893F, F, F, F, F, F, F, T, T, F
894count = getUnifRand(1, size(array))
895count
896+2
897call setResized(choice, count)
898call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
899choice
900F, F
901
902array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
903array
904(+0.966567636, +0.242801428), (+0.744990945, +0.661537468), (+0.863515556, +0.147129297E-1), (+0.372536659, +0.190899730), (+0.930302620, +0.428150952), (+0.484815657, +0.615944266E-1), (+0.355721891, +0.671306729), (+0.853031278, +0.986871719E-1), (+0.696726143, +0.459758699), (+0.578925312, +0.499309957)
905call setResized(choice, 1)
906choice = [getChoice(array)]
907choice
908(+0.966567636, +0.242801428)
909count = getUnifRand(1, 2 * size(array))
910count
911+13
912call setResized(choice, count)
913call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
914choice
915(+0.853031278, +0.986871719E-1), (+0.372536659, +0.190899730), (+0.372536659, +0.190899730), (+0.966567636, +0.242801428), (+0.372536659, +0.190899730), (+0.930302620, +0.428150952), (+0.578925312, +0.499309957), (+0.744990945, +0.661537468), (+0.696726143, +0.459758699), (+0.930302620, +0.428150952), (+0.372536659, +0.190899730), (+0.966567636, +0.242801428), (+0.744990945, +0.661537468)
916count = getUnifRand(1, size(array))
917count
918+2
919call setResized(choice, count)
920call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
921choice
922(+0.578925312, +0.499309957), (+0.744990945, +0.661537468)
923
924array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
925array
926(+0.749040842E-1, +0.846652627), (+0.462592304, +0.633298695), (+0.101239264, +0.336396873), (+0.870867610, +0.757890940E-1), (+0.811987519, +0.765304446), (+0.282923222, +0.595227242), (+0.375988066, +0.156859875), (+0.408949018, +0.618448734), (+0.286606193, +0.445691347E-1), (+0.900930762E-1, +0.560913146)
927call setResized(choice, 1)
928choice = [getChoice(array)]
929choice
930(+0.462592304, +0.633298695)
931count = getUnifRand(1, 2 * size(array))
932count
933+1
934call setResized(choice, count)
935call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
936choice
937(+0.749040842E-1, +0.846652627)
938count = getUnifRand(1, size(array))
939count
940+2
941call setResized(choice, count)
942call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
943choice
944(+0.286606193, +0.445691347E-1), (+0.408949018, +0.618448734)
945
946array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
947array
948(+0.756578326, +0.865216792), (+0.129972577, +0.481667638), (+0.251243651, +0.142467380), (+0.833117962, +0.919611514), (+0.320007443, +0.368240952), (+0.639364243, +0.235855222), (+0.992962122, +0.242979467), (+0.934729576E-1, +0.113878429)
949call setResized(choice, 1)
950choice = [getChoice(array)]
951choice
952(+0.756578326, +0.865216792)
953count = getUnifRand(1, 2 * size(array))
954count
955+8
956call setResized(choice, count)
957call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
958choice
959(+0.992962122, +0.242979467), (+0.992962122, +0.242979467), (+0.129972577, +0.481667638), (+0.934729576E-1, +0.113878429), (+0.833117962, +0.919611514), (+0.251243651, +0.142467380), (+0.639364243, +0.235855222), (+0.992962122, +0.242979467)
960count = getUnifRand(1, size(array))
961count
962+1
963call setResized(choice, count)
964call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
965choice
966(+0.756578326, +0.865216792)
967
968array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
969array
970(+0.948273122, +0.247941673), (+0.430622697, +0.924463928), (+0.646783888, +0.542000294), (+0.872922361, +0.681016445), (+0.641989350, +0.665815711), (+0.504229486, +0.528132081), (+0.741400838, +0.414862812), (+0.748507917, +0.773781180), (+0.411326408, +0.730209410), (+0.373374820, +0.885861099)
971call setResized(choice, 1)
972choice = [getChoice(array)]
973choice
974(+0.646783888, +0.542000294)
975count = getUnifRand(1, 2 * size(array))
976count
977+13
978call setResized(choice, count)
979call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
980choice
981(+0.373374820, +0.885861099), (+0.430622697, +0.924463928), (+0.948273122, +0.247941673), (+0.646783888, +0.542000294), (+0.646783888, +0.542000294), (+0.411326408, +0.730209410), (+0.373374820, +0.885861099), (+0.504229486, +0.528132081), (+0.872922361, +0.681016445), (+0.504229486, +0.528132081), (+0.741400838, +0.414862812), (+0.504229486, +0.528132081), (+0.641989350, +0.665815711)
982count = getUnifRand(1, size(array))
983count
984+8
985call setResized(choice, count)
986call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
987choice
988(+0.430622697, +0.924463928), (+0.411326408, +0.730209410), (+0.646783888, +0.542000294), (+0.641989350, +0.665815711), (+0.948273122, +0.247941673), (+0.373374820, +0.885861099), (+0.504229486, +0.528132081), (+0.741400838, +0.414862812)
989
990array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
991array
992(+0.949828029, +0.279816389E-1), (+0.885215998E-1, +0.392912030), (+0.990967810, +0.994746029), (+0.548746288, +0.326242208), (+0.796027601, +0.569580615), (+0.684597611, +0.799530506), (+0.329652607, +0.580212235), (+0.135033488, +0.606653929), (+0.568752348, +0.453058481E-1)
993call setResized(choice, 1)
994choice = [getChoice(array)]
995choice
996(+0.990967810, +0.994746029)
997count = getUnifRand(1, 2 * size(array))
998count
999+10
1000call setResized(choice, count)
1001call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1002choice
1003(+0.684597611, +0.799530506), (+0.796027601, +0.569580615), (+0.684597611, +0.799530506), (+0.548746288, +0.326242208), (+0.135033488, +0.606653929), (+0.949828029, +0.279816389E-1), (+0.329652607, +0.580212235), (+0.568752348, +0.453058481E-1), (+0.885215998E-1, +0.392912030), (+0.135033488, +0.606653929)
1004count = getUnifRand(1, size(array))
1005count
1006+5
1007call setResized(choice, count)
1008call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1009choice
1010(+0.568752348, +0.453058481E-1), (+0.949828029, +0.279816389E-1), (+0.990967810, +0.994746029), (+0.135033488, +0.606653929), (+0.548746288, +0.326242208)
1011
1012array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
1013array
1014(+0.869408786, +0.163655519), (+0.401184261, +0.710035503), (+0.604055107, +0.266775250), (+0.152729750E-1, +0.525963604), (+0.864706635E-1, +0.490816832), (+0.665001929, +0.501897454), (+0.452289462, +0.454979300), (+0.504346132, +0.875657797), (+0.811618805, +0.892618179), (+0.820527256, +0.316450477)
1015call setResized(choice, 1)
1016choice = [getChoice(array)]
1017choice
1018(+0.604055107, +0.266775250)
1019count = getUnifRand(1, 2 * size(array))
1020count
1021+6
1022call setResized(choice, count)
1023call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1024choice
1025(+0.152729750E-1, +0.525963604), (+0.811618805, +0.892618179), (+0.504346132, +0.875657797), (+0.604055107, +0.266775250), (+0.811618805, +0.892618179), (+0.504346132, +0.875657797)
1026count = getUnifRand(1, size(array))
1027count
1028+8
1029call setResized(choice, count)
1030call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1031choice
1032(+0.401184261, +0.710035503), (+0.811618805, +0.892618179), (+0.504346132, +0.875657797), (+0.452289462, +0.454979300), (+0.869408786, +0.163655519), (+0.864706635E-1, +0.490816832), (+0.152729750E-1, +0.525963604), (+0.665001929, +0.501897454)
1033
1034array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
1035array
1036(+0.547203422E-1, +0.705532432), (+0.743371248, +0.218321562), (+0.878437519, +0.370834291), (+0.916739404, +0.111333907), (+0.928204060, +0.374625564), (+0.424340367, +0.386937678), (+0.235471785, +0.447046340), (+0.856546223, +0.266930044), (+0.850442886, +0.248145461), (+0.825205982, +0.139031410E-1)
1037call setResized(choice, 1)
1038choice = [getChoice(array)]
1039choice
1040(+0.928204060, +0.374625564)
1041count = getUnifRand(1, 2 * size(array))
1042count
1043+7
1044call setResized(choice, count)
1045call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1046choice
1047(+0.743371248, +0.218321562), (+0.235471785, +0.447046340), (+0.547203422E-1, +0.705532432), (+0.928204060, +0.374625564), (+0.850442886, +0.248145461), (+0.235471785, +0.447046340), (+0.235471785, +0.447046340)
1048count = getUnifRand(1, size(array))
1049count
1050+8
1051call setResized(choice, count)
1052call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1053choice
1054(+0.235471785, +0.447046340), (+0.856546223, +0.266930044), (+0.743371248, +0.218321562), (+0.825205982, +0.139031410E-1), (+0.878437519, +0.370834291), (+0.547203422E-1, +0.705532432), (+0.850442886, +0.248145461), (+0.424340367, +0.386937678)
1055
1056array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
1057array
1058(+0.900668323, +0.102512598), (+0.246726274, +0.709459662), (+0.167421401, +0.463672698), (+0.140036941E-1, +0.396695971), (+0.862865388, +0.124113321), (+0.655584037, +0.650083661), (+0.153532565, +0.840800285), (+0.984313190, +0.190340817), (+0.736805260, +0.622215569), (+0.555435598, +0.902674556)
1059call setResized(choice, 1)
1060choice = [getChoice(array)]
1061choice
1062(+0.900668323, +0.102512598)
1063count = getUnifRand(1, 2 * size(array))
1064count
1065+7
1066call setResized(choice, count)
1067call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1068choice
1069(+0.555435598, +0.902674556), (+0.246726274, +0.709459662), (+0.862865388, +0.124113321), (+0.140036941E-1, +0.396695971), (+0.246726274, +0.709459662), (+0.736805260, +0.622215569), (+0.555435598, +0.902674556)
1070count = getUnifRand(1, size(array))
1071count
1072+3
1073call setResized(choice, count)
1074call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1075choice
1076(+0.555435598, +0.902674556), (+0.167421401, +0.463672698), (+0.153532565, +0.840800285)
1077
1078array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
1079array
1080(+0.757711470, +0.117669463), (+0.259645045, +0.415035963), (+0.733687460, +0.748838603), (+0.898760974, +0.583227932), (+0.804121971, +0.742612422), (+0.178356111, +0.563795626)
1081call setResized(choice, 1)
1082choice = [getChoice(array)]
1083choice
1084(+0.898760974, +0.583227932)
1085count = getUnifRand(1, 2 * size(array))
1086count
1087+5
1088call setResized(choice, count)
1089call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1090choice
1091(+0.178356111, +0.563795626), (+0.757711470, +0.117669463), (+0.178356111, +0.563795626), (+0.898760974, +0.583227932), (+0.178356111, +0.563795626)
1092count = getUnifRand(1, size(array))
1093count
1094+4
1095call setResized(choice, count)
1096call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1097choice
1098(+0.898760974, +0.583227932), (+0.804121971, +0.742612422), (+0.733687460, +0.748838603), (+0.757711470, +0.117669463)
1099
1100array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
1101array
1102(+0.180361032, +0.214649737), (+0.972779989E-1, +0.279024184), (+0.353656769, +0.920338690), (+0.487064898, +0.959865451), (+0.575634956, +0.500947237), (+0.225540400, +0.169576466)
1103call setResized(choice, 1)
1104choice = [getChoice(array)]
1105choice
1106(+0.972779989E-1, +0.279024184)
1107count = getUnifRand(1, 2 * size(array))
1108count
1109+7
1110call setResized(choice, count)
1111call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1112choice
1113(+0.180361032, +0.214649737), (+0.487064898, +0.959865451), (+0.225540400, +0.169576466), (+0.225540400, +0.169576466), (+0.180361032, +0.214649737), (+0.575634956, +0.500947237), (+0.353656769, +0.920338690)
1114count = getUnifRand(1, size(array))
1115count
1116+5
1117call setResized(choice, count)
1118call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1119choice
1120(+0.180361032, +0.214649737), (+0.225540400, +0.169576466), (+0.575634956, +0.500947237), (+0.487064898, +0.959865451), (+0.972779989E-1, +0.279024184)
1121
1122array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1123array
1124+0.371341109E-1, +0.381799638, +0.121947050, +0.248406112, +0.659352422, +0.101307631E-1, +0.309788823, +0.302424312, +0.688864112, +0.814329863
1125call setResized(choice, 1)
1126choice = [getChoice(array)]
1127choice
1128+0.688864112
1129count = getUnifRand(1, 2 * size(array))
1130count
1131+5
1132call setResized(choice, count)
1133call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1134choice
1135+0.101307631E-1, +0.309788823, +0.101307631E-1, +0.248406112, +0.814329863
1136count = getUnifRand(1, size(array))
1137count
1138+1
1139call setResized(choice, count)
1140call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1141choice
1142+0.381799638
1143
1144array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1145array
1146+0.491680324, +0.138292313, +0.596547902, +0.370443165, +0.141018391, +0.515614688, +0.548623741, +0.124240279, +0.711115062, +0.172640204
1147call setResized(choice, 1)
1148choice = [getChoice(array)]
1149choice
1150+0.711115062
1151count = getUnifRand(1, 2 * size(array))
1152count
1153+3
1154call setResized(choice, count)
1155call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1156choice
1157+0.141018391, +0.370443165, +0.548623741
1158count = getUnifRand(1, size(array))
1159count
1160+6
1161call setResized(choice, count)
1162call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1163choice
1164+0.596547902, +0.515614688, +0.172640204, +0.141018391, +0.548623741, +0.138292313
1165
1166array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1167array
1168+0.302124202, +0.639679730, +0.630902171, +0.843400419
1169call setResized(choice, 1)
1170choice = [getChoice(array)]
1171choice
1172+0.843400419
1173count = getUnifRand(1, 2 * size(array))
1174count
1175+8
1176call setResized(choice, count)
1177call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1178choice
1179+0.302124202, +0.302124202, +0.843400419, +0.639679730, +0.630902171, +0.302124202, +0.630902171, +0.843400419
1180count = getUnifRand(1, size(array))
1181count
1182+4
1183call setResized(choice, count)
1184call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1185choice
1186+0.843400419, +0.630902171, +0.639679730, +0.302124202
1187
1188array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1189array
1190+0.491361380, +0.716886997, +0.522970140, +0.690323055, +0.865614712
1191call setResized(choice, 1)
1192choice = [getChoice(array)]
1193choice
1194+0.865614712
1195count = getUnifRand(1, 2 * size(array))
1196count
1197+1
1198call setResized(choice, count)
1199call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1200choice
1201+0.865614712
1202count = getUnifRand(1, size(array))
1203count
1204+2
1205call setResized(choice, count)
1206call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1207choice
1208+0.716886997, +0.491361380
1209
1210array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1211array
1212+0.620840549, +0.804302514, +0.484155357, +0.327768445
1213call setResized(choice, 1)
1214choice = [getChoice(array)]
1215choice
1216+0.484155357
1217count = getUnifRand(1, 2 * size(array))
1218count
1219+1
1220call setResized(choice, count)
1221call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1222choice
1223+0.620840549
1224count = getUnifRand(1, size(array))
1225count
1226+2
1227call setResized(choice, count)
1228call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1229choice
1230+0.804302514, +0.327768445
1231
1232array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1233array
1234+0.906314373, +0.238175273, +0.913873315E-1, +0.932551622, +0.514160514, +0.255421042, +0.426711202, +0.641893446
1235call setResized(choice, 1)
1236choice = [getChoice(array)]
1237choice
1238+0.906314373
1239count = getUnifRand(1, 2 * size(array))
1240count
1241+3
1242call setResized(choice, count)
1243call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1244choice
1245+0.932551622, +0.906314373, +0.514160514
1246count = getUnifRand(1, size(array))
1247count
1248+5
1249call setResized(choice, count)
1250call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1251choice
1252+0.932551622, +0.255421042, +0.238175273, +0.514160514, +0.913873315E-1
1253
1254array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1255array
1256+0.716979802, +0.245509863, +0.366578400, +0.438592196, +0.118605018, +0.512950122
1257call setResized(choice, 1)
1258choice = [getChoice(array)]
1259choice
1260+0.245509863
1261count = getUnifRand(1, 2 * size(array))
1262count
1263+10
1264call setResized(choice, count)
1265call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1266choice
1267+0.245509863, +0.438592196, +0.245509863, +0.716979802, +0.716979802, +0.118605018, +0.245509863, +0.366578400, +0.512950122, +0.438592196
1268count = getUnifRand(1, size(array))
1269count
1270+5
1271call setResized(choice, count)
1272call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1273choice
1274+0.245509863, +0.118605018, +0.366578400, +0.438592196, +0.716979802
1275
1276array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1277array
1278+0.443226039, +0.147010267, +0.112619102, +0.900227904, +0.523026347, +0.744330943, +0.119432271
1279call setResized(choice, 1)
1280choice = [getChoice(array)]
1281choice
1282+0.523026347
1283count = getUnifRand(1, 2 * size(array))
1284count
1285+11
1286call setResized(choice, count)
1287call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1288choice
1289+0.147010267, +0.112619102, +0.112619102, +0.112619102, +0.112619102, +0.523026347, +0.147010267, +0.443226039, +0.523026347, +0.443226039, +0.147010267
1290count = getUnifRand(1, size(array))
1291count
1292+6
1293call setResized(choice, count)
1294call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1295choice
1296+0.523026347, +0.112619102, +0.147010267, +0.900227904, +0.119432271, +0.443226039
1297
1298array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1299array
1300+0.986852348, +0.871837735E-1, +0.567218065E-1, +0.362536192, +0.580505133E-1, +0.102144718, +0.803192735, +0.896053553, +0.518334985, +0.206341088
1301call setResized(choice, 1)
1302choice = [getChoice(array)]
1303choice
1304+0.896053553
1305count = getUnifRand(1, 2 * size(array))
1306count
1307+19
1308call setResized(choice, count)
1309call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1310choice
1311+0.206341088, +0.206341088, +0.580505133E-1, +0.102144718, +0.580505133E-1, +0.206341088, +0.102144718, +0.362536192, +0.518334985, +0.518334985, +0.362536192, +0.803192735, +0.986852348, +0.986852348, +0.362536192, +0.567218065E-1, +0.362536192, +0.206341088, +0.567218065E-1
1312count = getUnifRand(1, size(array))
1313count
1314+7
1315call setResized(choice, count)
1316call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1317choice
1318+0.102144718, +0.206341088, +0.362536192, +0.871837735E-1, +0.986852348, +0.580505133E-1, +0.803192735
1319
1320array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1321array
1322+0.215183020, +0.207828104, +0.169626951, +0.320730686, +0.619910002
1323call setResized(choice, 1)
1324choice = [getChoice(array)]
1325choice
1326+0.169626951
1327count = getUnifRand(1, 2 * size(array))
1328count
1329+7
1330call setResized(choice, count)
1331call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1332choice
1333+0.169626951, +0.207828104, +0.169626951, +0.320730686, +0.169626951, +0.215183020, +0.320730686
1334count = getUnifRand(1, size(array))
1335count
1336+3
1337call setResized(choice, count)
1338call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1339choice
1340+0.169626951, +0.320730686, +0.207828104
1341


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.

  1. 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.
  2. 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.

Author:
Amir Shahmoradi, Monday March 6, 2017, 3:22 pm, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin.

Definition at line 987 of file pm_arrayChoice.F90.


The documentation for this interface was generated from the following file: