LAPACK  3.10.0 LAPACK: Linear Algebra PACKage

## ◆ 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.

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.```

Definition at line 103 of file slargv.f.

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