~ubuntu-branches/debian/sid/octave3.0/sid

« back to all changes in this revision

Viewing changes to libcruft/ranlib/genprm.f

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2007-12-23 16:04:15 UTC
  • Revision ID: james.westby@ubuntu.com-20071223160415-n4gk468dihy22e9v
Tags: upstream-3.0.0
ImportĀ upstreamĀ versionĀ 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      SUBROUTINE genprm(iarray,larray)
 
2
C**********************************************************************
 
3
C
 
4
C    SUBROUTINE GENPRM( IARRAY, LARRAY )
 
5
C               GENerate random PeRMutation of iarray
 
6
C
 
7
C
 
8
C                              Arguments
 
9
C
 
10
C
 
11
C     IARRAY <--> On output IARRAY is a random permutation of its
 
12
C                 value on input
 
13
C                         INTEGER IARRAY( LARRAY )
 
14
C
 
15
C     LARRAY <--> Length of IARRAY
 
16
C                         INTEGER LARRAY
 
17
C
 
18
C**********************************************************************
 
19
C     .. Scalar Arguments ..
 
20
      INTEGER larray
 
21
C     ..
 
22
C     .. Array Arguments ..
 
23
      INTEGER iarray(larray)
 
24
C     ..
 
25
C     .. Local Scalars ..
 
26
      INTEGER i,itmp,iwhich
 
27
C     ..
 
28
C     .. External Functions ..
 
29
      INTEGER ignuin
 
30
      EXTERNAL ignuin
 
31
C     ..
 
32
C     .. Executable Statements ..
 
33
      DO 10,i = 1,larray
 
34
          iwhich = ignuin(i,larray)
 
35
          itmp = iarray(iwhich)
 
36
          iarray(iwhich) = iarray(i)
 
37
          iarray(i) = itmp
 
38
   10 CONTINUE
 
39
      RETURN
 
40
 
 
41
      END