File:  [local] / rpl / lapack / lapack / zlantr.f
Revision 1.11: download - view: text, annotated - select for diffs - revision graph
Fri Dec 14 12:30:32 2012 UTC (11 years, 5 months ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Mise à jour de Lapack vers la version 3.4.2 et des scripts de compilation
pour rplcas. En particulier, le Makefile.am de giac a été modifié pour ne
compiler que le répertoire src.

    1: *> \brief \b ZLANTR returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a trapezoidal or triangular matrix.
    2: *
    3: *  =========== DOCUMENTATION ===========
    4: *
    5: * Online html documentation available at 
    6: *            http://www.netlib.org/lapack/explore-html/ 
    7: *
    8: *> \htmlonly
    9: *> Download ZLANTR + dependencies 
   10: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlantr.f"> 
   11: *> [TGZ]</a> 
   12: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlantr.f"> 
   13: *> [ZIP]</a> 
   14: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlantr.f"> 
   15: *> [TXT]</a>
   16: *> \endhtmlonly 
   17: *
   18: *  Definition:
   19: *  ===========
   20: *
   21: *       DOUBLE PRECISION FUNCTION ZLANTR( NORM, UPLO, DIAG, M, N, A, LDA,
   22: *                        WORK )
   23:    24: *       .. Scalar Arguments ..
   25: *       CHARACTER          DIAG, NORM, UPLO
   26: *       INTEGER            LDA, M, N
   27: *       ..
   28: *       .. Array Arguments ..
   29: *       DOUBLE PRECISION   WORK( * )
   30: *       COMPLEX*16         A( LDA, * )
   31: *       ..
   32: *  
   33: *
   34: *> \par Purpose:
   35: *  =============
   36: *>
   37: *> \verbatim
   38: *>
   39: *> ZLANTR  returns the value of the one norm,  or the Frobenius norm, or
   40: *> the  infinity norm,  or the  element of  largest absolute value  of a
   41: *> trapezoidal or triangular matrix A.
   42: *> \endverbatim
   43: *>
   44: *> \return ZLANTR
   45: *> \verbatim
   46: *>
   47: *>    ZLANTR = ( max(abs(A(i,j))), NORM = 'M' or 'm'
   48: *>             (
   49: *>             ( norm1(A),         NORM = '1', 'O' or 'o'
   50: *>             (
   51: *>             ( normI(A),         NORM = 'I' or 'i'
   52: *>             (
   53: *>             ( normF(A),         NORM = 'F', 'f', 'E' or 'e'
   54: *>
   55: *> where  norm1  denotes the  one norm of a matrix (maximum column sum),
   56: *> normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
   57: *> normF  denotes the  Frobenius norm of a matrix (square root of sum of
   58: *> squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.
   59: *> \endverbatim
   60: *
   61: *  Arguments:
   62: *  ==========
   63: *
   64: *> \param[in] NORM
   65: *> \verbatim
   66: *>          NORM is CHARACTER*1
   67: *>          Specifies the value to be returned in ZLANTR as described
   68: *>          above.
   69: *> \endverbatim
   70: *>
   71: *> \param[in] UPLO
   72: *> \verbatim
   73: *>          UPLO is CHARACTER*1
   74: *>          Specifies whether the matrix A is upper or lower trapezoidal.
   75: *>          = 'U':  Upper trapezoidal
   76: *>          = 'L':  Lower trapezoidal
   77: *>          Note that A is triangular instead of trapezoidal if M = N.
   78: *> \endverbatim
   79: *>
   80: *> \param[in] DIAG
   81: *> \verbatim
   82: *>          DIAG is CHARACTER*1
   83: *>          Specifies whether or not the matrix A has unit diagonal.
   84: *>          = 'N':  Non-unit diagonal
   85: *>          = 'U':  Unit diagonal
   86: *> \endverbatim
   87: *>
   88: *> \param[in] M
   89: *> \verbatim
   90: *>          M is INTEGER
   91: *>          The number of rows of the matrix A.  M >= 0, and if
   92: *>          UPLO = 'U', M <= N.  When M = 0, ZLANTR is set to zero.
   93: *> \endverbatim
   94: *>
   95: *> \param[in] N
   96: *> \verbatim
   97: *>          N is INTEGER
   98: *>          The number of columns of the matrix A.  N >= 0, and if
   99: *>          UPLO = 'L', N <= M.  When N = 0, ZLANTR is set to zero.
  100: *> \endverbatim
  101: *>
  102: *> \param[in] A
  103: *> \verbatim
  104: *>          A is COMPLEX*16 array, dimension (LDA,N)
  105: *>          The trapezoidal matrix A (A is triangular if M = N).
  106: *>          If UPLO = 'U', the leading m by n upper trapezoidal part of
  107: *>          the array A contains the upper trapezoidal matrix, and the
  108: *>          strictly lower triangular part of A is not referenced.
  109: *>          If UPLO = 'L', the leading m by n lower trapezoidal part of
  110: *>          the array A contains the lower trapezoidal matrix, and the
  111: *>          strictly upper triangular part of A is not referenced.  Note
  112: *>          that when DIAG = 'U', the diagonal elements of A are not
  113: *>          referenced and are assumed to be one.
  114: *> \endverbatim
  115: *>
  116: *> \param[in] LDA
  117: *> \verbatim
  118: *>          LDA is INTEGER
  119: *>          The leading dimension of the array A.  LDA >= max(M,1).
  120: *> \endverbatim
  121: *>
  122: *> \param[out] WORK
  123: *> \verbatim
  124: *>          WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
  125: *>          where LWORK >= M when NORM = 'I'; otherwise, WORK is not
  126: *>          referenced.
  127: *> \endverbatim
  128: *
  129: *  Authors:
  130: *  ========
  131: *
  132: *> \author Univ. of Tennessee 
  133: *> \author Univ. of California Berkeley 
  134: *> \author Univ. of Colorado Denver 
  135: *> \author NAG Ltd. 
  136: *
  137: *> \date September 2012
  138: *
  139: *> \ingroup complex16OTHERauxiliary
  140: *
  141: *  =====================================================================
  142:       DOUBLE PRECISION FUNCTION ZLANTR( NORM, UPLO, DIAG, M, N, A, LDA,
  143:      $                 WORK )
  144: *
  145: *  -- LAPACK auxiliary routine (version 3.4.2) --
  146: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
  147: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  148: *     September 2012
  149: *
  150: *     .. Scalar Arguments ..
  151:       CHARACTER          DIAG, NORM, UPLO
  152:       INTEGER            LDA, M, N
  153: *     ..
  154: *     .. Array Arguments ..
  155:       DOUBLE PRECISION   WORK( * )
  156:       COMPLEX*16         A( LDA, * )
  157: *     ..
  158: *
  159: * =====================================================================
  160: *
  161: *     .. Parameters ..
  162:       DOUBLE PRECISION   ONE, ZERO
  163:       PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
  164: *     ..
  165: *     .. Local Scalars ..
  166:       LOGICAL            UDIAG
  167:       INTEGER            I, J
  168:       DOUBLE PRECISION   SCALE, SUM, VALUE
  169: *     ..
  170: *     .. External Functions ..
  171:       LOGICAL            LSAME, DISNAN
  172:       EXTERNAL           LSAME, DISNAN
  173: *     ..
  174: *     .. External Subroutines ..
  175:       EXTERNAL           ZLASSQ
  176: *     ..
  177: *     .. Intrinsic Functions ..
  178:       INTRINSIC          ABS, MIN, SQRT
  179: *     ..
  180: *     .. Executable Statements ..
  181: *
  182:       IF( MIN( M, N ).EQ.0 ) THEN
  183:          VALUE = ZERO
  184:       ELSE IF( LSAME( NORM, 'M' ) ) THEN
  185: *
  186: *        Find max(abs(A(i,j))).
  187: *
  188:          IF( LSAME( DIAG, 'U' ) ) THEN
  189:             VALUE = ONE
  190:             IF( LSAME( UPLO, 'U' ) ) THEN
  191:                DO 20 J = 1, N
  192:                   DO 10 I = 1, MIN( M, J-1 )
  193:                      SUM = ABS( A( I, J ) )
  194:                      IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
  195:    10             CONTINUE
  196:    20          CONTINUE
  197:             ELSE
  198:                DO 40 J = 1, N
  199:                   DO 30 I = J + 1, M
  200:                      SUM = ABS( A( I, J ) )
  201:                      IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
  202:    30             CONTINUE
  203:    40          CONTINUE
  204:             END IF
  205:          ELSE
  206:             VALUE = ZERO
  207:             IF( LSAME( UPLO, 'U' ) ) THEN
  208:                DO 60 J = 1, N
  209:                   DO 50 I = 1, MIN( M, J )
  210:                      SUM = ABS( A( I, J ) )
  211:                      IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
  212:    50             CONTINUE
  213:    60          CONTINUE
  214:             ELSE
  215:                DO 80 J = 1, N
  216:                   DO 70 I = J, M
  217:                      SUM = ABS( A( I, J ) )
  218:                      IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
  219:    70             CONTINUE
  220:    80          CONTINUE
  221:             END IF
  222:          END IF
  223:       ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN
  224: *
  225: *        Find norm1(A).
  226: *
  227:          VALUE = ZERO
  228:          UDIAG = LSAME( DIAG, 'U' )
  229:          IF( LSAME( UPLO, 'U' ) ) THEN
  230:             DO 110 J = 1, N
  231:                IF( ( UDIAG ) .AND. ( J.LE.M ) ) THEN
  232:                   SUM = ONE
  233:                   DO 90 I = 1, J - 1
  234:                      SUM = SUM + ABS( A( I, J ) )
  235:    90             CONTINUE
  236:                ELSE
  237:                   SUM = ZERO
  238:                   DO 100 I = 1, MIN( M, J )
  239:                      SUM = SUM + ABS( A( I, J ) )
  240:   100             CONTINUE
  241:                END IF
  242:                IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
  243:   110       CONTINUE
  244:          ELSE
  245:             DO 140 J = 1, N
  246:                IF( UDIAG ) THEN
  247:                   SUM = ONE
  248:                   DO 120 I = J + 1, M
  249:                      SUM = SUM + ABS( A( I, J ) )
  250:   120             CONTINUE
  251:                ELSE
  252:                   SUM = ZERO
  253:                   DO 130 I = J, M
  254:                      SUM = SUM + ABS( A( I, J ) )
  255:   130             CONTINUE
  256:                END IF
  257:                IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
  258:   140       CONTINUE
  259:          END IF
  260:       ELSE IF( LSAME( NORM, 'I' ) ) THEN
  261: *
  262: *        Find normI(A).
  263: *
  264:          IF( LSAME( UPLO, 'U' ) ) THEN
  265:             IF( LSAME( DIAG, 'U' ) ) THEN
  266:                DO 150 I = 1, M
  267:                   WORK( I ) = ONE
  268:   150          CONTINUE
  269:                DO 170 J = 1, N
  270:                   DO 160 I = 1, MIN( M, J-1 )
  271:                      WORK( I ) = WORK( I ) + ABS( A( I, J ) )
  272:   160             CONTINUE
  273:   170          CONTINUE
  274:             ELSE
  275:                DO 180 I = 1, M
  276:                   WORK( I ) = ZERO
  277:   180          CONTINUE
  278:                DO 200 J = 1, N
  279:                   DO 190 I = 1, MIN( M, J )
  280:                      WORK( I ) = WORK( I ) + ABS( A( I, J ) )
  281:   190             CONTINUE
  282:   200          CONTINUE
  283:             END IF
  284:          ELSE
  285:             IF( LSAME( DIAG, 'U' ) ) THEN
  286:                DO 210 I = 1, N
  287:                   WORK( I ) = ONE
  288:   210          CONTINUE
  289:                DO 220 I = N + 1, M
  290:                   WORK( I ) = ZERO
  291:   220          CONTINUE
  292:                DO 240 J = 1, N
  293:                   DO 230 I = J + 1, M
  294:                      WORK( I ) = WORK( I ) + ABS( A( I, J ) )
  295:   230             CONTINUE
  296:   240          CONTINUE
  297:             ELSE
  298:                DO 250 I = 1, M
  299:                   WORK( I ) = ZERO
  300:   250          CONTINUE
  301:                DO 270 J = 1, N
  302:                   DO 260 I = J, M
  303:                      WORK( I ) = WORK( I ) + ABS( A( I, J ) )
  304:   260             CONTINUE
  305:   270          CONTINUE
  306:             END IF
  307:          END IF
  308:          VALUE = ZERO
  309:          DO 280 I = 1, M
  310:             SUM = WORK( I )
  311:             IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM
  312:   280    CONTINUE
  313:       ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
  314: *
  315: *        Find normF(A).
  316: *
  317:          IF( LSAME( UPLO, 'U' ) ) THEN
  318:             IF( LSAME( DIAG, 'U' ) ) THEN
  319:                SCALE = ONE
  320:                SUM = MIN( M, N )
  321:                DO 290 J = 2, N
  322:                   CALL ZLASSQ( MIN( M, J-1 ), A( 1, J ), 1, SCALE, SUM )
  323:   290          CONTINUE
  324:             ELSE
  325:                SCALE = ZERO
  326:                SUM = ONE
  327:                DO 300 J = 1, N
  328:                   CALL ZLASSQ( MIN( M, J ), A( 1, J ), 1, SCALE, SUM )
  329:   300          CONTINUE
  330:             END IF
  331:          ELSE
  332:             IF( LSAME( DIAG, 'U' ) ) THEN
  333:                SCALE = ONE
  334:                SUM = MIN( M, N )
  335:                DO 310 J = 1, N
  336:                   CALL ZLASSQ( M-J, A( MIN( M, J+1 ), J ), 1, SCALE,
  337:      $                         SUM )
  338:   310          CONTINUE
  339:             ELSE
  340:                SCALE = ZERO
  341:                SUM = ONE
  342:                DO 320 J = 1, N
  343:                   CALL ZLASSQ( M-J+1, A( J, J ), 1, SCALE, SUM )
  344:   320          CONTINUE
  345:             END IF
  346:          END IF
  347:          VALUE = SCALE*SQRT( SUM )
  348:       END IF
  349: *
  350:       ZLANTR = VALUE
  351:       RETURN
  352: *
  353: *     End of ZLANTR
  354: *
  355:       END

CVSweb interface <joel.bertrand@systella.fr>