version 1.1.1.1, 2010/01/26 15:22:45
|
version 1.10, 2012/08/22 09:36:40
|
Line 1
|
Line 1
|
SUBROUTINE DROTM(N,DX,INCX,DY,INCY,DPARAM) |
*> \brief \b DROTM |
* .. Scalar Arguments .. |
|
INTEGER INCX,INCY,N |
|
* .. |
|
* .. Array Arguments .. |
|
DOUBLE PRECISION DPARAM(5),DX(*),DY(*) |
|
* .. |
|
* |
|
* Purpose |
|
* ======= |
|
* |
|
* 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 |
* =========== DOCUMENTATION =========== |
* 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 |
* Online html documentation available at |
|
* http://www.netlib.org/lapack/explore-html/ |
* |
* |
* (DH11 DH12) (1.D0 DH12) (DH11 1.D0) (1.D0 0.D0) |
* Definition: |
* H=( ) ( ) ( ) ( ) |
* =========== |
* (DH21 DH22), (DH21 1.D0), (-1.D0 DH22), (0.D0 1.D0). |
* |
* SEE DROTMG FOR A DESCRIPTION OF DATA STORAGE IN DPARAM. |
* SUBROUTINE DROTM(N,DX,INCX,DY,INCY,DPARAM) |
|
* |
|
* .. Scalar Arguments .. |
|
* INTEGER INCX,INCY,N |
|
* .. |
|
* .. Array Arguments .. |
|
* DOUBLE PRECISION DPARAM(5),DX(*),DY(*) |
|
* .. |
|
* |
|
* |
|
*> \par Purpose: |
|
* ============= |
|
*> |
|
*> \verbatim |
|
*> |
|
*> 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. |
|
*> \endverbatim |
|
* |
|
* Arguments: |
|
* ========== |
|
* |
|
*> \param[in] N |
|
*> \verbatim |
|
*> N is INTEGER |
|
*> number of elements in input vector(s) |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] DX |
|
*> \verbatim |
|
*> DX is DOUBLE PRECISION array, dimension N |
|
*> double precision vector with N elements |
|
*> \endverbatim |
|
*> |
|
*> \param[in] INCX |
|
*> \verbatim |
|
*> INCX is INTEGER |
|
*> storage spacing between elements of DX |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] DY |
|
*> \verbatim |
|
*> DY is DOUBLE PRECISION array, dimension N |
|
*> double precision vector with N elements |
|
*> \endverbatim |
|
*> |
|
*> \param[in] INCY |
|
*> \verbatim |
|
*> INCY is INTEGER |
|
*> storage spacing between elements of DY |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] DPARAM |
|
*> \verbatim |
|
*> DPARAM is DOUBLE PRECISION array, dimension 5 |
|
*> DPARAM(1)=DFLAG |
|
*> DPARAM(2)=DH11 |
|
*> DPARAM(3)=DH21 |
|
*> DPARAM(4)=DH12 |
|
*> DPARAM(5)=DH22 |
|
*> \endverbatim |
|
* |
|
* Authors: |
|
* ======== |
|
* |
|
*> \author Univ. of Tennessee |
|
*> \author Univ. of California Berkeley |
|
*> \author Univ. of Colorado Denver |
|
*> \author NAG Ltd. |
* |
* |
* Arguments |
*> \date November 2011 |
* ========= |
|
* |
* |
* N (input) INTEGER |
*> \ingroup double_blas_level1 |
* number of elements in input vector(s) |
|
* |
* |
* DX (input/output) DOUBLE PRECISION array, dimension N |
* ===================================================================== |
* double precision vector with N elements |
SUBROUTINE DROTM(N,DX,INCX,DY,INCY,DPARAM) |
* |
|
* INCX (input) INTEGER |
|
* storage spacing between elements of DX |
|
* |
|
* DY (input/output) DOUBLE PRECISION array, dimension N |
|
* double precision vector with N elements |
|
* |
* |
* INCY (input) INTEGER |
* -- Reference BLAS level1 routine (version 3.4.0) -- |
* storage spacing between elements of DY |
* -- Reference BLAS is a software package provided by Univ. of Tennessee, -- |
|
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- |
|
* November 2011 |
* |
* |
* DPARAM (input/output) DOUBLE PRECISION array, dimension 5 |
* .. Scalar Arguments .. |
* DPARAM(1)=DFLAG |
INTEGER INCX,INCY,N |
* DPARAM(2)=DH11 |
* .. |
* DPARAM(3)=DH21 |
* .. Array Arguments .. |
* DPARAM(4)=DH12 |
DOUBLE PRECISION DPARAM(5),DX(*),DY(*) |
* DPARAM(5)=DH22 |
* .. |
* |
* |
* ===================================================================== |
* ===================================================================== |
* |
* |
Line 61
|
Line 121
|
* .. |
* .. |
* |
* |
DFLAG = DPARAM(1) |
DFLAG = DPARAM(1) |
IF (N.LE.0 .OR. (DFLAG+TWO.EQ.ZERO)) GO TO 140 |
IF (N.LE.0 .OR. (DFLAG+TWO.EQ.ZERO)) RETURN |
IF (.NOT. (INCX.EQ.INCY.AND.INCX.GT.0)) GO TO 70 |
IF (INCX.EQ.INCY.AND.INCX.GT.0) THEN |
* |
* |
NSTEPS = N*INCX |
NSTEPS = N*INCX |
IF (DFLAG) 50,10,30 |
IF (DFLAG.LT.ZERO) THEN |
10 CONTINUE |
DH11 = DPARAM(2) |
DH12 = DPARAM(4) |
DH12 = DPARAM(4) |
DH21 = DPARAM(3) |
DH21 = DPARAM(3) |
DO 20 I = 1,NSTEPS,INCX |
DH22 = DPARAM(5) |
W = DX(I) |
DO I = 1,NSTEPS,INCX |
Z = DY(I) |
W = DX(I) |
DX(I) = W + Z*DH12 |
Z = DY(I) |
DY(I) = W*DH21 + Z |
DX(I) = W*DH11 + Z*DH12 |
20 CONTINUE |
DY(I) = W*DH21 + Z*DH22 |
GO TO 140 |
END DO |
30 CONTINUE |
ELSE IF (DFLAG.EQ.ZERO) THEN |
DH11 = DPARAM(2) |
DH12 = DPARAM(4) |
DH22 = DPARAM(5) |
DH21 = DPARAM(3) |
DO 40 I = 1,NSTEPS,INCX |
DO I = 1,NSTEPS,INCX |
W = DX(I) |
W = DX(I) |
Z = DY(I) |
Z = DY(I) |
DX(I) = W*DH11 + Z |
DX(I) = W + Z*DH12 |
DY(I) = -W + DH22*Z |
DY(I) = W*DH21 + Z |
40 CONTINUE |
END DO |
GO TO 140 |
ELSE |
50 CONTINUE |
DH11 = DPARAM(2) |
DH11 = DPARAM(2) |
DH22 = DPARAM(5) |
DH12 = DPARAM(4) |
DO I = 1,NSTEPS,INCX |
DH21 = DPARAM(3) |
W = DX(I) |
DH22 = DPARAM(5) |
Z = DY(I) |
DO 60 I = 1,NSTEPS,INCX |
DX(I) = W*DH11 + Z |
W = DX(I) |
DY(I) = -W + DH22*Z |
Z = DY(I) |
END DO |
DX(I) = W*DH11 + Z*DH12 |
END IF |
DY(I) = W*DH21 + Z*DH22 |
ELSE |
60 CONTINUE |
KX = 1 |
GO TO 140 |
KY = 1 |
70 CONTINUE |
IF (INCX.LT.0) KX = 1 + (1-N)*INCX |
KX = 1 |
IF (INCY.LT.0) KY = 1 + (1-N)*INCY |
KY = 1 |
* |
IF (INCX.LT.0) KX = 1 + (1-N)*INCX |
IF (DFLAG.LT.ZERO) THEN |
IF (INCY.LT.0) KY = 1 + (1-N)*INCY |
DH11 = DPARAM(2) |
* |
DH12 = DPARAM(4) |
IF (DFLAG) 120,80,100 |
DH21 = DPARAM(3) |
80 CONTINUE |
DH22 = DPARAM(5) |
DH12 = DPARAM(4) |
DO I = 1,N |
DH21 = DPARAM(3) |
W = DX(KX) |
DO 90 I = 1,N |
Z = DY(KY) |
W = DX(KX) |
DX(KX) = W*DH11 + Z*DH12 |
Z = DY(KY) |
DY(KY) = W*DH21 + Z*DH22 |
DX(KX) = W + Z*DH12 |
KX = KX + INCX |
DY(KY) = W*DH21 + Z |
KY = KY + INCY |
KX = KX + INCX |
END DO |
KY = KY + INCY |
ELSE IF (DFLAG.EQ.ZERO) THEN |
90 CONTINUE |
DH12 = DPARAM(4) |
GO TO 140 |
DH21 = DPARAM(3) |
100 CONTINUE |
DO I = 1,N |
DH11 = DPARAM(2) |
W = DX(KX) |
DH22 = DPARAM(5) |
Z = DY(KY) |
DO 110 I = 1,N |
DX(KX) = W + Z*DH12 |
W = DX(KX) |
DY(KY) = W*DH21 + Z |
Z = DY(KY) |
KX = KX + INCX |
DX(KX) = W*DH11 + Z |
KY = KY + INCY |
DY(KY) = -W + DH22*Z |
END DO |
KX = KX + INCX |
ELSE |
KY = KY + INCY |
DH11 = DPARAM(2) |
110 CONTINUE |
DH22 = DPARAM(5) |
GO TO 140 |
DO I = 1,N |
120 CONTINUE |
W = DX(KX) |
DH11 = DPARAM(2) |
Z = DY(KY) |
DH12 = DPARAM(4) |
DX(KX) = W*DH11 + Z |
DH21 = DPARAM(3) |
DY(KY) = -W + DH22*Z |
DH22 = DPARAM(5) |
KX = KX + INCX |
DO 130 I = 1,N |
KY = KY + INCY |
W = DX(KX) |
END DO |
Z = DY(KY) |
END IF |
DX(KX) = W*DH11 + Z*DH12 |
END IF |
DY(KY) = W*DH21 + Z*DH22 |
|
KX = KX + INCX |
|
KY = KY + INCY |
|
130 CONTINUE |
|
140 CONTINUE |
|
RETURN |
RETURN |
END |
END |