perm23
C PERM23 SOURCE BP208322 16/06/27 21:16:22 8990 C C SEARCH FOR THE INITIAL DUAL AND PARTIAL PRIMAL SOLUTIONS. C C P(I) = FIRST UNSCANNED COLUMN OF ROW I . C IMPLICIT INTEGER(I-N) IMPLICIT REAL*8(A-H,O-Z) INTEGER A(N,N),F(N) INTEGER U(N),V(N),FB(N),P(N),R C PHASE 1 . M = 0 DO 10 K=1,N F(K) = 0 FB(K) = 0 10 CONTINUE C SCANNING OF THE COLUMNS ( INITIALIZATION OF V(J) ). DO 40 J=1,N MIN = INF DO 30 I=1,N IA = A(I,J) IF ( IA .GT. MIN ) GO TO 30 IF ( IA .LT. MIN ) GO TO 20 IF ( F(I) .NE. 0 ) GO TO 30 20 MIN = IA R = I 30 CONTINUE V(J) = MIN IF ( F(R) .NE. 0 ) GO TO 40 C ASSIGNMENT OF COLUMN J TO ROW R . M = M + 1 FB(J) = R F(R) = J U(R) = 0 P(R) = J + 1 40 CONTINUE C PHASE 2 . C SCANNING OF THE UNASSIGNED ROWS ( UPDATING OF U(I) ). DO 110 I=1,N IF ( F(I) .NE. 0 ) GO TO 110 MIN = INF DO 60 K=1,N IA = A(I,K) - V(K) IF ( IA .GT. MIN ) GO TO 60 IF ( IA .LT. MIN ) GO TO 50 IF ( FB(K) .NE. 0 ) GO TO 60 IF ( FB(J) .EQ. 0 ) GO TO 60 50 MIN = IA J = K 60 CONTINUE U(I) = MIN JMIN = J IF ( FB(J) .EQ. 0 ) GO TO 100 DO 80 J=JMIN,N IF ( A(I,J) - V(J) .GT. MIN ) GO TO 80 R = FB(J) KK = P(R) IF ( KK .GT. N ) GO TO 80 DO 70 K=KK,N IF ( FB(K) .GT. 0 ) GO TO 70 IF ( A(R,K) - U(R) - V(K) .EQ. 0 ) GO TO 90 70 CONTINUE P(R) = N + 1 80 CONTINUE GO TO 110 C REASSIGNMENT OF ROW R AND COLUMN K . 90 F(R) = K FB(K) = R P(R) = K + 1 C ASSIGNMENT OF COLUMN J TO ROW I . 100 M = M + 1 F(I) = J FB(J)= I P(I) = J + 1 110 CONTINUE RETURN END
© Cast3M 2003 - Tous droits réservés.
Mentions légales