csscal(3f) - [BLAS:COMPLEX_BLAS_LEVEL1] CSSCAL scales a complex vector by a real constant.
CX:=SA*CX (real multiplier).
subroutine csscal(n,sa,cx,incx)
.. scalar arguments ..
real,intent(in) :: sa
integer,intent(in) :: incx,n
..
.. Array Arguments ..
complex,intent(inout) :: cx(*)
..
CSSCAL scales a complex vector by a real constant.
N
N is INTEGER
number of elements in input vector(s)
SA
SA is REAL
On entry, SA specifies the scalar alpha.
CX
CX is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
INCX
INCX is INTEGER
storage spacing between elements of CX
date:November 2017
FURTHER DETAILS
jack dongarra, linpack, 3/11/78.
modified 3/93 to return if incx .le. 0.
modified 12/3/93, array(1) declarations changed to array(*)
Online html documentation available at
http://www.netlib.org/lapack/explore-html/
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n | |||
real, | intent(in) | :: | sa | |||
complex, | intent(inout) | :: | cx(*) | |||
integer, | intent(in) | :: | incx |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | i | ||||
integer, | public | :: | nincx |
subroutine csscal(n,sa,cx,incx)
implicit none
!
! -- Reference BLAS level1 routine (version 3.8.0) --
! -- Reference BLAS is a software package provided by Univ. of Tennessee, --
! -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
! November 2017
!
! .. Scalar Arguments ..
real,intent(in) :: sa
integer,intent(in) :: incx,n
! ..
! .. Array Arguments ..
complex,intent(inout) :: cx(*)
! ..
!
! =====================================================================
!
! .. Local Scalars ..
integer i,nincx
! ..
! .. Intrinsic Functions ..
intrinsic aimag,cmplx,real
! ..
if (n.le.0 .or. incx.le.0) return
if (incx.eq.1) then
!
! code for increment equal to 1
!
do i = 1,n
cx(i) = cmplx(sa*real(cx(i)),sa*aimag(cx(i)))
enddo
else
!
! code for increment not equal to 1
!
nincx = n*incx
do i = 1,nincx,incx
cx(i) = cmplx(sa*real(cx(i)),sa*aimag(cx(i)))
enddo
endif
end subroutine csscal