File:  [local] / rpl / lapack / lapack / zlantp.f
Revision 1.19: download - view: text, annotated - select for diffs - revision graph
Mon Aug 7 08:39:30 2023 UTC (8 months, 3 weeks ago) by bertrand
Branches: MAIN
CVS tags: rpl-4_1_35, rpl-4_1_34, HEAD
Première mise à jour de lapack et blas.

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

CVSweb interface <joel.bertrand@systella.fr>