OpenRadioss
2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
ssyr.f
Go to the documentation of this file.
1
*> \brief \b SSYR
2
*
3
* =========== DOCUMENTATION ===========
4
*
5
* Online html documentation available at
6
* http://www.netlib.org/lapack/explore-html/
7
*
8
* Definition:
9
* ===========
10
*
11
* SUBROUTINE SSYR(UPLO,N,ALPHA,X,INCX,A,LDA)
12
*
13
* .. Scalar Arguments ..
14
* REAL ALPHA
15
* INTEGER INCX,LDA,N
16
* CHARACTER UPLO
17
* ..
18
* .. Array Arguments ..
19
* REAL A(LDA,*),X(*)
20
* ..
21
*
22
*
23
*> \par Purpose:
24
* =============
25
*>
26
*> \verbatim
27
*>
28
*> SSYR 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 REAL
63
*> On entry, ALPHA specifies the scalar alpha.
64
*> \endverbatim
65
*>
66
*> \param[in] X
67
*> \verbatim
68
*> X is REAL array, dimension at least
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
83
*> A is REAL array, dimension ( LDA, N )
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
*
109
*> \author Univ. of Tennessee
110
*> \author Univ. of California Berkeley
111
*> \author Univ. of Colorado Denver
112
*> \author NAG Ltd.
113
*
114
*> \ingroup single_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
* =====================================================================
131
SUBROUTINE
ssyr
(UPLO,N,ALPHA,X,INCX,A,LDA)
132
*
133
* -- Reference BLAS level2 routine --
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
*
137
* .. Scalar Arguments ..
138
REAL
ALPHA
139
INTEGER
INCX,LDA,N
140
CHARACTER
UPLO
141
* ..
142
* .. Array Arguments ..
143
REAL
A(LDA,*),X(*)
144
* ..
145
*
146
* =====================================================================
147
*
148
* .. Parameters ..
149
REAL
ZERO
150
parameter(zero=0.0e+0)
151
* ..
152
* .. Local Scalars ..
153
REAL
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
.LT.
ELSE IF (N0) THEN
173
INFO = 2
174
.EQ.
ELSE IF (INCX0) THEN
175
INFO = 5
176
.LT.
ELSE IF (LDAMAX(1,N)) THEN
177
INFO = 7
178
END IF
179
.NE.
IF (INFO0) THEN
180
CALL XERBLA('
ssyr
',INFO)
181
RETURN
182
END IF
183
*
184
* Quick return if possible.
185
*
186
.EQ..OR..EQ.
IF ((N0) (ALPHAZERO)) RETURN
187
*
188
* Set the start point in X if the increment is not unity.
189
*
190
.LE.
IF (INCX0) THEN
191
KX = 1 - (N-1)*INCX
192
.NE.
ELSE IF (INCX1) 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
.EQ.
IF (INCX1) THEN
205
DO 20 J = 1,N
206
.NE.
IF (X(J)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
.NE.
IF (X(JX)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
.EQ.
IF (INCX1) THEN
232
DO 60 J = 1,N
233
.NE.
IF (X(J)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
.NE.
IF (X(JX)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
*
258
* End of SSYR
259
*
260
END
xerbla
subroutine xerbla(srname, info)
XERBLA
Definition
xerbla.f:60
ssyr
subroutine ssyr(uplo, n, alpha, x, incx, a, lda)
SSYR
Definition
ssyr.f:132
max
#define max(a, b)
Definition
macros.h:21
engine
extlib
lapack-3.10.1
BLAS
SRC
ssyr.f
Generated by
1.15.0