Procedure for generating a random array index/subscripts
Generate a array of uniformally-distributed random integers in the range [1, n]
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n | Largest possible value |
||
integer, | intent(out), | dimension(:) | :: | randomi | Array of uniform deviates |
Generate an array of random indices of an 1D array distributed according to w
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=Float64), | intent(in), | dimension(:) | :: | w | 1D array of index weights |
|
integer, | intent(out), | dimension(:) | :: | randomi | Random indices |
Generate an array of random subscripts of an 2D array distributed according to w
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=Float64), | intent(in), | dimension(:,:) | :: | w | 2D array of subscript weights |
|
integer, | intent(out), | dimension(:,:) | :: | randomi | A 2D (ndim, :) array of random subscripts |