You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

sla_gerpvgrw.f 3.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. *> \brief \b SLA_GERPVGRW
  2. *
  3. * =========== DOCUMENTATION ===========
  4. *
  5. * Online html documentation available at
  6. * http://www.netlib.org/lapack/explore-html/
  7. *
  8. *> \htmlonly
  9. *> Download SLA_GERPVGRW + dependencies
  10. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/sla_gerpvgrw.f">
  11. *> [TGZ]</a>
  12. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/sla_gerpvgrw.f">
  13. *> [ZIP]</a>
  14. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sla_gerpvgrw.f">
  15. *> [TXT]</a>
  16. *> \endhtmlonly
  17. *
  18. * Definition:
  19. * ===========
  20. *
  21. * REAL FUNCTION SLA_GERPVGRW( N, NCOLS, A, LDA, AF, LDAF )
  22. *
  23. * .. Scalar Arguments ..
  24. * INTEGER N, NCOLS, LDA, LDAF
  25. * ..
  26. * .. Array Arguments ..
  27. * REAL A( LDA, * ), AF( LDAF, * )
  28. * ..
  29. *
  30. *
  31. *> \par Purpose:
  32. * =============
  33. *>
  34. *> \verbatim
  35. *>
  36. *> SLA_GERPVGRW computes the reciprocal pivot growth factor
  37. *> norm(A)/norm(U). The "max absolute element" norm is used. If this is
  38. *> much less than 1, the stability of the LU factorization of the
  39. *> (equilibrated) matrix A could be poor. This also means that the
  40. *> solution X, estimated condition numbers, and error bounds could be
  41. *> unreliable.
  42. *> \endverbatim
  43. *
  44. * Arguments:
  45. * ==========
  46. *
  47. *> \param[in] N
  48. *> \verbatim
  49. *> N is INTEGER
  50. *> The number of linear equations, i.e., the order of the
  51. *> matrix A. N >= 0.
  52. *> \endverbatim
  53. *>
  54. *> \param[in] NCOLS
  55. *> \verbatim
  56. *> NCOLS is INTEGER
  57. *> The number of columns of the matrix A. NCOLS >= 0.
  58. *> \endverbatim
  59. *>
  60. *> \param[in] A
  61. *> \verbatim
  62. *> A is REAL array, dimension (LDA,N)
  63. *> On entry, the N-by-N matrix A.
  64. *> \endverbatim
  65. *>
  66. *> \param[in] LDA
  67. *> \verbatim
  68. *> LDA is INTEGER
  69. *> The leading dimension of the array A. LDA >= max(1,N).
  70. *> \endverbatim
  71. *>
  72. *> \param[in] AF
  73. *> \verbatim
  74. *> AF is REAL array, dimension (LDAF,N)
  75. *> The factors L and U from the factorization
  76. *> A = P*L*U as computed by SGETRF.
  77. *> \endverbatim
  78. *>
  79. *> \param[in] LDAF
  80. *> \verbatim
  81. *> LDAF is INTEGER
  82. *> The leading dimension of the array AF. LDAF >= max(1,N).
  83. *> \endverbatim
  84. *
  85. * Authors:
  86. * ========
  87. *
  88. *> \author Univ. of Tennessee
  89. *> \author Univ. of California Berkeley
  90. *> \author Univ. of Colorado Denver
  91. *> \author NAG Ltd.
  92. *
  93. *> \ingroup realGEcomputational
  94. *
  95. * =====================================================================
  96. REAL FUNCTION SLA_GERPVGRW( N, NCOLS, A, LDA, AF, LDAF )
  97. *
  98. * -- LAPACK computational routine --
  99. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  100. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  101. *
  102. * .. Scalar Arguments ..
  103. INTEGER N, NCOLS, LDA, LDAF
  104. * ..
  105. * .. Array Arguments ..
  106. REAL A( LDA, * ), AF( LDAF, * )
  107. * ..
  108. *
  109. * =====================================================================
  110. *
  111. * .. Local Scalars ..
  112. INTEGER I, J
  113. REAL AMAX, UMAX, RPVGRW
  114. * ..
  115. * .. Intrinsic Functions ..
  116. INTRINSIC ABS, MAX, MIN
  117. * ..
  118. * .. Executable Statements ..
  119. *
  120. RPVGRW = 1.0
  121. DO J = 1, NCOLS
  122. AMAX = 0.0
  123. UMAX = 0.0
  124. DO I = 1, N
  125. AMAX = MAX( ABS( A( I, J ) ), AMAX )
  126. END DO
  127. DO I = 1, J
  128. UMAX = MAX( ABS( AF( I, J ) ), UMAX )
  129. END DO
  130. IF ( UMAX /= 0.0 ) THEN
  131. RPVGRW = MIN( AMAX / UMAX, RPVGRW )
  132. END IF
  133. END DO
  134. SLA_GERPVGRW = RPVGRW
  135. *
  136. * End of SLA_GERPVGRW
  137. *
  138. END