File:  [local] / rpl / lapack / lapack / zlantp.f
Revision 1.9: download - view: text, annotated - select for diffs - revision graph
Mon Nov 21 22:19:52 2011 UTC (12 years, 6 months ago) by bertrand
Branches: MAIN
CVS tags: rpl-4_1_8, rpl-4_1_7, rpl-4_1_6, rpl-4_1_5, rpl-4_1_4, HEAD
Cohérence

    1: *> \brief \b ZLANTP
    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: *> \date November 2011
  122: *
  123: *> \ingroup complex16OTHERauxiliary
  124: *
  125: *  =====================================================================
  126:       DOUBLE PRECISION FUNCTION ZLANTP( NORM, UPLO, DIAG, N, AP, WORK )
  127: *
  128: *  -- LAPACK auxiliary routine (version 3.4.0) --
  129: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
  130: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  131: *     November 2011
  132: *
  133: *     .. Scalar Arguments ..
  134:       CHARACTER          DIAG, NORM, UPLO
  135:       INTEGER            N
  136: *     ..
  137: *     .. Array Arguments ..
  138:       DOUBLE PRECISION   WORK( * )
  139:       COMPLEX*16         AP( * )
  140: *     ..
  141: *
  142: * =====================================================================
  143: *
  144: *     .. Parameters ..
  145:       DOUBLE PRECISION   ONE, ZERO
  146:       PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
  147: *     ..
  148: *     .. Local Scalars ..
  149:       LOGICAL            UDIAG
  150:       INTEGER            I, J, K
  151:       DOUBLE PRECISION   SCALE, SUM, VALUE
  152: *     ..
  153: *     .. External Functions ..
  154:       LOGICAL            LSAME
  155:       EXTERNAL           LSAME
  156: *     ..
  157: *     .. External Subroutines ..
  158:       EXTERNAL           ZLASSQ
  159: *     ..
  160: *     .. Intrinsic Functions ..
  161:       INTRINSIC          ABS, MAX, SQRT
  162: *     ..
  163: *     .. Executable Statements ..
  164: *
  165:       IF( N.EQ.0 ) THEN
  166:          VALUE = ZERO
  167:       ELSE IF( LSAME( NORM, 'M' ) ) THEN
  168: *
  169: *        Find max(abs(A(i,j))).
  170: *
  171:          K = 1
  172:          IF( LSAME( DIAG, 'U' ) ) THEN
  173:             VALUE = ONE
  174:             IF( LSAME( UPLO, 'U' ) ) THEN
  175:                DO 20 J = 1, N
  176:                   DO 10 I = K, K + J - 2
  177:                      VALUE = MAX( VALUE, ABS( AP( I ) ) )
  178:    10             CONTINUE
  179:                   K = K + J
  180:    20          CONTINUE
  181:             ELSE
  182:                DO 40 J = 1, N
  183:                   DO 30 I = K + 1, K + N - J
  184:                      VALUE = MAX( VALUE, ABS( AP( I ) ) )
  185:    30             CONTINUE
  186:                   K = K + N - J + 1
  187:    40          CONTINUE
  188:             END IF
  189:          ELSE
  190:             VALUE = ZERO
  191:             IF( LSAME( UPLO, 'U' ) ) THEN
  192:                DO 60 J = 1, N
  193:                   DO 50 I = K, K + J - 1
  194:                      VALUE = MAX( VALUE, ABS( AP( I ) ) )
  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:                      VALUE = MAX( VALUE, ABS( AP( I ) ) )
  202:    70             CONTINUE
  203:                   K = K + N - J + 1
  204:    80          CONTINUE
  205:             END IF
  206:          END IF
  207:       ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN
  208: *
  209: *        Find norm1(A).
  210: *
  211:          VALUE = ZERO
  212:          K = 1
  213:          UDIAG = LSAME( DIAG, 'U' )
  214:          IF( LSAME( UPLO, 'U' ) ) THEN
  215:             DO 110 J = 1, N
  216:                IF( UDIAG ) THEN
  217:                   SUM = ONE
  218:                   DO 90 I = K, K + J - 2
  219:                      SUM = SUM + ABS( AP( I ) )
  220:    90             CONTINUE
  221:                ELSE
  222:                   SUM = ZERO
  223:                   DO 100 I = K, K + J - 1
  224:                      SUM = SUM + ABS( AP( I ) )
  225:   100             CONTINUE
  226:                END IF
  227:                K = K + J
  228:                VALUE = MAX( VALUE, SUM )
  229:   110       CONTINUE
  230:          ELSE
  231:             DO 140 J = 1, N
  232:                IF( UDIAG ) THEN
  233:                   SUM = ONE
  234:                   DO 120 I = K + 1, K + N - J
  235:                      SUM = SUM + ABS( AP( I ) )
  236:   120             CONTINUE
  237:                ELSE
  238:                   SUM = ZERO
  239:                   DO 130 I = K, K + N - J
  240:                      SUM = SUM + ABS( AP( I ) )
  241:   130             CONTINUE
  242:                END IF
  243:                K = K + N - J + 1
  244:                VALUE = MAX( VALUE, SUM )
  245:   140       CONTINUE
  246:          END IF
  247:       ELSE IF( LSAME( NORM, 'I' ) ) THEN
  248: *
  249: *        Find normI(A).
  250: *
  251:          K = 1
  252:          IF( LSAME( UPLO, 'U' ) ) THEN
  253:             IF( LSAME( DIAG, 'U' ) ) THEN
  254:                DO 150 I = 1, N
  255:                   WORK( I ) = ONE
  256:   150          CONTINUE
  257:                DO 170 J = 1, N
  258:                   DO 160 I = 1, J - 1
  259:                      WORK( I ) = WORK( I ) + ABS( AP( K ) )
  260:                      K = K + 1
  261:   160             CONTINUE
  262:                   K = K + 1
  263:   170          CONTINUE
  264:             ELSE
  265:                DO 180 I = 1, N
  266:                   WORK( I ) = ZERO
  267:   180          CONTINUE
  268:                DO 200 J = 1, N
  269:                   DO 190 I = 1, J
  270:                      WORK( I ) = WORK( I ) + ABS( AP( K ) )
  271:                      K = K + 1
  272:   190             CONTINUE
  273:   200          CONTINUE
  274:             END IF
  275:          ELSE
  276:             IF( LSAME( DIAG, 'U' ) ) THEN
  277:                DO 210 I = 1, N
  278:                   WORK( I ) = ONE
  279:   210          CONTINUE
  280:                DO 230 J = 1, N
  281:                   K = K + 1
  282:                   DO 220 I = J + 1, N
  283:                      WORK( I ) = WORK( I ) + ABS( AP( K ) )
  284:                      K = K + 1
  285:   220             CONTINUE
  286:   230          CONTINUE
  287:             ELSE
  288:                DO 240 I = 1, N
  289:                   WORK( I ) = ZERO
  290:   240          CONTINUE
  291:                DO 260 J = 1, N
  292:                   DO 250 I = J, N
  293:                      WORK( I ) = WORK( I ) + ABS( AP( K ) )
  294:                      K = K + 1
  295:   250             CONTINUE
  296:   260          CONTINUE
  297:             END IF
  298:          END IF
  299:          VALUE = ZERO
  300:          DO 270 I = 1, N
  301:             VALUE = MAX( VALUE, WORK( I ) )
  302:   270    CONTINUE
  303:       ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
  304: *
  305: *        Find normF(A).
  306: *
  307:          IF( LSAME( UPLO, 'U' ) ) THEN
  308:             IF( LSAME( DIAG, 'U' ) ) THEN
  309:                SCALE = ONE
  310:                SUM = N
  311:                K = 2
  312:                DO 280 J = 2, N
  313:                   CALL ZLASSQ( J-1, AP( K ), 1, SCALE, SUM )
  314:                   K = K + J
  315:   280          CONTINUE
  316:             ELSE
  317:                SCALE = ZERO
  318:                SUM = ONE
  319:                K = 1
  320:                DO 290 J = 1, N
  321:                   CALL ZLASSQ( J, AP( K ), 1, SCALE, SUM )
  322:                   K = K + J
  323:   290          CONTINUE
  324:             END IF
  325:          ELSE
  326:             IF( LSAME( DIAG, 'U' ) ) THEN
  327:                SCALE = ONE
  328:                SUM = N
  329:                K = 2
  330:                DO 300 J = 1, N - 1
  331:                   CALL ZLASSQ( N-J, AP( K ), 1, SCALE, SUM )
  332:                   K = K + N - J + 1
  333:   300          CONTINUE
  334:             ELSE
  335:                SCALE = ZERO
  336:                SUM = ONE
  337:                K = 1
  338:                DO 310 J = 1, N
  339:                   CALL ZLASSQ( N-J+1, AP( K ), 1, SCALE, SUM )
  340:                   K = K + N - J + 1
  341:   310          CONTINUE
  342:             END IF
  343:          END IF
  344:          VALUE = SCALE*SQRT( SUM )
  345:       END IF
  346: *
  347:       ZLANTP = VALUE
  348:       RETURN
  349: *
  350: *     End of ZLANTP
  351: *
  352:       END

CVSweb interface <joel.bertrand@systella.fr>