mslv.F 789 B

1234567891011121314151617181920212223242526272829303132333435
  1. SUBROUTINE MSLV(MO,N,M,A,KA,B,KB,DET,RCOND,IERR,IPVT,WK)
  2. C ------------------
  3. REAL A(KA,N),B(*)
  4. REAL DET(2),RCOND,T,WK(N)
  5. INTEGER IPVT(N),ONEJ
  6. C ------------------
  7. C
  8. C MATRIX FACTORIZATION AND COMPUTATION OF RCOND
  9. C
  10. IERR = 0
  11. CALL SGECO(A,KA,N,IPVT,RCOND,WK)
  12. T = 1.0 + RCOND
  13. IF (T .EQ. 1.0) GO TO 30
  14. C
  15. C SOLUTION OF THE EQUATION AX=B
  16. C
  17. IF (M .LT. 1) GO TO 20
  18. ONEJ = 1
  19. DO 10 J=1,M
  20. CALL SGESL(A,KA,N,IPVT,B(ONEJ),0)
  21. 10 ONEJ = ONEJ + KB
  22. C
  23. C CALCULATION OF DET AND THE INVERSE OF A
  24. C
  25. 20 JOB = 10
  26. IF (MO .EQ. 0) JOB = 11
  27. CALL SGEDI(A,KA,N,IPVT,DET,WK,JOB)
  28. RETURN
  29. C
  30. C THE PROBLEM CANNOT BE SOLVED
  31. C
  32. 30 IERR = 1
  33. RETURN
  34. END