File:  [local] / rpl / lapack / lapack / zlarfy.f
Revision 1.5: download - view: text, annotated - select for diffs - revision graph
Mon Aug 7 08:39:31 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 ZLARFY
    2: *
    3: *  =========== DOCUMENTATION ===========
    4: *
    5: * Online html documentation available at
    6: *            http://www.netlib.org/lapack/explore-html/
    7: *
    8: *  Definition:
    9: *  ===========
   10: *
   11: *       SUBROUTINE ZLARFY( UPLO, N, V, INCV, TAU, C, LDC, WORK )
   12: *
   13: *       .. Scalar Arguments ..
   14: *       CHARACTER          UPLO
   15: *       INTEGER            INCV, LDC, N
   16: *       COMPLEX*16         TAU
   17: *       ..
   18: *       .. Array Arguments ..
   19: *       COMPLEX*16         C( LDC, * ), V( * ), WORK( * )
   20: *       ..
   21: *
   22: *
   23: *> \par Purpose:
   24: *  =============
   25: *>
   26: *> \verbatim
   27: *>
   28: *> ZLARFY applies an elementary reflector, or Householder matrix, H,
   29: *> to an n x n Hermitian matrix C, from both the left and the right.
   30: *>
   31: *> H is represented in the form
   32: *>
   33: *>    H = I - tau * v * v'
   34: *>
   35: *> where  tau  is a scalar and  v  is a vector.
   36: *>
   37: *> If  tau  is  zero, then  H  is taken to be the unit matrix.
   38: *> \endverbatim
   39: *
   40: *  Arguments:
   41: *  ==========
   42: *
   43: *> \param[in] UPLO
   44: *> \verbatim
   45: *>          UPLO is CHARACTER*1
   46: *>          Specifies whether the upper or lower triangular part of the
   47: *>          Hermitian matrix C is stored.
   48: *>          = 'U':  Upper triangle
   49: *>          = 'L':  Lower triangle
   50: *> \endverbatim
   51: *>
   52: *> \param[in] N
   53: *> \verbatim
   54: *>          N is INTEGER
   55: *>          The number of rows and columns of the matrix C.  N >= 0.
   56: *> \endverbatim
   57: *>
   58: *> \param[in] V
   59: *> \verbatim
   60: *>          V is COMPLEX*16 array, dimension
   61: *>                  (1 + (N-1)*abs(INCV))
   62: *>          The vector v as described above.
   63: *> \endverbatim
   64: *>
   65: *> \param[in] INCV
   66: *> \verbatim
   67: *>          INCV is INTEGER
   68: *>          The increment between successive elements of v.  INCV must
   69: *>          not be zero.
   70: *> \endverbatim
   71: *>
   72: *> \param[in] TAU
   73: *> \verbatim
   74: *>          TAU is COMPLEX*16
   75: *>          The value tau as described above.
   76: *> \endverbatim
   77: *>
   78: *> \param[in,out] C
   79: *> \verbatim
   80: *>          C is COMPLEX*16 array, dimension (LDC, N)
   81: *>          On entry, the matrix C.
   82: *>          On exit, C is overwritten by H * C * H'.
   83: *> \endverbatim
   84: *>
   85: *> \param[in] LDC
   86: *> \verbatim
   87: *>          LDC is INTEGER
   88: *>          The leading dimension of the array C.  LDC >= max( 1, N ).
   89: *> \endverbatim
   90: *>
   91: *> \param[out] WORK
   92: *> \verbatim
   93: *>          WORK is COMPLEX*16 array, dimension (N)
   94: *> \endverbatim
   95: *
   96: *  Authors:
   97: *  ========
   98: *
   99: *> \author Univ. of Tennessee
  100: *> \author Univ. of California Berkeley
  101: *> \author Univ. of Colorado Denver
  102: *> \author NAG Ltd.
  103: *
  104: *> \ingroup complex16OTHERauxiliary
  105: *
  106: *  =====================================================================
  107:       SUBROUTINE ZLARFY( UPLO, N, V, INCV, TAU, C, LDC, WORK )
  108: *
  109: *  -- LAPACK test routine --
  110: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
  111: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  112: *
  113: *     .. Scalar Arguments ..
  114:       CHARACTER          UPLO
  115:       INTEGER            INCV, LDC, N
  116:       COMPLEX*16         TAU
  117: *     ..
  118: *     .. Array Arguments ..
  119:       COMPLEX*16         C( LDC, * ), V( * ), WORK( * )
  120: *     ..
  121: *
  122: *  =====================================================================
  123: *
  124: *     .. Parameters ..
  125:       COMPLEX*16         ONE, ZERO, HALF
  126:       PARAMETER          ( ONE = ( 1.0D+0, 0.0D+0 ),
  127:      $                   ZERO = ( 0.0D+0, 0.0D+0 ),
  128:      $                   HALF = ( 0.5D+0, 0.0D+0 ) )
  129: *     ..
  130: *     .. Local Scalars ..
  131:       COMPLEX*16         ALPHA
  132: *     ..
  133: *     .. External Subroutines ..
  134:       EXTERNAL           ZAXPY, ZHEMV, ZHER2
  135: *     ..
  136: *     .. External Functions ..
  137:       COMPLEX*16         ZDOTC
  138:       EXTERNAL           ZDOTC
  139: *     ..
  140: *     .. Executable Statements ..
  141: *
  142:       IF( TAU.EQ.ZERO )
  143:      $   RETURN
  144: *
  145: *     Form  w:= C * v
  146: *
  147:       CALL ZHEMV( UPLO, N, ONE, C, LDC, V, INCV, ZERO, WORK, 1 )
  148: *
  149:       ALPHA = -HALF*TAU*ZDOTC( N, WORK, 1, V, INCV )
  150:       CALL ZAXPY( N, ALPHA, V, INCV, WORK, 1 )
  151: *
  152: *     C := C - v * w' - w * v'
  153: *
  154:       CALL ZHER2( UPLO, N, -TAU, V, INCV, WORK, 1, C, LDC )
  155: *
  156:       RETURN
  157: *
  158: *     End of ZLARFY
  159: *
  160:       END

CVSweb interface <joel.bertrand@systella.fr>