drotm(3f) - [BLAS:SINGLE_BLAS_LEVEL1] Apply the Modified Givens
Transformation, H, to the 2 by N matrix
subroutine drotm(n,dx,incx,dy,incy,dparam)
.. Scalar Arguments ..
integer,intent(in) :: incx,incy,n
..
.. Array Arguments ..
double precision,intent(in) :: dparam(5)
double precision,intent(inout) :: dx(*),dy(*)
..
Apply the Modified Givens Transformation, H, to the 2 by N matrix
(DX**T) , where **T indicates transpose. the elements of DX are in
(DY**T)
DX(LX+I*INCX), I = 0 to N-1, where LX = 1 if INCX .ge. 0, else
LX = (-INCX)*N, and similarly for SY using LY and INCY.
with DPARAM(1)=DFLAG, H has one of the following forms..
DFLAG=-1.D0 DFLAG=0.D0 DFLAG=1.D0 DFLAG=-2.D0
(DH11 DH12) (1.D0 DH12) (DH11 1.D0) (1.D0 0.D0)
H=( ) ( ) ( ) ( )
(DH21 DH22), (DH21 1.D0), (-1.D0 DH22), (0.D0 1.D0).
SEE DROTMG FOR A DESCRIPTION OF DATA STORAGE IN DPARAM.
N number of elements in input vector(s) DX DX is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
INCX storage spacing between elements of DX
DY DY is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCY ) ) INCY storage spacing between elements of DY
DPARAM array, dimension (5)
DPARAM(1)=DFLAG
DPARAM(2)=DH11
DPARAM(3)=DH21
DPARAM(4)=DH12
DPARAM(5)=DH22
date:November 2017
\ingroup double_blas_level1
Online html documentation available at
http://www.netlib.org/lapack/explore-html/
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n | |||
double precision, | intent(inout) | :: | dx(*) | |||
integer, | intent(in) | :: | incx | |||
double precision, | intent(inout) | :: | dy(*) | |||
integer, | intent(in) | :: | incy | |||
double precision, | intent(in) | :: | dparam(5) |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
double precision, | public | :: | dflag | ||||
double precision, | public | :: | dh11 | ||||
double precision, | public | :: | dh12 | ||||
double precision, | public | :: | dh21 | ||||
double precision, | public | :: | dh22 | ||||
integer, | public | :: | i | ||||
integer, | public | :: | kx | ||||
integer, | public | :: | ky | ||||
integer, | public | :: | nsteps | ||||
doubleprecision, | public, | parameter | :: | two | = | 2.0d0 | |
double precision, | public | :: | w | ||||
double precision, | public | :: | z | ||||
doubleprecision, | public, | parameter | :: | zero | = | 0.0d0 |
subroutine drotm(n,dx,incx,dy,incy,dparam)
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 ..
integer,intent(in) :: incx,incy,n
! ..
! .. Array Arguments ..
double precision,intent(in) :: dparam(5)
double precision,intent(inout) :: dx(*),dy(*)
! ..
!
! =====================================================================
!
! .. Local Scalars ..
double precision dflag,dh11,dh12,dh21,dh22,w,z
integer i,kx,ky,nsteps
! ..
doubleprecision,parameter :: zero=0.0d0
doubleprecision,parameter :: two=2.0d0
! ..
!
dflag = dparam(1)
if (n.le.0 .or. (dflag+two.eq.zero)) return
if (incx.eq.incy.and.incx.gt.0) then
!
nsteps = n*incx
if (dflag.lt.zero) then
dh11 = dparam(2)
dh12 = dparam(4)
dh21 = dparam(3)
dh22 = dparam(5)
do i = 1,nsteps,incx
w = dx(i)
z = dy(i)
dx(i) = w*dh11 + z*dh12
dy(i) = w*dh21 + z*dh22
enddo
elseif (dflag.eq.zero) then
dh12 = dparam(4)
dh21 = dparam(3)
do i = 1,nsteps,incx
w = dx(i)
z = dy(i)
dx(i) = w + z*dh12
dy(i) = w*dh21 + z
enddo
else
dh11 = dparam(2)
dh22 = dparam(5)
do i = 1,nsteps,incx
w = dx(i)
z = dy(i)
dx(i) = w*dh11 + z
dy(i) = -w + dh22*z
enddo
endif
else
kx = 1
ky = 1
if (incx.lt.0) kx = 1 + (1-n)*incx
if (incy.lt.0) ky = 1 + (1-n)*incy
!
if (dflag.lt.zero) then
dh11 = dparam(2)
dh12 = dparam(4)
dh21 = dparam(3)
dh22 = dparam(5)
do i = 1,n
w = dx(kx)
z = dy(ky)
dx(kx) = w*dh11 + z*dh12
dy(ky) = w*dh21 + z*dh22
kx = kx + incx
ky = ky + incy
enddo
elseif (dflag.eq.zero) then
dh12 = dparam(4)
dh21 = dparam(3)
do i = 1,n
w = dx(kx)
z = dy(ky)
dx(kx) = w + z*dh12
dy(ky) = w*dh21 + z
kx = kx + incx
ky = ky + incy
enddo
else
dh11 = dparam(2)
dh22 = dparam(5)
do i = 1,n
w = dx(kx)
z = dy(ky)
dx(kx) = w*dh11 + z
dy(ky) = -w + dh22*z
kx = kx + incx
ky = ky + incy
enddo
endif
endif
end subroutine drotm