jeudi 16 novembre 2017

Random picking in Fortran90

I want to make code that randomly picking integers or elements of array without overlap.

For example,

  1. randomly pick 10 integers between integer 1~1000 without overlap or
  2. randomly pick 10 elements of 1d-array of size 10000 without overlap

I initially think about intrinsic function 'rand' with scaling. But 9.7xx and 9.6xx is same in integer, so the overlapping occurs. Also, checking the overlapping again and again everytime when the single random number generated looks very inefficient.

I don't have any idea more.... What should I do?




Aucun commentaire:

Enregistrer un commentaire