```001:       SUBROUTINE DLARGV( N, X, INCX, Y, INCY, C, INCC )
002: *
003: *  -- LAPACK auxiliary routine (version 3.2) --
004: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
005: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
006: *     November 2006
007: *
008: *     .. Scalar Arguments ..
009:       INTEGER            INCC, INCX, INCY, N
010: *     ..
011: *     .. Array Arguments ..
012:       DOUBLE PRECISION   C( * ), X( * ), Y( * )
013: *     ..
014: *
015: *  Purpose
016: *  =======
017: *
018: *  DLARGV generates a vector of real plane rotations, determined by
019: *  elements of the real vectors x and y. For i = 1,2,...,n
020: *
021: *     (  c(i)  s(i) ) ( x(i) ) = ( a(i) )
022: *     ( -s(i)  c(i) ) ( y(i) ) = (   0  )
023: *
024: *  Arguments
025: *  =========
026: *
027: *  N       (input) INTEGER
028: *          The number of plane rotations to be generated.
029: *
030: *  X       (input/output) DOUBLE PRECISION array,
031: *                         dimension (1+(N-1)*INCX)
032: *          On entry, the vector x.
033: *          On exit, x(i) is overwritten by a(i), for i = 1,...,n.
034: *
035: *  INCX    (input) INTEGER
036: *          The increment between elements of X. INCX > 0.
037: *
038: *  Y       (input/output) DOUBLE PRECISION array,
039: *                         dimension (1+(N-1)*INCY)
040: *          On entry, the vector y.
041: *          On exit, the sines of the plane rotations.
042: *
043: *  INCY    (input) INTEGER
044: *          The increment between elements of Y. INCY > 0.
045: *
046: *  C       (output) DOUBLE PRECISION array, dimension (1+(N-1)*INCC)
047: *          The cosines of the plane rotations.
048: *
049: *  INCC    (input) INTEGER
050: *          The increment between elements of C. INCC > 0.
051: *
052: *  =====================================================================
053: *
054: *     .. Parameters ..
055:       DOUBLE PRECISION   ZERO, ONE
056:       PARAMETER          ( ZERO = 0.0D+0, ONE = 1.0D+0 )
057: *     ..
058: *     .. Local Scalars ..
059:       INTEGER            I, IC, IX, IY
060:       DOUBLE PRECISION   F, G, T, TT
061: *     ..
062: *     .. Intrinsic Functions ..
063:       INTRINSIC          ABS, SQRT
064: *     ..
065: *     .. Executable Statements ..
066: *
067:       IX = 1
068:       IY = 1
069:       IC = 1
070:       DO 10 I = 1, N
071:          F = X( IX )
072:          G = Y( IY )
073:          IF( G.EQ.ZERO ) THEN
074:             C( IC ) = ONE
075:          ELSE IF( F.EQ.ZERO ) THEN
076:             C( IC ) = ZERO
077:             Y( IY ) = ONE
078:             X( IX ) = G
079:          ELSE IF( ABS( F ).GT.ABS( G ) ) THEN
080:             T = G / F
081:             TT = SQRT( ONE+T*T )
082:             C( IC ) = ONE / TT
083:             Y( IY ) = T*C( IC )
084:             X( IX ) = F*TT
085:          ELSE
086:             T = F / G
087:             TT = SQRT( ONE+T*T )
088:             Y( IY ) = ONE / TT
089:             C( IC ) = T*Y( IY )
090:             X( IX ) = G*TT
091:          END IF
092:          IC = IC + INCC
093:          IY = IY + INCY
094:          IX = IX + INCX
095:    10 CONTINUE
096:       RETURN
097: *
098: *     End of DLARGV
099: *
100:       END
101: ```