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"UNHRYF"
6call setResized(choice, 1)
7call setChoice(rng, choice, array)
8choice
9"Y"
10count = getUnifRand(1, 2 * len(array))
11count
12+10
13call setResized(choice, count)
14call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
15choice
16"RYRUYHFFRF"
17count = getUnifRand(1, len(array))
18count
19+3
20call setResized(choice, count)
21call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
22choice
23"FHU"
24
25count = getUnifRand(4, 10)
26array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
27array
28"LMBZJWC"
29call setResized(choice, 1)
30call setChoice(rng, choice, array)
31choice
32"B"
33count = getUnifRand(1, 2 * len(array))
34count
35+6
36call setResized(choice, count)
37call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
38choice
39"JBCZLZ"
40count = getUnifRand(1, len(array))
41count
42+7
43call setResized(choice, count)
44call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
45choice
46"MZWBLCJ"
47
48count = getUnifRand(4, 10)
49array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
50array
51"RCDSZYO"
52call setResized(choice, 1)
53call setChoice(rng, choice, array)
54choice
55"C"
56count = getUnifRand(1, 2 * len(array))
57count
58+10
59call setResized(choice, count)
60call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
61choice
62"DRODZCDOZR"
63count = getUnifRand(1, len(array))
64count
65+6
66call setResized(choice, count)
67call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
68choice
69"OYCZRS"
70
71count = getUnifRand(4, 10)
72array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
73array
74"VEMSGVFU"
75call setResized(choice, 1)
76call setChoice(rng, choice, array)
77choice
78"V"
79count = getUnifRand(1, 2 * len(array))
80count
81+11
82call setResized(choice, count)
83call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
84choice
85"GUGUVEUVFVV"
86count = getUnifRand(1, len(array))
87count
88+1
89call setResized(choice, count)
90call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
91choice
92"V"
93
94count = getUnifRand(4, 10)
95array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
96array
97"YMIWQ"
98call setResized(choice, 1)
99call setChoice(rng, choice, array)
100choice
101"M"
102count = getUnifRand(1, 2 * len(array))
103count
104+9
105call setResized(choice, count)
106call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
107choice
108"YYMQWWWMY"
109count = getUnifRand(1, len(array))
110count
111+3
112call setResized(choice, count)
113call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
114choice
115"QIW"
116
117count = getUnifRand(4, 10)
118array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
119array
120"AAKBARMOHX"
121call setResized(choice, 1)
122call setChoice(rng, choice, array)
123choice
124"A"
125count = getUnifRand(1, 2 * len(array))
126count
127+8
128call setResized(choice, count)
129call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
130choice
131"HXRBMAXB"
132count = getUnifRand(1, len(array))
133count
134+2
135call setResized(choice, count)
136call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
137choice
138"MA"
139
140count = getUnifRand(4, 10)
141array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
142array
143"RHSBMX"
144call setResized(choice, 1)
145call setChoice(rng, choice, array)
146choice
147"S"
148count = getUnifRand(1, 2 * len(array))
149count
150+11
151call setResized(choice, count)
152call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
153choice
154"BBSMSBRRSBM"
155count = getUnifRand(1, len(array))
156count
157+2
158call setResized(choice, count)
159call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
160choice
161"HX"
162
163count = getUnifRand(4, 10)
164array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
165array
166"AGNVTL"
167call setResized(choice, 1)
168call setChoice(rng, choice, array)
169choice
170"N"
171count = getUnifRand(1, 2 * len(array))
172count
173+5
174call setResized(choice, count)
175call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
176choice
177"TATAV"
178count = getUnifRand(1, len(array))
179count
180+3
181call setResized(choice, count)
182call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
183choice
184"AVG"
185
186count = getUnifRand(4, 10)
187array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
188array
189"KVFUZCQXH"
190call setResized(choice, 1)
191call setChoice(rng, choice, array)
192choice
193"K"
194count = getUnifRand(1, 2 * len(array))
195count
196+14
197call setResized(choice, count)
198call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
199choice
200"CXXVCKXUVQZKCK"
201count = getUnifRand(1, len(array))
202count
203+3
204call setResized(choice, count)
205call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
206choice
207"FZK"
208
209count = getUnifRand(4, 10)
210array = getUnifRand(repeat('A', count), repeat('Z', count)) ! generate random array for illustration.
211array
212"POKX"
213call setResized(choice, 1)
214call setChoice(rng, choice, array)
215choice
216"O"
217count = getUnifRand(1, 2 * len(array))
218count
219+5
220call setResized(choice, count)
221call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
222choice
223"PKXKP"
224count = getUnifRand(1, len(array))
225count
226+3
227call setResized(choice, count)
228call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
229choice
230"PKO"
231
232count = getUnifRand(4, 10)
233array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
234array
235"LV", "CN", "UX", "NV", "YP", "HN", "WZ", "UB", "LW", "JF"
236call setResized(choice, 1)
237choice = [getChoice(array)]
238choice
239"UB"
240count = getUnifRand(1, len(array))
241count
242+1
243call setResized(choice, count)
244call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
245choice
246"NV"
247count = getUnifRand(1, size(array))
248count
249+5
250call setResized(choice, count)
251call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
252choice
253"HN", "UX", "NV", "JF", "YP"
254
255count = getUnifRand(4, 10)
256array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
257array
258"SL", "LK", "RB", "GQ"
259call setResized(choice, 1)
260choice = [getChoice(array)]
261choice
262"RB"
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"SL"
270count = getUnifRand(1, size(array))
271count
272+2
273call setResized(choice, count)
274call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
275choice
276"SL", "RB"
277
278count = getUnifRand(4, 10)
279array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
280array
281"IT", "DI", "MK", "MS", "PN", "DC", "YJ"
282call setResized(choice, 1)
283choice = [getChoice(array)]
284choice
285"DC"
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"DC"
293count = getUnifRand(1, size(array))
294count
295+6
296call setResized(choice, count)
297call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
298choice
299"DI", "IT", "MK", "MS", "DC", "PN"
300
301count = getUnifRand(4, 10)
302array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
303array
304"IT", "QL", "KK", "TE", "DO", "VQ", "SV", "GT", "KN", "YK"
305call setResized(choice, 1)
306choice = [getChoice(array)]
307choice
308"VQ"
309count = getUnifRand(1, len(array))
310count
311+1
312call setResized(choice, count)
313call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
314choice
315"SV"
316count = getUnifRand(1, size(array))
317count
318+5
319call setResized(choice, count)
320call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
321choice
322"GT", "KK", "KN", "YK", "SV"
323
324count = getUnifRand(4, 10)
325array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
326array
327"BR", "WB", "EI", "KC", "LP", "TC", "QG", "AT", "OB"
328call setResized(choice, 1)
329choice = [getChoice(array)]
330choice
331"TC"
332count = getUnifRand(1, len(array))
333count
334+1
335call setResized(choice, count)
336call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
337choice
338"AT"
339count = getUnifRand(1, size(array))
340count
341+9
342call setResized(choice, count)
343call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
344choice
345"AT", "QG", "EI", "TC", "BR", "KC", "LP", "OB", "WB"
346
347count = getUnifRand(4, 10)
348array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
349array
350"LA", "GC", "FT", "FE", "GM"
351call setResized(choice, 1)
352choice = [getChoice(array)]
353choice
354"FE"
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"GC"
362count = getUnifRand(1, size(array))
363count
364+5
365call setResized(choice, count)
366call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
367choice
368"GC", "GM", "FT", "FE", "LA"
369
370count = getUnifRand(4, 10)
371array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
372array
373"TU", "PH", "WM", "AO", "EM", "XH"
374call setResized(choice, 1)
375choice = [getChoice(array)]
376choice
377"WM"
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"EM", "EM"
385count = getUnifRand(1, size(array))
386count
387+6
388call setResized(choice, count)
389call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
390choice
391"AO", "EM", "TU", "XH", "PH", "WM"
392
393count = getUnifRand(4, 10)
394array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
395array
396"WT", "MZ", "HB", "ZV", "US", "YZ"
397call setResized(choice, 1)
398choice = [getChoice(array)]
399choice
400"HB"
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"US"
408count = getUnifRand(1, size(array))
409count
410+3
411call setResized(choice, count)
412call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
413choice
414"US", "ZV", "YZ"
415
416count = getUnifRand(4, 10)
417array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
418array
419"GE", "WF", "LH", "IA", "RY", "QT"
420call setResized(choice, 1)
421choice = [getChoice(array)]
422choice
423"LH"
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"RY"
431count = getUnifRand(1, size(array))
432count
433+2
434call setResized(choice, count)
435call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
436choice
437"LH", "RY"
438
439count = getUnifRand(4, 10)
440array = getUnifRand('AA', 'ZZ', count) ! generate random array for illustration.
441array
442"PH", "EB", "NG", "DK", "JM"
443call setResized(choice, 1)
444choice = [getChoice(array)]
445choice
446"NG"
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"JM", "DK"
454count = getUnifRand(1, size(array))
455count
456+3
457call setResized(choice, count)
458call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
459choice
460"EB", "DK", "PH"
461
462array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
463array
464+18, +13, +19, +2, +17, +16, +8, +3, +1
465call setResized(choice, 1)
466choice = [getChoice(array)]
467choice
468+1
469count = getUnifRand(1, 2 * size(array))
470count
471+6
472call setResized(choice, count)
473call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
474choice
475+13, +8, +3, +8, +1, +3
476count = getUnifRand(1, size(array))
477count
478+6
479call setResized(choice, count)
480call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
481choice
482+2, +13, +8, +18, +16, +19
483
484array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
485array
486+17, +12, +18, +14, +7, +6, +6, +18
487call setResized(choice, 1)
488choice = [getChoice(array)]
489choice
490+18
491count = getUnifRand(1, 2 * size(array))
492count
493+5
494call setResized(choice, count)
495call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
496choice
497+17, +17, +18, +12, +7
498count = getUnifRand(1, size(array))
499count
500+1
501call setResized(choice, count)
502call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
503choice
504+6
505
506array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
507array
508+14, +2, +4, +10, +18, +16, +8
509call setResized(choice, 1)
510choice = [getChoice(array)]
511choice
512+10
513count = getUnifRand(1, 2 * size(array))
514count
515+2
516call setResized(choice, count)
517call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
518choice
519+16, +18
520count = getUnifRand(1, size(array))
521count
522+3
523call setResized(choice, count)
524call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
525choice
526+18, +4, +16
527
528array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
529array
530+7, +19, +13, +9, +5, +11
531call setResized(choice, 1)
532choice = [getChoice(array)]
533choice
534+5
535count = getUnifRand(1, 2 * size(array))
536count
537+6
538call setResized(choice, count)
539call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
540choice
541+9, +7, +7, +13, +7, +9
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+9, +19, +5
549
550array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
551array
552+12, +1, +15, +16, +5, +7, +7, +12
553call setResized(choice, 1)
554choice = [getChoice(array)]
555choice
556+7
557count = getUnifRand(1, 2 * size(array))
558count
559+1
560call setResized(choice, count)
561call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
562choice
563+15
564count = getUnifRand(1, size(array))
565count
566+8
567call setResized(choice, count)
568call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
569choice
570+15, +5, +7, +1, +7, +16, +12, +12
571
572array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
573array
574+6, +10, +3, +13, +11, +3, +11
575call setResized(choice, 1)
576choice = [getChoice(array)]
577choice
578+3
579count = getUnifRand(1, 2 * size(array))
580count
581+4
582call setResized(choice, count)
583call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
584choice
585+11, +11, +13, +3
586count = getUnifRand(1, size(array))
587count
588+1
589call setResized(choice, count)
590call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
591choice
592+3
593
594array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
595array
596+1, +20, +2, +2, +9
597call setResized(choice, 1)
598choice = [getChoice(array)]
599choice
600+1
601count = getUnifRand(1, 2 * size(array))
602count
603+9
604call setResized(choice, count)
605call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
606choice
607+2, +2, +9, +9, +2, +2, +20, +20, +9
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+1, +9, +2
615
616array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
617array
618+20, +6, +8, +5, +13
619call setResized(choice, 1)
620choice = [getChoice(array)]
621choice
622+13
623count = getUnifRand(1, 2 * size(array))
624count
625+4
626call setResized(choice, count)
627call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
628choice
629+20, +13, +5, +8
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+20, +6, +5
637
638array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
639array
640+5, +9, +10, +15, +14
641call setResized(choice, 1)
642choice = [getChoice(array)]
643choice
644+15
645count = getUnifRand(1, 2 * size(array))
646count
647+10
648call setResized(choice, count)
649call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
650choice
651+10, +15, +5, +15, +14, +9, +15, +15, +14, +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+9, +5, +10, +15
659
660array = getUnifRand(1, 20, getUnifRand(4, 10)) ! generate random array for illustration.
661array
662+3, +13, +8, +8, +19
663call setResized(choice, 1)
664choice = [getChoice(array)]
665choice
666+3
667count = getUnifRand(1, 2 * size(array))
668count
669+1
670call setResized(choice, count)
671call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
672choice
673+13
674count = getUnifRand(1, size(array))
675count
676+5
677call setResized(choice, count)
678call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
679choice
680+8, +3, +13, +8, +19
681
682array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
683array
684F, T, T, T, T, F, T, T, T
685call setResized(choice, 1)
686choice = [getChoice(array)]
687choice
688T
689count = getUnifRand(1, 2 * size(array))
690count
691+4
692call setResized(choice, count)
693call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
694choice
695T, T, T, T
696count = getUnifRand(1, size(array))
697count
698+8
699call setResized(choice, count)
700call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
701choice
702F, T, T, F, T, T, T, T
703
704array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
705array
706F, F, T, F, F, T, F, T, T
707call setResized(choice, 1)
708choice = [getChoice(array)]
709choice
710F
711count = getUnifRand(1, 2 * size(array))
712count
713+11
714call setResized(choice, count)
715call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
716choice
717F, F, F, F, F, T, F, F, T, F, F
718count = getUnifRand(1, size(array))
719count
720+2
721call setResized(choice, count)
722call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
723choice
724F, T
725
726array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
727array
728F, F, F, T, F, F
729call setResized(choice, 1)
730choice = [getChoice(array)]
731choice
732T
733count = getUnifRand(1, 2 * size(array))
734count
735+3
736call setResized(choice, count)
737call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
738choice
739F, 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, F, T, F
747
748array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
749array
750F, T, F, F
751call setResized(choice, 1)
752choice = [getChoice(array)]
753choice
754F
755count = getUnifRand(1, 2 * size(array))
756count
757+5
758call setResized(choice, count)
759call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
760choice
761F, T, F, F, F
762count = getUnifRand(1, size(array))
763count
764+2
765call setResized(choice, count)
766call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
767choice
768F, T
769
770array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
771array
772F, T, T, F, F, T, T
773call setResized(choice, 1)
774choice = [getChoice(array)]
775choice
776T
777count = getUnifRand(1, 2 * size(array))
778count
779+8
780call setResized(choice, count)
781call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
782choice
783T, F, F, T, F, T, T, F
784count = getUnifRand(1, size(array))
785count
786+1
787call setResized(choice, count)
788call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
789choice
790F
791
792array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
793array
794T, T, T, T, F
795call setResized(choice, 1)
796choice = [getChoice(array)]
797choice
798F
799count = getUnifRand(1, 2 * size(array))
800count
801+6
802call setResized(choice, count)
803call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
804choice
805T, F, T, T, T, T
806count = getUnifRand(1, size(array))
807count
808+5
809call setResized(choice, count)
810call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
811choice
812T, T, F, T, T
813
814array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
815array
816F, F, F, T, F, F, T, F, T, F
817call setResized(choice, 1)
818choice = [getChoice(array)]
819choice
820T
821count = getUnifRand(1, 2 * size(array))
822count
823+9
824call setResized(choice, count)
825call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
826choice
827F, F, F, F, F, T, F, F, F
828count = getUnifRand(1, size(array))
829count
830+6
831call setResized(choice, count)
832call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
833choice
834T, F, F, F, T, F
835
836array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
837array
838F, T, F, T, F, F, F, F
839call setResized(choice, 1)
840choice = [getChoice(array)]
841choice
842F
843count = getUnifRand(1, 2 * size(array))
844count
845+16
846call setResized(choice, count)
847call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
848choice
849F, F, T, F, F, T, F, F, F, F, F, T, F, F, F, F
850count = getUnifRand(1, size(array))
851count
852+3
853call setResized(choice, count)
854call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
855choice
856F, F, T
857
858array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
859array
860F, F, T, F, T, F, F, F, T
861call setResized(choice, 1)
862choice = [getChoice(array)]
863choice
864T
865count = getUnifRand(1, 2 * size(array))
866count
867+10
868call setResized(choice, count)
869call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
870choice
871F, T, F, T, F, T, F, F, F, T
872count = getUnifRand(1, size(array))
873count
874+8
875call setResized(choice, count)
876call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
877choice
878F, T, T, F, T, F, F, F
879
880array = getUnifRand(.false., .true., getUnifRand(4, 10)) ! generate random array for illustration.
881array
882F, T, F, T, T, F, F, 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, T, F, T, T, T, F, F
894count = getUnifRand(1, size(array))
895count
896+6
897call setResized(choice, count)
898call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
899choice
900T, F, T, F, F, F
901
902array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
903array
904(+0.321758986E-1, +0.436684489E-1), (+0.393458962, +0.663707316), (+0.972148955, +0.374623656), (+0.214533329, +0.869868755), (+0.948202014, +0.972358584), (+0.922570407, +0.226962507), (+0.562510073, +0.287059128), (+0.571668148E-1, +0.468724608), (+0.559585154, +0.382184982)
905call setResized(choice, 1)
906choice = [getChoice(array)]
907choice
908(+0.559585154, +0.382184982)
909count = getUnifRand(1, 2 * size(array))
910count
911+6
912call setResized(choice, count)
913call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
914choice
915(+0.571668148E-1, +0.468724608), (+0.972148955, +0.374623656), (+0.559585154, +0.382184982), (+0.571668148E-1, +0.468724608), (+0.948202014, +0.972358584), (+0.321758986E-1, +0.436684489E-1)
916count = getUnifRand(1, size(array))
917count
918+8
919call setResized(choice, count)
920call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
921choice
922(+0.571668148E-1, +0.468724608), (+0.972148955, +0.374623656), (+0.321758986E-1, +0.436684489E-1), (+0.562510073, +0.287059128), (+0.214533329, +0.869868755), (+0.559585154, +0.382184982), (+0.948202014, +0.972358584), (+0.393458962, +0.663707316)
923
924array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
925array
926(+0.765638411, +0.528921127), (+0.730202317, +0.668713272), (+0.590892315, +0.206144691), (+0.150284529, +0.865757287), (+0.542481124, +0.657548904), (+0.686655164, +0.352084219), (+0.370543242, +0.309225142), (+0.556847572, +0.942876697)
927call setResized(choice, 1)
928choice = [getChoice(array)]
929choice
930(+0.765638411, +0.528921127)
931count = getUnifRand(1, 2 * size(array))
932count
933+3
934call setResized(choice, count)
935call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
936choice
937(+0.556847572, +0.942876697), (+0.590892315, +0.206144691), (+0.730202317, +0.668713272)
938count = getUnifRand(1, size(array))
939count
940+5
941call setResized(choice, count)
942call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
943choice
944(+0.765638411, +0.528921127), (+0.370543242, +0.309225142), (+0.150284529, +0.865757287), (+0.556847572, +0.942876697), (+0.590892315, +0.206144691)
945
946array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
947array
948(+0.313464940, +0.886229873), (+0.632011294, +0.267050862E-1), (+0.662101567, +0.906833351), (+0.397894382, +0.559581399), (+0.577065825, +0.437116563)
949call setResized(choice, 1)
950choice = [getChoice(array)]
951choice
952(+0.577065825, +0.437116563)
953count = getUnifRand(1, 2 * size(array))
954count
955+9
956call setResized(choice, count)
957call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
958choice
959(+0.313464940, +0.886229873), (+0.313464940, +0.886229873), (+0.577065825, +0.437116563), (+0.577065825, +0.437116563), (+0.632011294, +0.267050862E-1), (+0.397894382, +0.559581399), (+0.662101567, +0.906833351), (+0.662101567, +0.906833351), (+0.313464940, +0.886229873)
960count = getUnifRand(1, size(array))
961count
962+3
963call setResized(choice, count)
964call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
965choice
966(+0.397894382, +0.559581399), (+0.632011294, +0.267050862E-1), (+0.313464940, +0.886229873)
967
968array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
969array
970(+0.134102106E-1, +0.891191304), (+0.839479566, +0.277248979), (+0.156475008, +0.280801058E-1), (+0.256280899E-1, +0.428005874), (+0.264160335, +0.702589452), (+0.409379542, +0.182389617), (+0.836651385, +0.351370931), (+0.323208570E-1, +0.147917926)
971call setResized(choice, 1)
972choice = [getChoice(array)]
973choice
974(+0.409379542, +0.182389617)
975count = getUnifRand(1, 2 * size(array))
976count
977+12
978call setResized(choice, count)
979call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
980choice
981(+0.836651385, +0.351370931), (+0.134102106E-1, +0.891191304), (+0.156475008, +0.280801058E-1), (+0.256280899E-1, +0.428005874), (+0.836651385, +0.351370931), (+0.156475008, +0.280801058E-1), (+0.256280899E-1, +0.428005874), (+0.264160335, +0.702589452), (+0.409379542, +0.182389617), (+0.839479566, +0.277248979), (+0.839479566, +0.277248979), (+0.839479566, +0.277248979)
982count = getUnifRand(1, size(array))
983count
984+7
985call setResized(choice, count)
986call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
987choice
988(+0.409379542, +0.182389617), (+0.256280899E-1, +0.428005874), (+0.839479566, +0.277248979), (+0.134102106E-1, +0.891191304), (+0.264160335, +0.702589452), (+0.323208570E-1, +0.147917926), (+0.836651385, +0.351370931)
989
990array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
991array
992(+0.703502834, +0.951751649), (+0.512730241, +0.379824638E-2), (+0.665100634, +0.688773990E-1), (+0.599192619, +0.816661358), (+0.576102912, +0.749669194)
993call setResized(choice, 1)
994choice = [getChoice(array)]
995choice
996(+0.703502834, +0.951751649)
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.703502834, +0.951751649), (+0.665100634, +0.688773990E-1), (+0.576102912, +0.749669194), (+0.599192619, +0.816661358), (+0.665100634, +0.688773990E-1), (+0.512730241, +0.379824638E-2), (+0.665100634, +0.688773990E-1), (+0.576102912, +0.749669194), (+0.512730241, +0.379824638E-2), (+0.703502834, +0.951751649)
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.665100634, +0.688773990E-1), (+0.576102912, +0.749669194), (+0.599192619, +0.816661358), (+0.703502834, +0.951751649), (+0.512730241, +0.379824638E-2)
1011
1012array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
1013array
1014(+0.122167230, +0.269889295), (+0.861952305, +0.589726567), (+0.859772146, +0.329113603), (+0.804813325, +0.529045463), (+0.441271007, +0.740462482), (+0.508821964, +0.415596902), (+0.838600576, +0.825728297)
1015call setResized(choice, 1)
1016choice = [getChoice(array)]
1017choice
1018(+0.838600576, +0.825728297)
1019count = getUnifRand(1, 2 * size(array))
1020count
1021+2
1022call setResized(choice, count)
1023call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1024choice
1025(+0.838600576, +0.825728297), (+0.804813325, +0.529045463)
1026count = getUnifRand(1, size(array))
1027count
1028+2
1029call setResized(choice, count)
1030call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1031choice
1032(+0.441271007, +0.740462482), (+0.838600576, +0.825728297)
1033
1034array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
1035array
1036(+0.205297351, +0.512369454), (+0.383617520, +0.988043070), (+0.157271147, +0.489999354), (+0.257513344, +0.863400638)
1037call setResized(choice, 1)
1038choice = [getChoice(array)]
1039choice
1040(+0.383617520, +0.988043070)
1041count = getUnifRand(1, 2 * size(array))
1042count
1043+4
1044call setResized(choice, count)
1045call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1046choice
1047(+0.383617520, +0.988043070), (+0.383617520, +0.988043070), (+0.383617520, +0.988043070), (+0.257513344, +0.863400638)
1048count = getUnifRand(1, size(array))
1049count
1050+2
1051call setResized(choice, count)
1052call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1053choice
1054(+0.157271147, +0.489999354), (+0.205297351, +0.512369454)
1055
1056array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
1057array
1058(+0.554530084, +0.562736928), (+0.613567233, +0.415495753), (+0.858100057, +0.175361753), (+0.586892664, +0.909363210), (+0.765267372, +0.841461062), (+0.219010770, +0.283888638), (+0.261481643, +0.199519217), (+0.924268484, +0.517601132)
1059call setResized(choice, 1)
1060choice = [getChoice(array)]
1061choice
1062(+0.613567233, +0.415495753)
1063count = getUnifRand(1, 2 * size(array))
1064count
1065+13
1066call setResized(choice, count)
1067call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1068choice
1069(+0.858100057, +0.175361753), (+0.924268484, +0.517601132), (+0.586892664, +0.909363210), (+0.924268484, +0.517601132), (+0.586892664, +0.909363210), (+0.219010770, +0.283888638), (+0.586892664, +0.909363210), (+0.586892664, +0.909363210), (+0.765267372, +0.841461062), (+0.219010770, +0.283888638), (+0.261481643, +0.199519217), (+0.765267372, +0.841461062), (+0.765267372, +0.841461062)
1070count = getUnifRand(1, size(array))
1071count
1072+8
1073call setResized(choice, count)
1074call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1075choice
1076(+0.219010770, +0.283888638), (+0.554530084, +0.562736928), (+0.858100057, +0.175361753), (+0.924268484, +0.517601132), (+0.613567233, +0.415495753), (+0.765267372, +0.841461062), (+0.586892664, +0.909363210), (+0.261481643, +0.199519217)
1077
1078array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
1079array
1080(+0.960497379, +0.769384205), (+0.271489382, +0.780470967E-1), (+0.937066019, +0.433604479), (+0.660716355, +0.832222998), (+0.141299963E-1, +0.204415619), (+0.324728727, +0.537358820)
1081call setResized(choice, 1)
1082choice = [getChoice(array)]
1083choice
1084(+0.271489382, +0.780470967E-1)
1085count = getUnifRand(1, 2 * size(array))
1086count
1087+9
1088call setResized(choice, count)
1089call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1090choice
1091(+0.324728727, +0.537358820), (+0.937066019, +0.433604479), (+0.271489382, +0.780470967E-1), (+0.324728727, +0.537358820), (+0.937066019, +0.433604479), (+0.937066019, +0.433604479), (+0.960497379, +0.769384205), (+0.660716355, +0.832222998), (+0.960497379, +0.769384205)
1092count = getUnifRand(1, size(array))
1093count
1094+3
1095call setResized(choice, count)
1096call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1097choice
1098(+0.141299963E-1, +0.204415619), (+0.271489382, +0.780470967E-1), (+0.324728727, +0.537358820)
1099
1100array = getUnifRand((0., 0.), (1., 1.), getUnifRand(4, 10)) ! generate random array for illustration.
1101array
1102(+0.476521254E-2, +0.682721615), (+0.228210747, +0.952042520), (+0.802704334, +0.237853467), (+0.407156587, +0.494337142), (+0.118468225, +0.966415405), (+0.406871617, +0.611795723), (+0.715928078, +0.749946475), (+0.333191156, +0.360447168), (+0.129752696, +0.141776085)
1103call setResized(choice, 1)
1104choice = [getChoice(array)]
1105choice
1106(+0.333191156, +0.360447168)
1107count = getUnifRand(1, 2 * size(array))
1108count
1109+6
1110call setResized(choice, count)
1111call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1112choice
1113(+0.333191156, +0.360447168), (+0.476521254E-2, +0.682721615), (+0.129752696, +0.141776085), (+0.129752696, +0.141776085), (+0.715928078, +0.749946475), (+0.333191156, +0.360447168)
1114count = getUnifRand(1, size(array))
1115count
1116+4
1117call setResized(choice, count)
1118call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1119choice
1120(+0.333191156, +0.360447168), (+0.407156587, +0.494337142), (+0.118468225, +0.966415405), (+0.228210747, +0.952042520)
1121
1122array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1123array
1124+0.544557095, +0.750966728, +0.506333888, +0.831639111, +0.322318971, +0.821950316, +0.694896877
1125call setResized(choice, 1)
1126choice = [getChoice(array)]
1127choice
1128+0.694896877
1129count = getUnifRand(1, 2 * size(array))
1130count
1131+3
1132call setResized(choice, count)
1133call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1134choice
1135+0.831639111, +0.750966728, +0.831639111
1136count = getUnifRand(1, size(array))
1137count
1138+3
1139call setResized(choice, count)
1140call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1141choice
1142+0.544557095, +0.506333888, +0.750966728
1143
1144array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1145array
1146+0.657208443, +0.462386549, +0.923881471, +0.686686814, +0.922647655, +0.123460650
1147call setResized(choice, 1)
1148choice = [getChoice(array)]
1149choice
1150+0.923881471
1151count = getUnifRand(1, 2 * size(array))
1152count
1153+6
1154call setResized(choice, count)
1155call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1156choice
1157+0.462386549, +0.923881471, +0.657208443, +0.123460650, +0.922647655, +0.123460650
1158count = getUnifRand(1, size(array))
1159count
1160+4
1161call setResized(choice, count)
1162call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1163choice
1164+0.123460650, +0.922647655, +0.923881471, +0.686686814
1165
1166array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1167array
1168+0.517813504, +0.272744000, +0.500072122, +0.790790796, +0.212759912, +0.209212005, +0.674435914, +0.542035460
1169call setResized(choice, 1)
1170choice = [getChoice(array)]
1171choice
1172+0.674435914
1173count = getUnifRand(1, 2 * size(array))
1174count
1175+11
1176call setResized(choice, count)
1177call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1178choice
1179+0.542035460, +0.212759912, +0.542035460, +0.272744000, +0.542035460, +0.212759912, +0.500072122, +0.212759912, +0.500072122, +0.542035460, +0.212759912
1180count = getUnifRand(1, size(array))
1181count
1182+2
1183call setResized(choice, count)
1184call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1185choice
1186+0.674435914, +0.209212005
1187
1188array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1189array
1190+0.817958593, +0.810731232, +0.347444177, +0.632826984, +0.513516903, +0.459485412, +0.868218660, +0.655239224E-1
1191call setResized(choice, 1)
1192choice = [getChoice(array)]
1193choice
1194+0.817958593
1195count = getUnifRand(1, 2 * size(array))
1196count
1197+16
1198call setResized(choice, count)
1199call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1200choice
1201+0.868218660, +0.868218660, +0.459485412, +0.868218660, +0.810731232, +0.810731232, +0.817958593, +0.817958593, +0.810731232, +0.817958593, +0.459485412, +0.655239224E-1, +0.810731232, +0.868218660, +0.459485412, +0.868218660
1202count = getUnifRand(1, size(array))
1203count
1204+1
1205call setResized(choice, count)
1206call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1207choice
1208+0.817958593
1209
1210array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1211array
1212+0.507107735, +0.395252705E-1, +0.651863039, +0.903864682, +0.711727619, +0.165923178, +0.956228971, +0.481013060
1213call setResized(choice, 1)
1214choice = [getChoice(array)]
1215choice
1216+0.711727619
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.651863039
1224count = getUnifRand(1, size(array))
1225count
1226+4
1227call setResized(choice, count)
1228call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1229choice
1230+0.165923178, +0.651863039, +0.507107735, +0.956228971
1231
1232array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1233array
1234+0.703804195, +0.794124484, +0.746079087, +0.716942549, +0.510469317, +0.549602509E-2
1235call setResized(choice, 1)
1236choice = [getChoice(array)]
1237choice
1238+0.746079087
1239count = getUnifRand(1, 2 * size(array))
1240count
1241+9
1242call setResized(choice, count)
1243call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1244choice
1245+0.746079087, +0.716942549, +0.716942549, +0.794124484, +0.703804195, +0.716942549, +0.510469317, +0.703804195, +0.746079087
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.794124484, +0.716942549, +0.703804195, +0.510469317, +0.549602509E-2
1253
1254array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1255array
1256+0.436637223, +0.354460001, +0.532404900, +0.172308266, +0.509119272, +0.290030122, +0.881297112, +0.365168035, +0.453315377E-1
1257call setResized(choice, 1)
1258choice = [getChoice(array)]
1259choice
1260+0.453315377E-1
1261count = getUnifRand(1, 2 * size(array))
1262count
1263+6
1264call setResized(choice, count)
1265call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1266choice
1267+0.365168035, +0.509119272, +0.436637223, +0.881297112, +0.290030122, +0.509119272
1268count = getUnifRand(1, size(array))
1269count
1270+7
1271call setResized(choice, count)
1272call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1273choice
1274+0.436637223, +0.881297112, +0.354460001, +0.509119272, +0.365168035, +0.532404900, +0.172308266
1275
1276array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1277array
1278+0.552093983E-2, +0.798992217, +0.541488349, +0.170797706, +0.277688682, +0.856067657, +0.542280078, +0.138058603
1279call setResized(choice, 1)
1280choice = [getChoice(array)]
1281choice
1282+0.542280078
1283count = getUnifRand(1, 2 * size(array))
1284count
1285+3
1286call setResized(choice, count)
1287call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1288choice
1289+0.856067657, +0.798992217, +0.277688682
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.138058603, +0.552093983E-2, +0.856067657, +0.798992217, +0.542280078, +0.541488349
1297
1298array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1299array
1300+0.485218287, +0.307595134E-1, +0.187106550, +0.218165338, +0.972974896E-1, +0.176458120, +0.756195545, +0.220587730, +0.295909464
1301call setResized(choice, 1)
1302choice = [getChoice(array)]
1303choice
1304+0.756195545
1305count = getUnifRand(1, 2 * size(array))
1306count
1307+16
1308call setResized(choice, count)
1309call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1310choice
1311+0.485218287, +0.176458120, +0.220587730, +0.295909464, +0.972974896E-1, +0.972974896E-1, +0.972974896E-1, +0.295909464, +0.218165338, +0.485218287, +0.187106550, +0.218165338, +0.295909464, +0.972974896E-1, +0.218165338, +0.187106550
1312count = getUnifRand(1, size(array))
1313count
1314+6
1315call setResized(choice, count)
1316call setChoice(rng, choice, array, unique = .true._LK) ! draw randomly only `count` elements without replacement.
1317choice
1318+0.307595134E-1, +0.220587730, +0.756195545, +0.187106550, +0.972974896E-1, +0.485218287
1319
1320array = getUnifRand(0., 1., getUnifRand(4, 10)) ! generate random array for illustration.
1321array
1322+0.643148303, +0.145064831, +0.308965266, +0.347774327
1323call setResized(choice, 1)
1324choice = [getChoice(array)]
1325choice
1326+0.643148303
1327count = getUnifRand(1, 2 * size(array))
1328count
1329+8
1330call setResized(choice, count)
1331call setChoice(rng, choice, array) ! draw randomly only `count` elements with replacement.
1332choice
1333+0.145064831, +0.308965266, +0.145064831, +0.347774327, +0.308965266, +0.145064831, +0.308965266, +0.145064831
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.145064831, +0.308965266, +0.643148303
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: