You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/blas/base/dsyrk/lib/base.js
+24-14Lines changed: 24 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -164,10 +164,10 @@ function scal( uplo, N, beta, X, strideX1, strideX2, offsetX ) { // TODO: consid
164
164
// MAIN //
165
165
166
166
/**
167
-
* Performs one of the symmetric rank `K` operations `C = α*A*A**T + β*C` or `C = α*A**T*A + β*C` where `α` and `β` are scalars, `C` is an `N` by `N` symmetric matrix and `A` is an `N` by `K` matrix in the first case and a `K` by `N` matrix in the second case.
167
+
* Performs one of the symmetric rank `K` operations `C = α*A*A^T + β*C` or `C = α*A^T*A + β*C` where `α` and `β` are scalars, `C` is an `N` by `N` symmetric matrix and `A` is an `N` by `K` matrix in the first case and a `K` by `N` matrix in the second case.
168
168
*
169
169
* @private
170
-
* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `C` is supplied
170
+
* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `C` to be referenced
171
171
* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
172
172
* @param {NonNegativeInteger} N - order of the matrix `C`
173
173
* @param {NonNegativeInteger} K - number of columns or number of rows of the matrix `A`
@@ -206,6 +206,8 @@ function dsyrk( uplo, trans, N, K, alpha, A, strideA1, strideA2, offsetA, beta,
206
206
vari2;
207
207
vari1;
208
208
vari0;
209
+
varia;
210
+
varic;
209
211
210
212
isrma=isRowMajor([strideA1,strideA2]);
211
213
@@ -242,13 +244,15 @@ function dsyrk( uplo, trans, N, K, alpha, A, strideA1, strideA2, offsetA, beta,
242
244
){
243
245
for(i2=0;i2<N;i2++){
244
246
for(i1=i2;i1<N;i1++){
247
+
ic=offsetC+(i1*sc0);
245
248
tmp=0.0;
246
249
for(i0=0;i0<K;i0++){
247
-
oa1=oa+(i2*sa1)+(i0*sa0);
248
-
oa2=oa+(i1*sa1)+(i0*sa0);
250
+
ia=oa+(i0*sa0);
251
+
oa1=ia+(i2*sa1);
252
+
oa2=ia+(i1*sa1);
249
253
tmp+=A[oa1]*A[oa2];
250
254
}
251
-
idx=offsetC+(i2*sc1)+(i1*sc0);
255
+
idx=ic+(i2*sc1);
252
256
C[idx]+=alpha*tmp;
253
257
}
254
258
}
@@ -261,12 +265,14 @@ function dsyrk( uplo, trans, N, K, alpha, A, strideA1, strideA2, offsetA, beta,
261
265
for(i2=0;i2<N;i2++){
262
266
for(i1=0;i1<=i2;i1++){
263
267
tmp=0.0;
268
+
ic=offsetC+(i1*sc0);
264
269
for(i0=0;i0<K;i0++){
265
-
oa1=oa+(i2*sa1)+(i0*sa0);
266
-
oa2=oa+(i1*sa1)+(i0*sa0);
270
+
ia=oa+(i0*sa0);
271
+
oa1=ia+(i2*sa1);
272
+
oa2=ia+(i1*sa1);
267
273
tmp+=A[oa1]*A[oa2];
268
274
}
269
-
idx=offsetC+(i2*sc1)+(i1*sc0);
275
+
idx=ic+(i2*sc1);
270
276
C[idx]+=alpha*tmp;
271
277
}
272
278
}
@@ -278,13 +284,15 @@ function dsyrk( uplo, trans, N, K, alpha, A, strideA1, strideA2, offsetA, beta,
278
284
){
279
285
for(i2=0;i2<N;i2++){
280
286
for(i1=i2;i1<N;i1++){
287
+
ic=offsetC+(i1*sc0);
281
288
tmp=0.0;
282
289
for(i0=0;i0<K;i0++){
283
-
oa1=oa+(i0*sa1)+(i2*sa0);
284
-
oa2=oa+(i0*sa1)+(i1*sa0);
290
+
ia=oa+(i0*sa1);
291
+
oa1=ia+(i2*sa0);
292
+
oa2=ia+(i1*sa0);
285
293
tmp+=A[oa1]*A[oa2];
286
294
}
287
-
idx=offsetC+(i2*sc1)+(i1*sc0);
295
+
idx=ic+(i2*sc1);
288
296
C[idx]+=alpha*tmp;
289
297
}
290
298
}
@@ -293,13 +301,15 @@ function dsyrk( uplo, trans, N, K, alpha, A, strideA1, strideA2, offsetA, beta,
0 commit comments