Numérotation des lignes :

C IVPERM    SOURCE    CHAT      05/01/13    00:45:44     5004      SUBROUTINE IVPERM (N, IX, PERM)      IMPLICIT INTEGER(I-N)      IMPLICIT REAL*8 (A-H,O-Z)C***********************************************************************C NOM         : IVPERMC DESCRIPTION : Permutation d'un tableau d'entiers.CCC LANGAGE     : FORTRAN 77C ADAPTATION  :  Stéphane GOUNAND (CEA/DRN/DMT/SEMT/LTMF)C                mél : gounand@semt2.smts.cea.frC AUTEUR      :C  Sparskit : a basic tool kit for sparse matrix computationsC  Version 2 (Youcef Saad)C  -> URL : http://www.cs.umn.edu/Research/arpa/SPARSKIT/sparskit.htmlCC***********************************************************************      INTEGER N, PERM(N), IX(N)c-----------------------------------------------------------------------c this subroutine performs an in-place permutation of an integer vectorc ix according to the permutation array perm(*), i.e., on return,c the vector x satisfies,cc       ix(perm(j)) :== ix(j), j=1,2,.., ncc-----------------------------------------------------------------------c on entry:c---------c n     = length of vector x.c perm  = integer array of length n containing the permutation  array.c ix    = input vectorcc on return:c----------c ix    = vector x permuted according to ix(perm(*)) :=  ix(*)cc----------------------------------------------------------------------cc           Y. Saad, Sep. 21 1989                                      cc----------------------------------------------------------------------cc local variables      INTEGER TMP, TMP1      INTEGER II,J,K,INIT,NEXTc      INIT      = 1      TMP       = IX(INIT)      II        = PERM(INIT)      PERM(INIT)= -PERM(INIT)      K         = 0cc loopc 6    CONTINUE      K = K+1cc save the chased element --c      TMP1        = IX(II)      IX(II)     = TMP      NEXT        = PERM(II)      IF (NEXT .LT. 0 ) GOTO 65cc test for endc      IF (K .GT. N) GOTO 101      TMP       = TMP1      PERM(II)  = - PERM(II)      II        = NEXTcc end loopc      GOTO 6cc reinitialize cycle --c 65   CONTINUE      INIT      = INIT+1      IF (INIT .GT. N) GOTO 101      IF (PERM(INIT) .LT. 0) GOTO 65      TMP       = IX(INIT)      II        = PERM(INIT)      PERM(INIT)=-PERM(INIT)      GOTO 6c 101  CONTINUE      DO 200 J=1, N         PERM(J) = -PERM(J) 200  CONTINUEC      RETURNc-------------------end-of-ivperm---------------------------------------c-----------------------------------------------------------------------      END

© Cast3M 2003 - Tous droits réservés.
Mentions légales