File:  [local] / rpl / lapack / lapack / dopgtr.f
Revision 1.17: download - view: text, annotated - select for diffs - revision graph
Mon Aug 7 08:39:01 2023 UTC (9 months, 1 week 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 DOPGTR
    2: *
    3: *  =========== DOCUMENTATION ===========
    4: *
    5: * Online html documentation available at
    6: *            http://www.netlib.org/lapack/explore-html/
    7: *
    8: *> \htmlonly
    9: *> Download DOPGTR + dependencies
   10: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dopgtr.f">
   11: *> [TGZ]</a>
   12: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dopgtr.f">
   13: *> [ZIP]</a>
   14: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dopgtr.f">
   15: *> [TXT]</a>
   16: *> \endhtmlonly
   17: *
   18: *  Definition:
   19: *  ===========
   20: *
   21: *       SUBROUTINE DOPGTR( UPLO, N, AP, TAU, Q, LDQ, WORK, INFO )
   22: *
   23: *       .. Scalar Arguments ..
   24: *       CHARACTER          UPLO
   25: *       INTEGER            INFO, LDQ, N
   26: *       ..
   27: *       .. Array Arguments ..
   28: *       DOUBLE PRECISION   AP( * ), Q( LDQ, * ), TAU( * ), WORK( * )
   29: *       ..
   30: *
   31: *
   32: *> \par Purpose:
   33: *  =============
   34: *>
   35: *> \verbatim
   36: *>
   37: *> DOPGTR generates a real orthogonal matrix Q which is defined as the
   38: *> product of n-1 elementary reflectors H(i) of order n, as returned by
   39: *> DSPTRD using packed storage:
   40: *>
   41: *> if UPLO = 'U', Q = H(n-1) . . . H(2) H(1),
   42: *>
   43: *> if UPLO = 'L', Q = H(1) H(2) . . . H(n-1).
   44: *> \endverbatim
   45: *
   46: *  Arguments:
   47: *  ==========
   48: *
   49: *> \param[in] UPLO
   50: *> \verbatim
   51: *>          UPLO is CHARACTER*1
   52: *>          = 'U': Upper triangular packed storage used in previous
   53: *>                 call to DSPTRD;
   54: *>          = 'L': Lower triangular packed storage used in previous
   55: *>                 call to DSPTRD.
   56: *> \endverbatim
   57: *>
   58: *> \param[in] N
   59: *> \verbatim
   60: *>          N is INTEGER
   61: *>          The order of the matrix Q. N >= 0.
   62: *> \endverbatim
   63: *>
   64: *> \param[in] AP
   65: *> \verbatim
   66: *>          AP is DOUBLE PRECISION array, dimension (N*(N+1)/2)
   67: *>          The vectors which define the elementary reflectors, as
   68: *>          returned by DSPTRD.
   69: *> \endverbatim
   70: *>
   71: *> \param[in] TAU
   72: *> \verbatim
   73: *>          TAU is DOUBLE PRECISION array, dimension (N-1)
   74: *>          TAU(i) must contain the scalar factor of the elementary
   75: *>          reflector H(i), as returned by DSPTRD.
   76: *> \endverbatim
   77: *>
   78: *> \param[out] Q
   79: *> \verbatim
   80: *>          Q is DOUBLE PRECISION array, dimension (LDQ,N)
   81: *>          The N-by-N orthogonal matrix Q.
   82: *> \endverbatim
   83: *>
   84: *> \param[in] LDQ
   85: *> \verbatim
   86: *>          LDQ is INTEGER
   87: *>          The leading dimension of the array Q. LDQ >= max(1,N).
   88: *> \endverbatim
   89: *>
   90: *> \param[out] WORK
   91: *> \verbatim
   92: *>          WORK is DOUBLE PRECISION array, dimension (N-1)
   93: *> \endverbatim
   94: *>
   95: *> \param[out] INFO
   96: *> \verbatim
   97: *>          INFO is INTEGER
   98: *>          = 0:  successful exit
   99: *>          < 0:  if INFO = -i, the i-th argument had an illegal value
  100: *> \endverbatim
  101: *
  102: *  Authors:
  103: *  ========
  104: *
  105: *> \author Univ. of Tennessee
  106: *> \author Univ. of California Berkeley
  107: *> \author Univ. of Colorado Denver
  108: *> \author NAG Ltd.
  109: *
  110: *> \ingroup doubleOTHERcomputational
  111: *
  112: *  =====================================================================
  113:       SUBROUTINE DOPGTR( UPLO, N, AP, TAU, Q, LDQ, WORK, INFO )
  114: *
  115: *  -- LAPACK computational routine --
  116: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
  117: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  118: *
  119: *     .. Scalar Arguments ..
  120:       CHARACTER          UPLO
  121:       INTEGER            INFO, LDQ, N
  122: *     ..
  123: *     .. Array Arguments ..
  124:       DOUBLE PRECISION   AP( * ), Q( LDQ, * ), TAU( * ), WORK( * )
  125: *     ..
  126: *
  127: *  =====================================================================
  128: *
  129: *     .. Parameters ..
  130:       DOUBLE PRECISION   ZERO, ONE
  131:       PARAMETER          ( ZERO = 0.0D+0, ONE = 1.0D+0 )
  132: *     ..
  133: *     .. Local Scalars ..
  134:       LOGICAL            UPPER
  135:       INTEGER            I, IINFO, IJ, J
  136: *     ..
  137: *     .. External Functions ..
  138:       LOGICAL            LSAME
  139:       EXTERNAL           LSAME
  140: *     ..
  141: *     .. External Subroutines ..
  142:       EXTERNAL           DORG2L, DORG2R, XERBLA
  143: *     ..
  144: *     .. Intrinsic Functions ..
  145:       INTRINSIC          MAX
  146: *     ..
  147: *     .. Executable Statements ..
  148: *
  149: *     Test the input arguments
  150: *
  151:       INFO = 0
  152:       UPPER = LSAME( UPLO, 'U' )
  153:       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
  154:          INFO = -1
  155:       ELSE IF( N.LT.0 ) THEN
  156:          INFO = -2
  157:       ELSE IF( LDQ.LT.MAX( 1, N ) ) THEN
  158:          INFO = -6
  159:       END IF
  160:       IF( INFO.NE.0 ) THEN
  161:          CALL XERBLA( 'DOPGTR', -INFO )
  162:          RETURN
  163:       END IF
  164: *
  165: *     Quick return if possible
  166: *
  167:       IF( N.EQ.0 )
  168:      $   RETURN
  169: *
  170:       IF( UPPER ) THEN
  171: *
  172: *        Q was determined by a call to DSPTRD with UPLO = 'U'
  173: *
  174: *        Unpack the vectors which define the elementary reflectors and
  175: *        set the last row and column of Q equal to those of the unit
  176: *        matrix
  177: *
  178:          IJ = 2
  179:          DO 20 J = 1, N - 1
  180:             DO 10 I = 1, J - 1
  181:                Q( I, J ) = AP( IJ )
  182:                IJ = IJ + 1
  183:    10       CONTINUE
  184:             IJ = IJ + 2
  185:             Q( N, J ) = ZERO
  186:    20    CONTINUE
  187:          DO 30 I = 1, N - 1
  188:             Q( I, N ) = ZERO
  189:    30    CONTINUE
  190:          Q( N, N ) = ONE
  191: *
  192: *        Generate Q(1:n-1,1:n-1)
  193: *
  194:          CALL DORG2L( N-1, N-1, N-1, Q, LDQ, TAU, WORK, IINFO )
  195: *
  196:       ELSE
  197: *
  198: *        Q was determined by a call to DSPTRD with UPLO = 'L'.
  199: *
  200: *        Unpack the vectors which define the elementary reflectors and
  201: *        set the first row and column of Q equal to those of the unit
  202: *        matrix
  203: *
  204:          Q( 1, 1 ) = ONE
  205:          DO 40 I = 2, N
  206:             Q( I, 1 ) = ZERO
  207:    40    CONTINUE
  208:          IJ = 3
  209:          DO 60 J = 2, N
  210:             Q( 1, J ) = ZERO
  211:             DO 50 I = J + 1, N
  212:                Q( I, J ) = AP( IJ )
  213:                IJ = IJ + 1
  214:    50       CONTINUE
  215:             IJ = IJ + 2
  216:    60    CONTINUE
  217:          IF( N.GT.1 ) THEN
  218: *
  219: *           Generate Q(2:n,2:n)
  220: *
  221:             CALL DORG2R( N-1, N-1, N-1, Q( 2, 2 ), LDQ, TAU, WORK,
  222:      $                   IINFO )
  223:          END IF
  224:       END IF
  225:       RETURN
  226: *
  227: *     End of DOPGTR
  228: *
  229:       END

CVSweb interface <joel.bertrand@systella.fr>