Forgot to load lapack in a few examples
[maxima.git] / share / odepack / fortran / cntnzu.f
blob62d9a44cb3bd7d4e714c8f0e2e8b7fd488d09686
1 *DECK CNTNZU
2 SUBROUTINE CNTNZU (N, IA, JA, NZSUT)
3 INTEGER N, IA, JA, NZSUT
4 DIMENSION IA(*), JA(*)
5 C-----------------------------------------------------------------------
6 C This routine counts the number of nonzero elements in the strict
7 C upper triangle of the matrix M + M(transpose), where the sparsity
8 C structure of M is given by pointer arrays IA and JA.
9 C This is needed to compute the storage requirements for the
10 C sparse matrix reordering operation in ODRV.
11 C-----------------------------------------------------------------------
12 INTEGER II, JJ, J, JMIN, JMAX, K, KMIN, KMAX, NUM
14 NUM = 0
15 DO 50 II = 1,N
16 JMIN = IA(II)
17 JMAX = IA(II+1) - 1
18 IF (JMIN .GT. JMAX) GO TO 50
19 DO 40 J = JMIN,JMAX
20 IF (JA(J) - II) 10, 40, 30
21 10 JJ =JA(J)
22 KMIN = IA(JJ)
23 KMAX = IA(JJ+1) - 1
24 IF (KMIN .GT. KMAX) GO TO 30
25 DO 20 K = KMIN,KMAX
26 IF (JA(K) .EQ. II) GO TO 40
27 20 CONTINUE
28 30 NUM = NUM + 1
29 40 CONTINUE
30 50 CONTINUE
31 NZSUT = NUM
32 RETURN
33 C----------------------- End of Subroutine CNTNZU ----------------------
34 END