Annotation of rpl/lapack/blas/dsyr.f, revision 1.16
1.8 bertrand 1: *> \brief \b DSYR
2: *
3: * =========== DOCUMENTATION ===========
4: *
1.13 bertrand 5: * Online html documentation available at
6: * http://www.netlib.org/lapack/explore-html/
1.8 bertrand 7: *
8: * Definition:
9: * ===========
10: *
11: * SUBROUTINE DSYR(UPLO,N,ALPHA,X,INCX,A,LDA)
1.13 bertrand 12: *
1.8 bertrand 13: * .. Scalar Arguments ..
14: * DOUBLE PRECISION ALPHA
15: * INTEGER INCX,LDA,N
16: * CHARACTER UPLO
17: * ..
18: * .. Array Arguments ..
19: * DOUBLE PRECISION A(LDA,*),X(*)
20: * ..
1.13 bertrand 21: *
1.8 bertrand 22: *
23: *> \par Purpose:
24: * =============
25: *>
26: *> \verbatim
27: *>
28: *> DSYR performs the symmetric rank 1 operation
29: *>
30: *> A := alpha*x*x**T + A,
31: *>
32: *> where alpha is a real scalar, x is an n element vector and A is an
33: *> n by n symmetric matrix.
34: *> \endverbatim
35: *
36: * Arguments:
37: * ==========
38: *
39: *> \param[in] UPLO
40: *> \verbatim
41: *> UPLO is CHARACTER*1
42: *> On entry, UPLO specifies whether the upper or lower
43: *> triangular part of the array A is to be referenced as
44: *> follows:
45: *>
46: *> UPLO = 'U' or 'u' Only the upper triangular part of A
47: *> is to be referenced.
48: *>
49: *> UPLO = 'L' or 'l' Only the lower triangular part of A
50: *> is to be referenced.
51: *> \endverbatim
52: *>
53: *> \param[in] N
54: *> \verbatim
55: *> N is INTEGER
56: *> On entry, N specifies the order of the matrix A.
57: *> N must be at least zero.
58: *> \endverbatim
59: *>
60: *> \param[in] ALPHA
61: *> \verbatim
62: *> ALPHA is DOUBLE PRECISION.
63: *> On entry, ALPHA specifies the scalar alpha.
64: *> \endverbatim
65: *>
66: *> \param[in] X
67: *> \verbatim
1.14 bertrand 68: *> X is DOUBLE PRECISION array, dimension at least
1.8 bertrand 69: *> ( 1 + ( n - 1 )*abs( INCX ) ).
70: *> Before entry, the incremented array X must contain the n
71: *> element vector x.
72: *> \endverbatim
73: *>
74: *> \param[in] INCX
75: *> \verbatim
76: *> INCX is INTEGER
77: *> On entry, INCX specifies the increment for the elements of
78: *> X. INCX must not be zero.
79: *> \endverbatim
80: *>
81: *> \param[in,out] A
82: *> \verbatim
1.14 bertrand 83: *> A is DOUBLE PRECISION array, dimension ( LDA, N )
1.8 bertrand 84: *> Before entry with UPLO = 'U' or 'u', the leading n by n
85: *> upper triangular part of the array A must contain the upper
86: *> triangular part of the symmetric matrix and the strictly
87: *> lower triangular part of A is not referenced. On exit, the
88: *> upper triangular part of the array A is overwritten by the
89: *> upper triangular part of the updated matrix.
90: *> Before entry with UPLO = 'L' or 'l', the leading n by n
91: *> lower triangular part of the array A must contain the lower
92: *> triangular part of the symmetric matrix and the strictly
93: *> upper triangular part of A is not referenced. On exit, the
94: *> lower triangular part of the array A is overwritten by the
95: *> lower triangular part of the updated matrix.
96: *> \endverbatim
97: *>
98: *> \param[in] LDA
99: *> \verbatim
100: *> LDA is INTEGER
101: *> On entry, LDA specifies the first dimension of A as declared
102: *> in the calling (sub) program. LDA must be at least
103: *> max( 1, n ).
104: *> \endverbatim
105: *
106: * Authors:
107: * ========
108: *
1.13 bertrand 109: *> \author Univ. of Tennessee
110: *> \author Univ. of California Berkeley
111: *> \author Univ. of Colorado Denver
112: *> \author NAG Ltd.
1.8 bertrand 113: *
114: *> \ingroup double_blas_level2
115: *
116: *> \par Further Details:
117: * =====================
118: *>
119: *> \verbatim
120: *>
121: *> Level 2 Blas routine.
122: *>
123: *> -- Written on 22-October-1986.
124: *> Jack Dongarra, Argonne National Lab.
125: *> Jeremy Du Croz, Nag Central Office.
126: *> Sven Hammarling, Nag Central Office.
127: *> Richard Hanson, Sandia National Labs.
128: *> \endverbatim
129: *>
130: * =====================================================================
1.1 bertrand 131: SUBROUTINE DSYR(UPLO,N,ALPHA,X,INCX,A,LDA)
1.8 bertrand 132: *
1.16 ! bertrand 133: * -- Reference BLAS level2 routine --
1.8 bertrand 134: * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
135: * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
136: *
1.1 bertrand 137: * .. Scalar Arguments ..
138: DOUBLE PRECISION ALPHA
139: INTEGER INCX,LDA,N
140: CHARACTER UPLO
141: * ..
142: * .. Array Arguments ..
143: DOUBLE PRECISION A(LDA,*),X(*)
144: * ..
145: *
146: * =====================================================================
147: *
148: * .. Parameters ..
149: DOUBLE PRECISION ZERO
150: PARAMETER (ZERO=0.0D+0)
151: * ..
152: * .. Local Scalars ..
153: DOUBLE PRECISION TEMP
154: INTEGER I,INFO,IX,J,JX,KX
155: * ..
156: * .. External Functions ..
157: LOGICAL LSAME
158: EXTERNAL LSAME
159: * ..
160: * .. External Subroutines ..
161: EXTERNAL XERBLA
162: * ..
163: * .. Intrinsic Functions ..
164: INTRINSIC MAX
165: * ..
166: *
167: * Test the input parameters.
168: *
169: INFO = 0
170: IF (.NOT.LSAME(UPLO,'U') .AND. .NOT.LSAME(UPLO,'L')) THEN
171: INFO = 1
172: ELSE IF (N.LT.0) THEN
173: INFO = 2
174: ELSE IF (INCX.EQ.0) THEN
175: INFO = 5
176: ELSE IF (LDA.LT.MAX(1,N)) THEN
177: INFO = 7
178: END IF
179: IF (INFO.NE.0) THEN
180: CALL XERBLA('DSYR ',INFO)
181: RETURN
182: END IF
183: *
184: * Quick return if possible.
185: *
186: IF ((N.EQ.0) .OR. (ALPHA.EQ.ZERO)) RETURN
187: *
188: * Set the start point in X if the increment is not unity.
189: *
190: IF (INCX.LE.0) THEN
191: KX = 1 - (N-1)*INCX
192: ELSE IF (INCX.NE.1) THEN
193: KX = 1
194: END IF
195: *
196: * Start the operations. In this version the elements of A are
197: * accessed sequentially with one pass through the triangular part
198: * of A.
199: *
200: IF (LSAME(UPLO,'U')) THEN
201: *
202: * Form A when A is stored in upper triangle.
203: *
204: IF (INCX.EQ.1) THEN
205: DO 20 J = 1,N
206: IF (X(J).NE.ZERO) THEN
207: TEMP = ALPHA*X(J)
208: DO 10 I = 1,J
209: A(I,J) = A(I,J) + X(I)*TEMP
210: 10 CONTINUE
211: END IF
212: 20 CONTINUE
213: ELSE
214: JX = KX
215: DO 40 J = 1,N
216: IF (X(JX).NE.ZERO) THEN
217: TEMP = ALPHA*X(JX)
218: IX = KX
219: DO 30 I = 1,J
220: A(I,J) = A(I,J) + X(IX)*TEMP
221: IX = IX + INCX
222: 30 CONTINUE
223: END IF
224: JX = JX + INCX
225: 40 CONTINUE
226: END IF
227: ELSE
228: *
229: * Form A when A is stored in lower triangle.
230: *
231: IF (INCX.EQ.1) THEN
232: DO 60 J = 1,N
233: IF (X(J).NE.ZERO) THEN
234: TEMP = ALPHA*X(J)
235: DO 50 I = J,N
236: A(I,J) = A(I,J) + X(I)*TEMP
237: 50 CONTINUE
238: END IF
239: 60 CONTINUE
240: ELSE
241: JX = KX
242: DO 80 J = 1,N
243: IF (X(JX).NE.ZERO) THEN
244: TEMP = ALPHA*X(JX)
245: IX = JX
246: DO 70 I = J,N
247: A(I,J) = A(I,J) + X(IX)*TEMP
248: IX = IX + INCX
249: 70 CONTINUE
250: END IF
251: JX = JX + INCX
252: 80 CONTINUE
253: END IF
254: END IF
255: *
256: RETURN
257: *
1.16 ! bertrand 258: * End of DSYR
1.1 bertrand 259: *
260: END
CVSweb interface <joel.bertrand@systella.fr>