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.

dlarmm.f 2.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. *> \brief \b DLARMM
  2. *
  3. * Definition:
  4. * ===========
  5. *
  6. * DOUBLE PRECISION FUNCTION DLARMM( ANORM, BNORM, CNORM )
  7. *
  8. * .. Scalar Arguments ..
  9. * DOUBLE PRECISION ANORM, BNORM, CNORM
  10. * ..
  11. *
  12. *> \par Purpose:
  13. * =======
  14. *>
  15. *> \verbatim
  16. *>
  17. *> DLARMM returns a factor s in (0, 1] such that the linear updates
  18. *>
  19. *> (s * C) - A * (s * B) and (s * C) - (s * A) * B
  20. *>
  21. *> cannot overflow, where A, B, and C are matrices of conforming
  22. *> dimensions.
  23. *>
  24. *> This is an auxiliary routine so there is no argument checking.
  25. *> \endverbatim
  26. *
  27. * Arguments:
  28. * =========
  29. *
  30. *> \param[in] ANORM
  31. *> \verbatim
  32. *> ANORM is DOUBLE PRECISION
  33. *> The infinity norm of A. ANORM >= 0.
  34. *> The number of rows of the matrix A. M >= 0.
  35. *> \endverbatim
  36. *>
  37. *> \param[in] BNORM
  38. *> \verbatim
  39. *> BNORM is DOUBLE PRECISION
  40. *> The infinity norm of B. BNORM >= 0.
  41. *> \endverbatim
  42. *>
  43. *> \param[in] CNORM
  44. *> \verbatim
  45. *> CNORM is DOUBLE PRECISION
  46. *> The infinity norm of C. CNORM >= 0.
  47. *> \endverbatim
  48. *>
  49. *>
  50. * =====================================================================
  51. *> References:
  52. *> C. C. Kjelgaard Mikkelsen and L. Karlsson, Blocked Algorithms for
  53. *> Robust Solution of Triangular Linear Systems. In: International
  54. *> Conference on Parallel Processing and Applied Mathematics, pages
  55. *> 68--78. Springer, 2017.
  56. *>
  57. *> \ingroup OTHERauxiliary
  58. * =====================================================================
  59. DOUBLE PRECISION FUNCTION DLARMM( ANORM, BNORM, CNORM )
  60. IMPLICIT NONE
  61. * .. Scalar Arguments ..
  62. DOUBLE PRECISION ANORM, BNORM, CNORM
  63. * .. Parameters ..
  64. DOUBLE PRECISION ONE, HALF, FOUR
  65. PARAMETER ( ONE = 1.0D0, HALF = 0.5D+0, FOUR = 4.0D0 )
  66. * ..
  67. * .. Local Scalars ..
  68. DOUBLE PRECISION BIGNUM, SMLNUM
  69. * ..
  70. * .. External Functions ..
  71. DOUBLE PRECISION DLAMCH
  72. EXTERNAL DLAMCH
  73. * ..
  74. * .. Executable Statements ..
  75. *
  76. *
  77. * Determine machine dependent parameters to control overflow.
  78. *
  79. SMLNUM = DLAMCH( 'Safe minimum' ) / DLAMCH( 'Precision' )
  80. BIGNUM = ( ONE / SMLNUM ) / FOUR
  81. *
  82. * Compute a scale factor.
  83. *
  84. DLARMM = ONE
  85. IF( BNORM .LE. ONE ) THEN
  86. IF( ANORM * BNORM .GT. BIGNUM - CNORM ) THEN
  87. DLARMM = HALF
  88. END IF
  89. ELSE
  90. IF( ANORM .GT. (BIGNUM - CNORM) / BNORM ) THEN
  91. DLARMM = HALF / BNORM
  92. END IF
  93. END IF
  94. RETURN
  95. *
  96. * ==== End of DLARMM ====
  97. *
  98. END