wnlt2.f 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. *DECK WNLT2
  2. LOGICAL FUNCTION WNLT2 (ME, MEND, IR, FACTOR, TAU, SCALE, WIC)
  3. C***BEGIN PROLOGUE WNLT2
  4. C***SUBSIDIARY
  5. C***PURPOSE Subsidiary to WNLIT
  6. C***LIBRARY SLATEC
  7. C***TYPE SINGLE 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 WNILT
  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***END PROLOGUE WNLT2
  36. REAL FACTOR, SCALE(*), TAU, WIC(*)
  37. INTEGER IR, ME, MEND
  38. C
  39. REAL RN, SN, T
  40. INTEGER J
  41. C
  42. C***FIRST EXECUTABLE STATEMENT WNLT2
  43. SN = 0.E0
  44. RN = 0.E0
  45. DO 10 J=1,MEND
  46. T = SCALE(J)
  47. IF (J.LE.ME) T = T/FACTOR
  48. T = T*WIC(J)**2
  49. C
  50. IF (J.LT.IR) THEN
  51. SN = SN + T
  52. ELSE
  53. RN = RN + T
  54. ENDIF
  55. 10 CONTINUE
  56. WNLT2 = RN .GT. SN*TAU**2
  57. RETURN
  58. END