SUBROUTINE C8S(N,K,L,T,A,IA,B,D,Z,ZZ,IER) c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c This is a check routine for Benchmark #8, part b, large sparse c matrices. It will verify that the Lg Path Probability is c correct for the path given in B. c c Parameters: c c Provided by the calling routine: c N = The size of the A matrices c K = The number of A matrices c L = Number of non-zeros in each row and column of each A c matrix c T = The length of D, and one less than the length of B c A = K long array of N by N matrices, packed into N by L c arrays. c IA = N by L array of indices for the packing of A c B = T+1 long array containing the best path c D = T long array of integers between 1 and K used to c select the appropriate A matrix. c Z = The probability of this path c ZZ = Expected probability of path c c Returned by this routine: c c IER = Error code c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c An allowable difference in score PARAMETER (DELTA=.00002) c INTEGER T, IER INTEGER B(0:T) INTEGER D(T) REAL A(N,L,K) INTEGER IA(N,L) c C--CVS variable declaration TYPE CVS sequence character( 160 ) string integer stringend END TYPE CVS C--CVS initilaize variables TYPE( CVS ),save :: CVS_INFO = \$ CVS("BMARKGRP \$Date: 2005/01/07 23:07:10 \$ \$Revision: 1.2 \$" // \$ "\$RCSfile: c8s.f,v \$ \$Name: rel_5 \$", 0) c IER = 0 c First check the score ZZ = 0 DO 20 I=1,T DO 10 J=1,L IF(IA(B(I),J) .EQ. B(I-1)) THEN ZZ = ZZ + A(B(I),J,D(I)) GOTO 20 ENDIF 10 CONTINUE c c Error in described path. Invalid transition on step I IER = 1 RETURN c 20 CONTINUE c c Check for error in Path Probability IF(ABS(Z/ZZ - 1) .GT. DELTA) THEN IER = 2 RETURN ENDIF c c Path Probability ok RETURN END