LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ slargv()

subroutine slargv ( integer n,
real, dimension( * ) x,
integer incx,
real, dimension( * ) y,
integer incy,
real, dimension( * ) c,
integer incc )

SLARGV generates a vector of plane rotations with real cosines and real sines.

Download SLARGV + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> SLARGV generates a vector of real plane rotations, determined by
!> elements of the real vectors x and y. For i = 1,2,...,n
!>
!>    (  c(i)  s(i) ) ( x(i) ) = ( a(i) )
!>    ( -s(i)  c(i) ) ( y(i) ) = (   0  )
!> 
Parameters
[in]N
!>          N is INTEGER
!>          The number of plane rotations to be generated.
!> 
[in,out]X
!>          X is REAL array,
!>                         dimension (1+(N-1)*INCX)
!>          On entry, the vector x.
!>          On exit, x(i) is overwritten by a(i), for i = 1,...,n.
!> 
[in]INCX
!>          INCX is INTEGER
!>          The increment between elements of X. INCX > 0.
!> 
[in,out]Y
!>          Y is REAL array,
!>                         dimension (1+(N-1)*INCY)
!>          On entry, the vector y.
!>          On exit, the sines of the plane rotations.
!> 
[in]INCY
!>          INCY is INTEGER
!>          The increment between elements of Y. INCY > 0.
!> 
[out]C
!>          C is REAL array, dimension (1+(N-1)*INCC)
!>          The cosines of the plane rotations.
!> 
[in]INCC
!>          INCC is INTEGER
!>          The increment between elements of C. INCC > 0.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 101 of file slargv.f.

102*
103* -- LAPACK auxiliary routine --
104* -- LAPACK is a software package provided by Univ. of Tennessee, --
105* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
106*
107* .. Scalar Arguments ..
108 INTEGER INCC, INCX, INCY, N
109* ..
110* .. Array Arguments ..
111 REAL C( * ), X( * ), Y( * )
112* ..
113*
114* =====================================================================
115*
116* .. Parameters ..
117 REAL ZERO, ONE
118 parameter( zero = 0.0e+0, one = 1.0e+0 )
119* ..
120* .. Local Scalars ..
121 INTEGER I, IC, IX, IY
122 REAL F, G, T, TT
123* ..
124* .. Intrinsic Functions ..
125 INTRINSIC abs, sqrt
126* ..
127* .. Executable Statements ..
128*
129 ix = 1
130 iy = 1
131 ic = 1
132 DO 10 i = 1, n
133 f = x( ix )
134 g = y( iy )
135 IF( g.EQ.zero ) THEN
136 c( ic ) = one
137 ELSE IF( f.EQ.zero ) THEN
138 c( ic ) = zero
139 y( iy ) = one
140 x( ix ) = g
141 ELSE IF( abs( f ).GT.abs( g ) ) THEN
142 t = g / f
143 tt = sqrt( one+t*t )
144 c( ic ) = one / tt
145 y( iy ) = t*c( ic )
146 x( ix ) = f*tt
147 ELSE
148 t = f / g
149 tt = sqrt( one+t*t )
150 y( iy ) = one / tt
151 c( ic ) = t*y( iy )
152 x( ix ) = g*tt
153 END IF
154 ic = ic + incc
155 iy = iy + incy
156 ix = ix + incx
157 10 CONTINUE
158 RETURN
159*
160* End of SLARGV
161*
Here is the caller graph for this function: