zgerc(3f) - [BLAS:COMPLEX_16_BLAS_LEVEL2]
subroutine zgerc(m,n,alpha,x,incx,y,incy,a,lda)
.. Scalar Arguments ..
complex(kind=real64),intent(in) :: alpha
integer,intent(in) :: incx,incy,lda,m,n
..
.. Array Arguments ..
complex(kind=real64),intent(in) :: x(*),y(*)
complex(kind=real64),intent(inout) :: a(lda,*)
..
ZGERC performs the rank 1 operation
A := alpha*x*y**H + A,
where alpha is a scalar, x is an m element vector, y is an n element vector and A is an m by n matrix.
M
M is INTEGER
On entry, M specifies the number of rows of the matrix A.
M must be at least zero.
N
N is INTEGER
On entry, N specifies the number of columns of the matrix A.
N must be at least zero.
ALPHA
ALPHA is complex(kind=real64)
On entry, ALPHA specifies the scalar alpha.
X
X is complex(kind=real64) array, dimension at least
( 1 + ( m - 1 )*abs( INCX ) ).
Before entry, the incremented array X must contain the m
element vector x.
INCX
INCX is INTEGER
On entry, INCX specifies the increment for the elements of
X. INCX must not be zero.
Y
Y is complex(kind=real64) array, dimension at least
( 1 + ( n - 1 )*abs( INCY ) ).
Before entry, the incremented array Y must contain the n
element vector y.
INCY
INCY is INTEGER
On entry, INCY specifies the increment for the elements of
Y. INCY must not be zero.
A
A is complex(kind=real64) array, dimension ( LDA, N )
Before entry, the leading m by n part of the array A must
contain the matrix of coefficients. On exit, A is
overwritten by the updated matrix.
LDA
LDA is INTEGER
On entry, LDA specifies the first dimension of A as declared
in the calling (sub) program. LDA must be at least
max( 1, m ).
date:December 2016
FURTHER DETAILS
Level 2 Blas routine.
– Written on 22-October-1986. Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office. Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs.
Online html documentation available at
http://www.netlib.org/lapack/explore-html/
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | m | |||
integer, | intent(in) | :: | n | |||
complex(kind=real64), | intent(in) | :: | alpha | |||
complex(kind=real64), | intent(in) | :: | x(*) | |||
integer, | intent(in) | :: | incx | |||
complex(kind=real64), | intent(in) | :: | y(*) | |||
integer, | intent(in) | :: | incy | |||
complex(kind=real64), | intent(inout) | :: | a(lda,*) | |||
integer, | intent(in) | :: | lda |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | i | ||||
integer, | public | :: | info | ||||
integer, | public | :: | ix | ||||
integer, | public | :: | j | ||||
integer, | public | :: | jy | ||||
integer, | public | :: | kx | ||||
complex(kind=real64), | public | :: | temp | ||||
complex(kind=real64), | public, | parameter | :: | zero | = | (0.0d+0,0.0d+0) |
subroutine zgerc(m,n,alpha,x,incx,y,incy,a,lda)
implicit none
!
! -- Reference BLAS level2 routine (version 3.7.0) --
! -- Reference BLAS is a software package provided by Univ. of Tennessee, --
! -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
! December 2016
!
! .. Scalar Arguments ..
complex(kind=real64),intent(in) :: alpha
integer,intent(in) :: incx,incy,lda,m,n
! ..
! .. Array Arguments ..
complex(kind=real64),intent(in) :: x(*),y(*)
complex(kind=real64),intent(inout) :: a(lda,*)
! ..
!
! =====================================================================
!
! .. Parameters ..
complex(kind=real64) :: zero
parameter (zero= (0.0d+0,0.0d+0))
! ..
! .. Local Scalars ..
complex(kind=real64) :: temp
integer i,info,ix,j,jy,kx
! ..
! .. External Subroutines ..
! EXTERNAL XERBLA
! ..
! .. Intrinsic Functions ..
intrinsic dconjg,max
! ..
!
! Test the input parameters.
!
info = 0
if (m.lt.0) then
info = 1
elseif (n.lt.0) then
info = 2
elseif (incx.eq.0) then
info = 5
elseif (incy.eq.0) then
info = 7
elseif (lda.lt.max(1,m)) then
info = 9
endif
if (info.ne.0) then
call xerbla('ZGERC ',info)
return
endif
!
! Quick return if possible.
!
if ((m.eq.0) .or. (n.eq.0) .or. (alpha.eq.zero)) return
!
! Start the operations. In this version the elements of A are
! accessed sequentially with one pass through A.
!
if (incy.gt.0) then
jy = 1
else
jy = 1 - (n-1)*incy
endif
if (incx.eq.1) then
do j = 1,n
if (y(jy).ne.zero) then
temp = alpha*dconjg(y(jy))
a(1:m,j) = a(1:m,j) + x(1:m)*temp
endif
jy = jy + incy
enddo
else
if (incx.gt.0) then
kx = 1
else
kx = 1 - (m-1)*incx
endif
do j = 1,n
if (y(jy).ne.zero) then
temp = alpha*dconjg(y(jy))
ix = kx
do i = 1,m
a(i,j) = a(i,j) + x(ix)*temp
ix = ix + incx
enddo
endif
jy = jy + incy
enddo
endif
end subroutine zgerc