|
| 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 | +*> Contributor: |
| 52 | +*> Angelika Schwarz, Umea University, Sweden |
| 53 | +*> |
| 54 | +* ===================================================================== |
| 55 | +*> References: |
| 56 | +*> C. C. Kjelgaard Mikkelsen and L. Karlsson, Blocked Algorithms for |
| 57 | +*> Robust Solution of Triangular Linear Systems. In: International |
| 58 | +*> Conference on Parallel Processing and Applied Mathematics, pages |
| 59 | +*> 68--78. Springer, 2017. |
| 60 | +*> |
| 61 | +*> \ingroup OTHERauxiliary |
| 62 | +* ===================================================================== |
| 63 | + |
| 64 | + DOUBLE PRECISION FUNCTION DLARMM( ANORM, BNORM, CNORM ) |
| 65 | + IMPLICIT NONE |
| 66 | +* .. Scalar Arguments .. |
| 67 | + DOUBLE PRECISION ANORM, BNORM, CNORM |
| 68 | +* .. Parameters .. |
| 69 | + DOUBLE PRECISION ONE, HALF |
| 70 | + PARAMETER ( ONE = 1.0D0, HALF = 0.5D+0 ) |
| 71 | +* .. |
| 72 | +* .. Local Scalars .. |
| 73 | + DOUBLE PRECISION bignum, smlnum |
| 74 | +* .. |
| 75 | +* .. External Functions .. |
| 76 | + DOUBLE PRECISION dlamch |
| 77 | + EXTERNAL dlamch |
| 78 | +* .. |
| 79 | +* .. Executable Statements .. |
| 80 | +* |
| 81 | +* |
| 82 | +* Determine machine dependent parameters to control overflow. |
| 83 | +* |
| 84 | + SMLNUM = DLAMCH( 'Safe minimum' ) / DLAMCH( 'Precision' ) |
| 85 | + BIGNUM = ONE / SMLNUM |
| 86 | +* |
| 87 | +* Compute a scale factor. |
| 88 | +* |
| 89 | + DLARMM = ONE |
| 90 | + IF( BNORM .LE. ONE ) THEN |
| 91 | + IF( ANORM * BNORM .GT. BIGNUM - CNORM ) THEN |
| 92 | + DLARMM = HALF |
| 93 | + END IF |
| 94 | + ELSE |
| 95 | + IF( ANORM .GT. (BIGNUM - CNORM) / BNORM ) THEN |
| 96 | + DLARMM = HALF / BNORM |
| 97 | + END IF |
| 98 | + END IF |
| 99 | + RETURN |
| 100 | +* |
| 101 | +* ==== End of DLARMM ==== |
| 102 | +* |
| 103 | + END |
0 commit comments