LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
zupgtr.f
Go to the documentation of this file.
00001 *> \brief \b ZUPGTR
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download ZUPGTR + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zupgtr.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zupgtr.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zupgtr.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE ZUPGTR( UPLO, N, AP, TAU, Q, LDQ, WORK, INFO )
00022 * 
00023 *       .. Scalar Arguments ..
00024 *       CHARACTER          UPLO
00025 *       INTEGER            INFO, LDQ, N
00026 *       ..
00027 *       .. Array Arguments ..
00028 *       COMPLEX*16         AP( * ), Q( LDQ, * ), TAU( * ), WORK( * )
00029 *       ..
00030 *  
00031 *
00032 *> \par Purpose:
00033 *  =============
00034 *>
00035 *> \verbatim
00036 *>
00037 *> ZUPGTR generates a complex unitary matrix Q which is defined as the
00038 *> product of n-1 elementary reflectors H(i) of order n, as returned by
00039 *> ZHPTRD using packed storage:
00040 *>
00041 *> if UPLO = 'U', Q = H(n-1) . . . H(2) H(1),
00042 *>
00043 *> if UPLO = 'L', Q = H(1) H(2) . . . H(n-1).
00044 *> \endverbatim
00045 *
00046 *  Arguments:
00047 *  ==========
00048 *
00049 *> \param[in] UPLO
00050 *> \verbatim
00051 *>          UPLO is CHARACTER*1
00052 *>          = 'U': Upper triangular packed storage used in previous
00053 *>                 call to ZHPTRD;
00054 *>          = 'L': Lower triangular packed storage used in previous
00055 *>                 call to ZHPTRD.
00056 *> \endverbatim
00057 *>
00058 *> \param[in] N
00059 *> \verbatim
00060 *>          N is INTEGER
00061 *>          The order of the matrix Q. N >= 0.
00062 *> \endverbatim
00063 *>
00064 *> \param[in] AP
00065 *> \verbatim
00066 *>          AP is COMPLEX*16 array, dimension (N*(N+1)/2)
00067 *>          The vectors which define the elementary reflectors, as
00068 *>          returned by ZHPTRD.
00069 *> \endverbatim
00070 *>
00071 *> \param[in] TAU
00072 *> \verbatim
00073 *>          TAU is COMPLEX*16 array, dimension (N-1)
00074 *>          TAU(i) must contain the scalar factor of the elementary
00075 *>          reflector H(i), as returned by ZHPTRD.
00076 *> \endverbatim
00077 *>
00078 *> \param[out] Q
00079 *> \verbatim
00080 *>          Q is COMPLEX*16 array, dimension (LDQ,N)
00081 *>          The N-by-N unitary matrix Q.
00082 *> \endverbatim
00083 *>
00084 *> \param[in] LDQ
00085 *> \verbatim
00086 *>          LDQ is INTEGER
00087 *>          The leading dimension of the array Q. LDQ >= max(1,N).
00088 *> \endverbatim
00089 *>
00090 *> \param[out] WORK
00091 *> \verbatim
00092 *>          WORK is COMPLEX*16 array, dimension (N-1)
00093 *> \endverbatim
00094 *>
00095 *> \param[out] INFO
00096 *> \verbatim
00097 *>          INFO is INTEGER
00098 *>          = 0:  successful exit
00099 *>          < 0:  if INFO = -i, the i-th argument had an illegal value
00100 *> \endverbatim
00101 *
00102 *  Authors:
00103 *  ========
00104 *
00105 *> \author Univ. of Tennessee 
00106 *> \author Univ. of California Berkeley 
00107 *> \author Univ. of Colorado Denver 
00108 *> \author NAG Ltd. 
00109 *
00110 *> \date November 2011
00111 *
00112 *> \ingroup complex16OTHERcomputational
00113 *
00114 *  =====================================================================
00115       SUBROUTINE ZUPGTR( UPLO, N, AP, TAU, Q, LDQ, WORK, INFO )
00116 *
00117 *  -- LAPACK computational routine (version 3.4.0) --
00118 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00119 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00120 *     November 2011
00121 *
00122 *     .. Scalar Arguments ..
00123       CHARACTER          UPLO
00124       INTEGER            INFO, LDQ, N
00125 *     ..
00126 *     .. Array Arguments ..
00127       COMPLEX*16         AP( * ), Q( LDQ, * ), TAU( * ), WORK( * )
00128 *     ..
00129 *
00130 *  =====================================================================
00131 *
00132 *     .. Parameters ..
00133       COMPLEX*16         CZERO, CONE
00134       PARAMETER          ( CZERO = ( 0.0D+0, 0.0D+0 ),
00135      $                   CONE = ( 1.0D+0, 0.0D+0 ) )
00136 *     ..
00137 *     .. Local Scalars ..
00138       LOGICAL            UPPER
00139       INTEGER            I, IINFO, IJ, J
00140 *     ..
00141 *     .. External Functions ..
00142       LOGICAL            LSAME
00143       EXTERNAL           LSAME
00144 *     ..
00145 *     .. External Subroutines ..
00146       EXTERNAL           XERBLA, ZUNG2L, ZUNG2R
00147 *     ..
00148 *     .. Intrinsic Functions ..
00149       INTRINSIC          MAX
00150 *     ..
00151 *     .. Executable Statements ..
00152 *
00153 *     Test the input arguments
00154 *
00155       INFO = 0
00156       UPPER = LSAME( UPLO, 'U' )
00157       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
00158          INFO = -1
00159       ELSE IF( N.LT.0 ) THEN
00160          INFO = -2
00161       ELSE IF( LDQ.LT.MAX( 1, N ) ) THEN
00162          INFO = -6
00163       END IF
00164       IF( INFO.NE.0 ) THEN
00165          CALL XERBLA( 'ZUPGTR', -INFO )
00166          RETURN
00167       END IF
00168 *
00169 *     Quick return if possible
00170 *
00171       IF( N.EQ.0 )
00172      $   RETURN
00173 *
00174       IF( UPPER ) THEN
00175 *
00176 *        Q was determined by a call to ZHPTRD with UPLO = 'U'
00177 *
00178 *        Unpack the vectors which define the elementary reflectors and
00179 *        set the last row and column of Q equal to those of the unit
00180 *        matrix
00181 *
00182          IJ = 2
00183          DO 20 J = 1, N - 1
00184             DO 10 I = 1, J - 1
00185                Q( I, J ) = AP( IJ )
00186                IJ = IJ + 1
00187    10       CONTINUE
00188             IJ = IJ + 2
00189             Q( N, J ) = CZERO
00190    20    CONTINUE
00191          DO 30 I = 1, N - 1
00192             Q( I, N ) = CZERO
00193    30    CONTINUE
00194          Q( N, N ) = CONE
00195 *
00196 *        Generate Q(1:n-1,1:n-1)
00197 *
00198          CALL ZUNG2L( N-1, N-1, N-1, Q, LDQ, TAU, WORK, IINFO )
00199 *
00200       ELSE
00201 *
00202 *        Q was determined by a call to ZHPTRD with UPLO = 'L'.
00203 *
00204 *        Unpack the vectors which define the elementary reflectors and
00205 *        set the first row and column of Q equal to those of the unit
00206 *        matrix
00207 *
00208          Q( 1, 1 ) = CONE
00209          DO 40 I = 2, N
00210             Q( I, 1 ) = CZERO
00211    40    CONTINUE
00212          IJ = 3
00213          DO 60 J = 2, N
00214             Q( 1, J ) = CZERO
00215             DO 50 I = J + 1, N
00216                Q( I, J ) = AP( IJ )
00217                IJ = IJ + 1
00218    50       CONTINUE
00219             IJ = IJ + 2
00220    60    CONTINUE
00221          IF( N.GT.1 ) THEN
00222 *
00223 *           Generate Q(2:n,2:n)
00224 *
00225             CALL ZUNG2R( N-1, N-1, N-1, Q( 2, 2 ), LDQ, TAU, WORK,
00226      $                   IINFO )
00227          END IF
00228       END IF
00229       RETURN
00230 *
00231 *     End of ZUPGTR
00232 *
00233       END
 All Files Functions