Télécharger dorgtr.eso

Retour à la liste

Numérotation des lignes :

dorgtr
  1. C DORGTR SOURCE BP208322 22/09/16 21:15:05 11454
  2. *> \brief \b DORGTR
  3. *
  4. * =========== DOCUMENTATION ===========
  5. *
  6. * Online html documentation available at
  7. * http://www.netlib.org/lapack/explore-html/
  8. *
  9. *> \htmlonly
  10. *> Download DORGTR + dependencies
  11. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dorgtr.f">
  12. *> [TGZ]</a>
  13. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dorgtr.f">
  14. *> [ZIP]</a>
  15. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dorgtr.f">
  16. *> [TXT]</a>
  17. *> \endhtmlonly
  18. *
  19. * Definition:
  20. * ===========
  21. *
  22. * SUBROUTINE DORGTR( UPLO, N, A, LDA, TAU, WORK, LWORK, INFO )
  23. *
  24. * .. Scalar Arguments ..
  25. * CHARACTER UPLO
  26. * INTEGER INFO, LDA, LWORK, N
  27. * ..
  28. * .. Array Arguments ..
  29. * REAL*8 A( LDA, * ), TAU( * ), WORK( * )
  30. * ..
  31. *
  32. *
  33. *> \par Purpose:
  34. * =============
  35. *>
  36. *> \verbatim
  37. *>
  38. *> DORGTR generates a real orthogonal matrix Q which is defined as the
  39. *> product of n-1 elementary reflectors of order N, as returned by
  40. *> DSYTRD:
  41. *>
  42. *> if UPLO = 'U', Q = H(n-1) . . . H(2) H(1),
  43. *>
  44. *> if UPLO = 'L', Q = H(1) H(2) . . . H(n-1).
  45. *> \endverbatim
  46. *
  47. * Arguments:
  48. * ==========
  49. *
  50. *> \param[in] UPLO
  51. *> \verbatim
  52. *> UPLO is CHARACTER*1
  53. *> = 'U': Upper triangle of A contains elementary reflectors
  54. *> from DSYTRD;
  55. *> = 'L': Lower triangle of A contains elementary reflectors
  56. *> from DSYTRD.
  57. *> \endverbatim
  58. *>
  59. *> \param[in] N
  60. *> \verbatim
  61. *> N is INTEGER
  62. *> The order of the matrix Q. N >= 0.
  63. *> \endverbatim
  64. *>
  65. *> \param[in,out] A
  66. *> \verbatim
  67. *> A is REAL*8 array, dimension (LDA,N)
  68. *> On entry, the vectors which define the elementary reflectors,
  69. *> as returned by DSYTRD.
  70. *> On exit, the N-by-N orthogonal matrix Q.
  71. *> \endverbatim
  72. *>
  73. *> \param[in] LDA
  74. *> \verbatim
  75. *> LDA is INTEGER
  76. *> The leading dimension of the array A. LDA >= max(1,N).
  77. *> \endverbatim
  78. *>
  79. *> \param[in] TAU
  80. *> \verbatim
  81. *> TAU is REAL*8 array, dimension (N-1)
  82. *> TAU(i) must contain the scalar factor of the elementary
  83. *> reflector H(i), as returned by DSYTRD.
  84. *> \endverbatim
  85. *>
  86. *> \param[out] WORK
  87. *> \verbatim
  88. *> WORK is REAL*8 array, dimension (MAX(1,LWORK))
  89. *> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  90. *> \endverbatim
  91. *>
  92. *> \param[in] LWORK
  93. *> \verbatim
  94. *> LWORK is INTEGER
  95. *> The dimension of the array WORK. LWORK >= max(1,N-1).
  96. *> For optimum performance LWORK >= (N-1)*NB, where NB is
  97. *> the optimal blocksize.
  98. *>
  99. *> If LWORK = -1, then a workspace query is assumed; the routine
  100. *> only calculates the optimal size of the WORK array, returns
  101. *> this value as the first entry of the WORK array, and no error
  102. *> message related to LWORK is issued by XERBLA.
  103. *> \endverbatim
  104. *>
  105. *> \param[out] INFO
  106. *> \verbatim
  107. *> INFO is INTEGER
  108. *> = 0: successful exit
  109. *> < 0: if INFO = -i, the i-th argument had an illegal value
  110. *> \endverbatim
  111. *
  112. * Authors:
  113. * ========
  114. *
  115. *> \author Univ. of Tennessee
  116. *> \author Univ. of California Berkeley
  117. *> \author Univ. of Colorado Denver
  118. *> \author NAG Ltd.
  119. *
  120. *> \ingroup doubleOTHERcomputational
  121. *
  122. * =====================================================================
  123. SUBROUTINE DORGTR( UPLO, N, A, LDA, TAU, WORK, LWORK, INFO )
  124. *
  125. * -- LAPACK computational routine --
  126. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  127. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  128. *
  129. * .. Scalar Arguments ..
  130. CHARACTER UPLO
  131. INTEGER INFO, LDA, LWORK, N
  132. * ..
  133. * .. Array Arguments ..
  134. REAL*8 A( LDA, * ), TAU( * ), WORK( * )
  135. * ..
  136. *
  137. * =====================================================================
  138. *
  139. * .. Parameters ..
  140. REAL*8 ZERO, ONE
  141. PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
  142. * ..
  143. * .. Local Scalars ..
  144. LOGICAL LQUERY, UPPER
  145. INTEGER I, IINFO, J, LWKOPT, NB
  146. * ..
  147. * .. External Functions ..
  148. LOGICAL LSAME
  149. INTEGER ILAENV
  150. EXTERNAL LSAME, ILAENV
  151. * ..
  152. * .. External Subroutines ..
  153. EXTERNAL DORGQL, DORGQR, XERBLA
  154. * ..
  155. * .. Intrinsic Functions ..
  156. * INTRINSIC MAX
  157. * ..
  158. * .. Executable Statements ..
  159. *
  160. * Test the input arguments
  161. *
  162. INFO = 0
  163. LQUERY = ( LWORK.EQ.-1 )
  164. UPPER = LSAME( UPLO, 'U' )
  165. IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
  166. INFO = -1
  167. ELSE IF( N.LT.0 ) THEN
  168. INFO = -2
  169. ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
  170. INFO = -4
  171. ELSE IF( LWORK.LT.MAX( 1, N-1 ) .AND. .NOT.LQUERY ) THEN
  172. INFO = -7
  173. END IF
  174. *
  175. IF( INFO.EQ.0 ) THEN
  176. IF( UPPER ) THEN
  177. NB = ILAENV( 1, 'DORGQL', ' ', N-1, N-1, N-1, -1 )
  178. ELSE
  179. NB = ILAENV( 1, 'DORGQR', ' ', N-1, N-1, N-1, -1 )
  180. END IF
  181. LWKOPT = MAX( 1, N-1 )*NB
  182. WORK( 1 ) = LWKOPT
  183. END IF
  184. *
  185. IF( INFO.NE.0 ) THEN
  186. CALL XERBLA( 'DORGTR', -INFO )
  187. RETURN
  188. ELSE IF( LQUERY ) THEN
  189. RETURN
  190. END IF
  191. *
  192. * Quick return if possible
  193. *
  194. IF( N.EQ.0 ) THEN
  195. WORK( 1 ) = 1
  196. RETURN
  197. END IF
  198. *
  199. IF( UPPER ) THEN
  200. *
  201. * Q was determined by a call to DSYTRD with UPLO = 'U'
  202. *
  203. * Shift the vectors which define the elementary reflectors one
  204. * column to the left, and set the last row and column of Q to
  205. * those of the unit matrix
  206. *
  207. DO 20 J = 1, N - 1
  208. DO 10 I = 1, J - 1
  209. A( I, J ) = A( I, J+1 )
  210. 10 CONTINUE
  211. A( N, J ) = ZERO
  212. 20 CONTINUE
  213. DO 30 I = 1, N - 1
  214. A( I, N ) = ZERO
  215. 30 CONTINUE
  216. A( N, N ) = ONE
  217. *
  218. * Generate Q(1:n-1,1:n-1)
  219. *
  220. CALL DORGQL( N-1, N-1, N-1, A, LDA, TAU, WORK, LWORK, IINFO )
  221. *
  222. ELSE
  223. *
  224. * Q was determined by a call to DSYTRD with UPLO = 'L'.
  225. *
  226. * Shift the vectors which define the elementary reflectors one
  227. * column to the right, and set the first row and column of Q to
  228. * those of the unit matrix
  229. *
  230. DO 50 J = N, 2, -1
  231. A( 1, J ) = ZERO
  232. DO 40 I = J + 1, N
  233. A( I, J ) = A( I, J-1 )
  234. 40 CONTINUE
  235. 50 CONTINUE
  236. A( 1, 1 ) = ONE
  237. DO 60 I = 2, N
  238. A( I, 1 ) = ZERO
  239. 60 CONTINUE
  240. IF( N.GT.1 ) THEN
  241. *
  242. * Generate Q(2:n,2:n)
  243. *
  244. CALL DORGQR( N-1, N-1, N-1, A( 2, 2 ), LDA, TAU, WORK,
  245. $ LWORK, IINFO )
  246. END IF
  247. END IF
  248. WORK( 1 ) = LWKOPT
  249. RETURN
  250. *
  251. * End of DORGTR
  252. *
  253. END
  254.  
  255.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales