home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
octave-1.1.1p1-src.tgz
/
tar.out
/
fsf
/
octave
/
libcruft
/
ranlib
/
genprm.f
< prev
next >
Wrap
Text File
|
1996-09-28
|
1KB
|
42 lines
SUBROUTINE genprm(iarray,larray)
C**********************************************************************
C
C SUBROUTINE GENPRM( IARRAY, LARRAY )
C GENerate random PeRMutation of iarray
C
C
C Arguments
C
C
C IARRAY <--> On output IARRAY is a random permutation of its
C value on input
C INTEGER IARRAY( LARRAY )
C
C LARRAY <--> Length of IARRAY
C INTEGER LARRAY
C
C**********************************************************************
C .. Scalar Arguments ..
INTEGER larray
C ..
C .. Array Arguments ..
INTEGER iarray(larray)
C ..
C .. Local Scalars ..
INTEGER i,itmp,iwhich
C ..
C .. External Functions ..
INTEGER ignuin
EXTERNAL ignuin
C ..
C .. Executable Statements ..
DO 10,i = 1,larray
iwhich = ignuin(i,larray)
itmp = iarray(iwhich)
iarray(iwhich) = iarray(i)
iarray(i) = itmp
10 CONTINUE
RETURN
END