Télécharger dscal.eso

Retour à la liste

Numérotation des lignes :

dscal
  1. C DSCAL SOURCE BP208322 22/09/16 21:15:06 11454
  2. *> \brief \b DSCAL
  3. *
  4. * =========== DOCUMENTATION ===========
  5. *
  6. * Online html documentation available at
  7. * http://www.netlib.org/lapack/explore-html/
  8. *
  9. * Definition:
  10. * ===========
  11. *
  12. * SUBROUTINE DSCAL(N,DA,DX,INCX)
  13. *
  14. * .. Scalar Arguments ..
  15. * REAL*8 DA
  16. * INTEGER INCX,N
  17. * ..
  18. * .. Array Arguments ..
  19. * REAL*8 DX(*)
  20. * ..
  21. *
  22. *
  23. *> \par Purpose:
  24. * =============
  25. *>
  26. *> \verbatim
  27. *>
  28. *> DSCAL scales a vector by a constant.
  29. *> uses unrolled loops for increment equal to 1.
  30. *> \endverbatim
  31. *
  32. * Arguments:
  33. * ==========
  34. *
  35. *> \param[in] N
  36. *> \verbatim
  37. *> N is INTEGER
  38. *> number of elements in input vector(s)
  39. *> \endverbatim
  40. *>
  41. *> \param[in] DA
  42. *> \verbatim
  43. *> DA is REAL*8
  44. *> On entry, DA specifies the scalar alpha.
  45. *> \endverbatim
  46. *>
  47. *> \param[in,out] DX
  48. *> \verbatim
  49. *> DX is REAL*8 array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
  50. *> \endverbatim
  51. *>
  52. *> \param[in] INCX
  53. *> \verbatim
  54. *> INCX is INTEGER
  55. *> storage spacing between elements of DX
  56. *> \endverbatim
  57. *
  58. * Authors:
  59. * ========
  60. *
  61. *> \author Univ. of Tennessee
  62. *> \author Univ. of California Berkeley
  63. *> \author Univ. of Colorado Denver
  64. *> \author NAG Ltd.
  65. *
  66. *> \ingroup double_blas_level1
  67. *
  68. *> \par Further Details:
  69. * =====================
  70. *>
  71. *> \verbatim
  72. *>
  73. *> jack dongarra, linpack, 3/11/78.
  74. *> modified 3/93 to return if incx .le. 0.
  75. *> modified 12/3/93, array(1) declarations changed to array(*)
  76. *> \endverbatim
  77. *>
  78. * =====================================================================
  79. SUBROUTINE DSCAL(N,DA,DX,INCX)
  80. *
  81. * -- Reference BLAS level1 routine --
  82. * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
  83. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  84. *
  85. * .. Scalar Arguments ..
  86. REAL*8 DA
  87. INTEGER INCX,N
  88. * ..
  89. * .. Array Arguments ..
  90. REAL*8 DX(*)
  91. * ..
  92. *
  93. * =====================================================================
  94. *
  95. * .. Local Scalars ..
  96. INTEGER I,M,MP1,NINCX
  97. * ..
  98. * .. Intrinsic Functions ..
  99. * INTRINSIC MOD
  100. * ..
  101. IF (N.LE.0 .OR. INCX.LE.0) RETURN
  102. IF (INCX.EQ.1) THEN
  103. *
  104. * code for increment equal to 1
  105. *
  106. *
  107. * clean-up loop
  108. *
  109. M = MOD(N,5)
  110. IF (M.NE.0) THEN
  111. DO I = 1,M
  112. DX(I) = DA*DX(I)
  113. END DO
  114. IF (N.LT.5) RETURN
  115. END IF
  116. MP1 = M + 1
  117. DO I = MP1,N,5
  118. DX(I) = DA*DX(I)
  119. DX(I+1) = DA*DX(I+1)
  120. DX(I+2) = DA*DX(I+2)
  121. DX(I+3) = DA*DX(I+3)
  122. DX(I+4) = DA*DX(I+4)
  123. END DO
  124. ELSE
  125. *
  126. * code for increment not equal to 1
  127. *
  128. NINCX = N*INCX
  129. DO I = 1,NINCX,INCX
  130. DX(I) = DA*DX(I)
  131. END DO
  132. END IF
  133. RETURN
  134. *
  135. * End of DSCAL
  136. *
  137. END
  138.  
  139.  

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