dwnlt2.f 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. *DECK DWNLT2
  2. LOGICAL FUNCTION DWNLT2 (ME, MEND, IR, FACTOR, TAU, SCALE, WIC)
  3. C***BEGIN PROLOGUE DWNLT2
  4. C***SUBSIDIARY
  5. C***PURPOSE Subsidiary to WNLIT
  6. C***LIBRARY SLATEC
  7. C***TYPE DOUBLE PRECISION (WNLT2-S, DWNLT2-D)
  8. C***AUTHOR Hanson, R. J., (SNLA)
  9. C Haskell, K. H., (SNLA)
  10. C***DESCRIPTION
  11. C
  12. C To test independence of incoming column.
  13. C
  14. C Test the column IC to determine if it is linearly independent
  15. C of the columns already in the basis. In the initial tri. step,
  16. C we usually want the heavy weight ALAMDA to be included in the
  17. C test for independence. In this case, the value of FACTOR will
  18. C have been set to 1.E0 before this procedure is invoked.
  19. C In the potentially rank deficient problem, the value of FACTOR
  20. C will have been set to ALSQ=ALAMDA**2 to remove the effect of the
  21. C heavy weight from the test for independence.
  22. C
  23. C Write new column as partitioned vector
  24. C (A1) number of components in solution so far = NIV
  25. C (A2) M-NIV components
  26. C And compute SN = inverse weighted length of A1
  27. C RN = inverse weighted length of A2
  28. C Call the column independent when RN .GT. TAU*SN
  29. C
  30. C***SEE ALSO DWNLIT
  31. C***ROUTINES CALLED (NONE)
  32. C***REVISION HISTORY (YYMMDD)
  33. C 790701 DATE WRITTEN
  34. C 890620 Code extracted from WNLIT and made a subroutine. (RWC))
  35. C 900604 DP version created from SP version. (RWC)
  36. C***END PROLOGUE DWNLT2
  37. DOUBLE PRECISION FACTOR, SCALE(*), TAU, WIC(*)
  38. INTEGER IR, ME, MEND
  39. C
  40. DOUBLE PRECISION RN, SN, T
  41. INTEGER J
  42. C
  43. C***FIRST EXECUTABLE STATEMENT DWNLT2
  44. SN = 0.E0
  45. RN = 0.E0
  46. DO 10 J=1,MEND
  47. T = SCALE(J)
  48. IF (J.LE.ME) T = T/FACTOR
  49. T = T*WIC(J)**2
  50. C
  51. IF (J.LT.IR) THEN
  52. SN = SN + T
  53. ELSE
  54. RN = RN + T
  55. ENDIF
  56. 10 CONTINUE
  57. DWNLT2 = RN .GT. SN*TAU**2
  58. RETURN
  59. END