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.

cla_gerpvgrw.f 4.0 kB

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