drot Subroutine

public subroutine drot(n, dx, incx, dy, incy, c, s)

NAME

drot(3f) - [BLAS:SINGLE_BLAS_LEVEL1] DROT applies a plane rotation.

SYNOPSIS

 subroutine drot(n,dx,incx,dy,incy,c,s) applies a plane rotation.

   .. Scalar Arguments ..
   double precision,intent(in)    :: c,s
   integer,intent(in)             :: incx,incy,n
   ..
   .. Array Arguments ..
   double precision,intent(inout) :: dx(*),dy(*)
   ..

DEFINITION

 DROT applies a plane rotation.

OPTIONS

N number of elements in input vector(s) DX 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 C S

AUTHORS

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

date:November 2017

\ingroup double_blas_level1

FURTHER DETAILS

  jack dongarra, linpack, 3/11/78.
  modified 12/3/93, array(1) declarations changed to array(*)

SEE ALSO

Online html documentation available at
http://www.netlib.org/lapack/explore-html/

Arguments

Type IntentOptional 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) :: c
double precision, intent(in) :: s

Contents

Source Code


Variables

Type Visibility Attributes Name Initial
double precision, public :: dtemp
integer, public :: i
integer, public :: ix
integer, public :: iy

Source Code

       subroutine drot(n,dx,incx,dy,incy,c,s)
      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 ..
      double precision,intent(in)    :: c,s
      integer,intent(in)             :: incx,incy,n
!     ..
!     .. Array Arguments ..
      double precision,intent(inout) :: dx(*),dy(*)
!     ..
!
!  =====================================================================
!
!     .. Local Scalars ..
      double precision dtemp
      integer i,ix,iy
!     ..
      if (n.le.0) return
      if (incx.eq.1 .and. incy.eq.1) then
!
!       code for both increments equal to 1
!
         do i = 1,n
            dtemp = c*dx(i) + s*dy(i)
            dy(i) = c*dy(i) - s*dx(i)
            dx(i) = dtemp
         enddo
      else
!
!       code for unequal increments or equal increments not equal
!         to 1
!
         ix = 1
         iy = 1
         if (incx.lt.0) ix = (-n+1)*incx + 1
         if (incy.lt.0) iy = (-n+1)*incy + 1
         do i = 1,n
            dtemp = c*dx(ix) + s*dy(iy)
            dy(iy) = c*dy(iy) - s*dx(ix)
            dx(ix) = dtemp
            ix = ix + incx
            iy = iy + incy
         enddo
      endif

      end subroutine drot