      SUBROUTINE RMLT(A,IA,JA,B,IB,JB,C,IC,JC,L,M,N,X,IX,NUM,IERR)
      REAL A(1),B(1),C(1),X(N)
      INTEGER IA(1),JA(1),IB(1),JB(1),IC(1),JC(1),IX(N)
C     --------------------
      IP = 1
      DO 10 K=1,N
   10 IX(K) = 0
C
C        COMPUTE THE I-TH ROW OF C
C
      DO 31 I=1,L
      IC(I) = IP
      JPMIN = IA(I)
      JPMAX = IA(I+1)-1
      IF (JPMIN.GT.JPMAX) GO TO 31
C
      DO 22 JP=JPMIN,JPMAX
      J = JA(JP)
      KPMIN = IB(J)
      KPMAX = IB(J+1)-1
      IF (KPMIN.GT.KPMAX) GO TO 22
C
      DO 21 KP=KPMIN,KPMAX
      K = JB(KP)
      IF (IX(K).EQ.I) GO TO 20
      IX(K) = I
      X(K) = A(JP)*B(KP)
      GO TO 21
   20 X(K) = X(K)+A(JP)*B(KP)
   21 CONTINUE
   22 CONTINUE
C
      DO 30 K=1,N
      IF (IX(K).NE.I) GO TO 30
      IF (X(K).EQ.0.0) GO TO 30
      IF (IP.GT.NUM) GO TO 40
      JC(IP) = K
      C(IP) = X(K)
      IP = IP+1
   30 CONTINUE
   31 CONTINUE
C
C        COMPLETE COMPUTATION
C
      IC(L+1) = IP
      IERR = 0
      RETURN
C
C           ERROR RETURN
C
   40 IERR = I
      RETURN
      END
