Télécharger dlaset.eso

Retour à la liste

Numérotation des lignes :

dlaset
  1. C DLASET SOURCE BP208322 18/07/10 21:15:18 9872
  2. *> \brief \b DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
  3. *
  4. * =========== DOCUMENTATION ===========
  5. *
  6. * Online html documentation available at
  7. * http://www.netlib.org/lapack/explore-html/
  8. *
  9. *> \htmlonly
  10. *> Download DLASET + dependencies
  11. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlaset.f">
  12. *> [TGZ]</a>
  13. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlaset.f">
  14. *> [ZIP]</a>
  15. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlaset.f">
  16. *> [TXT]</a>
  17. *> \endhtmlonly
  18. *
  19. * Definition:
  20. * ===========
  21. *
  22. * SUBROUTINE DLASET( UPLO, M, N, ALPHA, BETA, A, LDA )
  23. *
  24. * .. Scalar Arguments ..
  25. * CHARACTER UPLO
  26. * INTEGER LDA, M, N
  27. * REAL*8 ALPHA, BETA
  28. * ..
  29. * .. Array Arguments ..
  30. * REAL*8 A( LDA, * )
  31. * ..
  32. *
  33. *
  34. *> \par Purpose:
  35. * =============
  36. *>
  37. *> \verbatim
  38. *>
  39. *> DLASET initializes an m-by-n matrix A to BETA on the diagonal and
  40. *> ALPHA on the offdiagonals.
  41. *> \endverbatim
  42. *
  43. * Arguments:
  44. * ==========
  45. *
  46. *> \param[in] UPLO
  47. *> \verbatim
  48. *> UPLO is CHARACTER*1
  49. *> Specifies the part of the matrix A to be set.
  50. *> = 'U': Upper triangular part is set; the strictly lower
  51. *> triangular part of A is not changed.
  52. *> = 'L': Lower triangular part is set; the strictly upper
  53. *> triangular part of A is not changed.
  54. *> Otherwise: All of the matrix A is set.
  55. *> \endverbatim
  56. *>
  57. *> \param[in] M
  58. *> \verbatim
  59. *> M is INTEGER
  60. *> The number of rows of the matrix A. M >= 0.
  61. *> \endverbatim
  62. *>
  63. *> \param[in] N
  64. *> \verbatim
  65. *> N is INTEGER
  66. *> The number of columns of the matrix A. N >= 0.
  67. *> \endverbatim
  68. *>
  69. *> \param[in] ALPHA
  70. *> \verbatim
  71. *> ALPHA is DOUBLE PRECISION
  72. *> The constant to which the offdiagonal elements are to be set.
  73. *> \endverbatim
  74. *>
  75. *> \param[in] BETA
  76. *> \verbatim
  77. *> BETA is DOUBLE PRECISION
  78. *> The constant to which the diagonal elements are to be set.
  79. *> \endverbatim
  80. *>s
  81. *> \param[out] A
  82. *> \verbatim
  83. *> A is DOUBLE PRECISION array, dimension (LDA,N)
  84. *> On exit, the leading m-by-n submatrix of A is set as follows:
  85. *>
  86. *> if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n,
  87. *> if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n,
  88. *> otherwise, A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j,
  89. *>
  90. *> and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n).
  91. *> \endverbatim
  92. *>
  93. *> \param[in] LDA
  94. *> \verbatim
  95. *> LDA is INTEGER
  96. *> The leading dimension of the array A. LDA >= max(1,M).
  97. *> \endverbatim
  98. *
  99. * Authors:
  100. * ========
  101. *
  102. *> \author Univ. of Tennessee
  103. *> \author Univ. of California Berkeley
  104. *> \author Univ. of Colorado Denver
  105. *> \author NAG Ltd.
  106. *
  107. *> \date December 2016
  108. *
  109. *> \ingroup OTHERauxiliary
  110. *
  111. * =====================================================================
  112. SUBROUTINE DLASET( UPLO, M, N, ALPHA, BETA, A, LDA )
  113. *
  114. * -- LAPACK auxiliary routine (version 3.7.0) --
  115. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  116. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  117. * December 2016
  118. *
  119. * .. Scalar Arguments ..
  120. CHARACTER UPLO
  121. INTEGER LDA, M, N
  122. REAL*8 ALPHA, BETA
  123. * ..
  124. * .. Array Arguments ..
  125. REAL*8 A( LDA, * )
  126. * ..
  127. *
  128. * =====================================================================
  129. *
  130. * .. Local Scalars ..
  131. INTEGER I, J
  132. * ..
  133. * .. External Functions ..
  134. LOGICAL LSAME
  135. EXTERNAL LSAME
  136. * ..
  137. ** .. Intrinsic Functions ..
  138. * INTRINSIC MIN
  139. ** ..
  140. ** .. Executable Statements ..
  141. *
  142. IF( LSAME( UPLO, 'U' ) ) THEN
  143. *
  144. * Set the strictly upper triangular or trapezoidal part of the
  145. * array to ALPHA.
  146. *
  147. DO 20 J = 2, N
  148. DO 10 I = 1, MIN( J-1, M )
  149. A( I, J ) = ALPHA
  150. 10 CONTINUE
  151. 20 CONTINUE
  152. *
  153. ELSE IF( LSAME( UPLO, 'L' ) ) THEN
  154. *
  155. * Set the strictly lower triangular or trapezoidal part of the
  156. * array to ALPHA.
  157. *
  158. DO 40 J = 1, MIN( M, N )
  159. DO 30 I = J + 1, M
  160. A( I, J ) = ALPHA
  161. 30 CONTINUE
  162. 40 CONTINUE
  163. *
  164. ELSE
  165. *
  166. * Set the leading m-by-n submatrix to ALPHA.
  167. *
  168. DO 60 J = 1, N
  169. DO 50 I = 1, M
  170. A( I, J ) = ALPHA
  171. 50 CONTINUE
  172. 60 CONTINUE
  173. END IF
  174. *
  175. * Set the first min(M,N) diagonal elements to BETA.
  176. *
  177. DO 70 I = 1, MIN( M, N )
  178. A( I, I ) = BETA
  179. 70 CONTINUE
  180. *
  181. RETURN
  182. *
  183. * End of DLASET
  184. *
  185. END
  186.  
  187.  
  188.  

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