Skip to content

Commit 39d15cf

Browse files
committed
chore: clean-up
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: passed - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent dbe5a8d commit 39d15cf

File tree

15 files changed

+114
-85
lines changed

15 files changed

+114
-85
lines changed

lib/node_modules/@stdlib/blas/base/ssyr2/README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The function has the following parameters:
5656
- **y**: second input [`Float32Array`][mdn-float32array].
5757
- **sy**: stride length for `y`.
5858
- **A**: input matrix stored in linear memory as a [`Float32Array`][mdn-float32array].
59-
- **lda**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
59+
- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
6060

6161
The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over every other element of `x`,
6262

@@ -210,11 +210,11 @@ Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` where `α`
210210
```c
211211
#include "stdlib/blas/base/shared.h"
212212

213-
float A[] = { 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 };
214-
const float x[] = { 1.0, 2.0, 3.0 };
215-
const float y[] = { 1.0, 2.0, 3.0 };
213+
float A[] = { 1.0f, 2.0f, 3.0f, 2.0f, 1.0f, 2.0f, 3.0f, 2.0f, 1.0f };
214+
const float x[] = { 1.0f, 2.0f, 3.0f };
215+
const float y[] = { 1.0f, 2.0f, 3.0f };
216216

217-
c_ssyr2( CblasColMajor, CblasUpper, 3, 1.0, x, 1, y, 1, A, 3 );
217+
c_ssyr2( CblasColMajor, CblasUpper, 3, 1.0f, x, 1, y, 1, A, 3 );
218218
```
219219
220220
The function accepts the following arguments:
@@ -243,11 +243,11 @@ Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A`, using alt
243243
```c
244244
#include "stdlib/blas/base/shared.h"
245245

246-
float A[] = { 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 };
247-
const float x[] = { 1.0, 2.0, 3.0 };
248-
const float y[] = { 1.0, 2.0, 3.0 };
246+
float A[] = { 1.0f, 2.0f, 3.0f, 2.0f, 1.0f, 2.0f, 3.0f, 2.0f, 1.0f };
247+
const float x[] = { 1.0f, 2.0f, 3.0f };
248+
const float y[] = { 1.0f, 2.0f, 3.0f };
249249

250-
c_ssyr2_ndarray( CblasUpper, 3, 1.0, x, 1, 0, y, 1, 0, A, 3, 1, 0 );
250+
c_ssyr2_ndarray( CblasUpper, 3, 1.0f, x, 1, 0, y, 1, 0, A, 3, 1, 0 );
251251
```
252252
253253
The function accepts the following arguments:
@@ -296,38 +296,38 @@ void c_ssyr2_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alph
296296
int main( void ) {
297297
// Define 3x3 symmetric matrices stored in row-major layout:
298298
float A1[ 3*3 ] = {
299-
1.0, 2.0, 3.0,
300-
2.0, 1.0, 2.0,
301-
3.0, 2.0, 1.0
299+
1.0f, 2.0f, 3.0f,
300+
2.0f, 1.0f, 2.0f,
301+
3.0f, 2.0f, 1.0f
302302
};
303303

304304
float A2[ 3*3 ] = {
305-
1.0, 2.0, 3.0,
306-
2.0, 1.0, 2.0,
307-
3.0, 2.0, 1.0
305+
1.0f, 2.0f, 3.0f,
306+
2.0f, 1.0f, 2.0f,
307+
3.0f, 2.0f, 1.0f
308308
};
309309

310310
// Define `x` and `y` vectors:
311-
const float x[ 3 ] = { 1.0, 2.0, 3.0 };
312-
const float y[ 3 ] = { 1.0, 2.0, 3.0 };
311+
const float x[ 3 ] = { 1.0f, 2.0f, 3.0f };
312+
const float y[ 3 ] = { 1.0f, 2.0f, 3.0f };
313313

314314
// Specify the number of elements along each dimension of `A1` and `A2`:
315315
const int N = 3;
316316

317317
// Perform the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A`:
318-
c_ssyr2( CblasColMajor, CblasUpper, N, 1.0, x, 1, y, 1, A1, N );
318+
c_ssyr2( CblasColMajor, CblasUpper, N, 1.0f, x, 1, y, 1, A1, N );
319319

320320
// Print the result:
321321
for ( int i = 0; i < N*N; i++ ) {
322-
printf( "A1[ %i ] = %lf\n", i, A1[ i ] );
322+
printf( "A1[ %i ] = %f\n", i, A1[ i ] );
323323
}
324324

325325
// Perform the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` using alternative indexing semantics:
326-
c_ssyr2_ndarray( CblasUpper, N, 1.0, x, 1, 0, y, 1, 0, A2, N, 1, 0 );
326+
c_ssyr2_ndarray( CblasUpper, N, 1.0f, x, 1, 0, y, 1, 0, A2, N, 1, 0 );
327327

328328
// Print the result:
329329
for ( int i = 0; i < N*N; i++ ) {
330-
printf( "A2[ %i ] = %lf\n", i, A2[ i ] );
330+
printf( "A2[ %i ] = %f\n", i, A2[ i ] );
331331
}
332332
}
333333
```

lib/node_modules/@stdlib/blas/base/ssyr2/benchmark/c/benchmark.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ static double benchmark1( int iterations, int N ) {
9494
double t;
9595
int i;
9696

97-
stdlib_strided_sfill( N, 1.0, x, 1 );
98-
stdlib_strided_sfill( N, 1.0, y, 1 );
99-
stdlib_strided_sfill( N*N, 1.0, A, 1 );
97+
stdlib_strided_sfill( N, 1.0f, x, 1 );
98+
stdlib_strided_sfill( N, 1.0f, y, 1 );
99+
stdlib_strided_sfill( N*N, 1.0f, A, 1 );
100100
t = tic();
101101
for ( i = 0; i < iterations; i++ ) {
102-
c_ssyr2( CblasRowMajor, CblasUpper, N, 1.0, x, 1, y, 1, A, N );
102+
c_ssyr2( CblasRowMajor, CblasUpper, N, 1.0f, x, 1, y, 1, A, N );
103103
if ( A[ i%(N*2) ] != A[ i%(N*2) ] ) {
104104
printf( "should not return NaN\n" );
105105
break;
@@ -127,12 +127,12 @@ static double benchmark2( int iterations, int N ) {
127127
double t;
128128
int i;
129129

130-
stdlib_strided_sfill( N, 1.0, x, 1 );
131-
stdlib_strided_sfill( N, 1.0, y, 1 );
132-
stdlib_strided_sfill( N*N, 1.0, A, 1 );
130+
stdlib_strided_sfill( N, 1.0f, x, 1 );
131+
stdlib_strided_sfill( N, 1.0f, y, 1 );
132+
stdlib_strided_sfill( N*N, 1.0f, A, 1 );
133133
t = tic();
134134
for ( i = 0; i < iterations; i++ ) {
135-
c_ssyr2_ndarray( CblasUpper, N, 1.0, x, 1, 0, y, 1, 0, A, N, 1, 0 );
135+
c_ssyr2_ndarray( CblasUpper, N, 1.0f, x, 1, 0, y, 1, 0, A, N, 1, 0 );
136136
if ( A[ i%(N*2) ] != A[ i%(N*2) ] ) {
137137
printf( "should not return NaN\n" );
138138
break;

lib/node_modules/@stdlib/blas/base/ssyr2/docs/repl.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,28 @@
5252

5353
Examples
5454
--------
55+
// Standard usage:
5556
> var x = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] );
5657
> var y = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] );
57-
> var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 2.0 ] );
58+
> var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 2.0, 1.0 ] );
5859
> {{alias}}( 'row-major', 'upper', 2, 1.0, x, 1, y, 1, A, 2 )
59-
<Float32Array>[ 3.0, 4.0, 0.0, 4.0 ]
60+
<Float32Array>[ 3.0, 4.0, 2.0, 3.0 ]
61+
62+
// Advanced indexing:
63+
> x = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] );
64+
> y = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] );
65+
> A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 2.0, 1.0 ] );
66+
> {{alias}}( 'row-major', 'upper', 2, 1.0, x, -1, y, -1, A, 2 )
67+
<Float32Array>[ 3.0, 4.0, 2.0, 3.0 ]
68+
69+
// Using typed array views:
70+
> var x0 = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 1.0 ] );
71+
> var y0 = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 1.0 ] );
72+
> A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 2.0, 1.0 ] );
73+
> var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
74+
> var y1 = new {{alias:@stdlib/array/float32}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 );
75+
> {{alias}}( 'row-major', 'upper', 2, 1.0, x, 1, y, 1, A, 2 )
76+
<Float32Array>[ 3.0, 4.0, 2.0, 3.0 ]
6077

6178

6279
{{alias}}.ndarray( uplo, N, α, x, sx, ox, y, sy, oy, A, sa1, sa2, oa )
@@ -119,9 +136,9 @@
119136
--------
120137
> var x = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] );
121138
> var y = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] );
122-
> var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 2.0 ] );
139+
> var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 2.0, 1.0 ] );
123140
> {{alias}}.ndarray( 'upper', 2, 1.0, x, 1, 0, y, 1, 0, A, 2, 1, 0 )
124-
<Float32Array>[ 3.0, 4.0, 0.0, 4.0 ]
141+
<Float32Array>[ 3.0, 4.0, 2.0, 3.0 ]
125142

126143
See Also
127144
--------

lib/node_modules/@stdlib/blas/base/ssyr2/docs/types/index.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ interface Routine {
4444
* @example
4545
* var Float32Array = require( '@stdlib/array/float32' );
4646
*
47-
* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ]
47+
* var A = new Float32Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ]
4848
* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] );
4949
* var y = new Float32Array( [ 1.0, 2.0, 3.0 ] );
5050
*
5151
* ssyr2( 'row-major', 'upper', 3, 1.0, x, 1, y, 1, A, 3 );
52-
* // A => <Float32Array>[ 3.0, 6.0, 9.0, 0.0, 9.0, 14.0, 0.0, 0.0, 19.0 ]
52+
* // A => <Float32Array>[ 3.0, 6.0, 9.0, 2.0, 9.0, 14.0, 3.0, 2.0, 19.0 ]
5353
*/
5454
( order: Layout, uplo: MatrixTriangle, N: number, alpha: number, x: Float32Array, strideX: number, y: Float32Array, strideY: number, A: Float32Array, LDA: number ): Float32Array;
5555

@@ -74,12 +74,12 @@ interface Routine {
7474
* @example
7575
* var Float32Array = require( '@stdlib/array/float32' );
7676
*
77-
* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ]
77+
* var A = new Float32Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ]
7878
* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] );
7979
* var y = new Float32Array( [ 1.0, 2.0, 3.0 ] );
8080
*
8181
* ssyr2.ndarray( 'upper', 3, 1.0, x, 1, 0, y, 1, 0, A, 3, 1, 0 );
82-
* // A => <Float32Array>[ 3.0, 6.0, 9.0, 0.0, 9.0, 14.0, 0.0, 0.0, 19.0 ]
82+
* // A => <Float32Array>[ 3.0, 6.0, 9.0, 2.0, 9.0, 14.0, 3.0, 2.0, 19.0 ]
8383
*/
8484
ndarray( uplo: MatrixTriangle, N: number, alpha: number, x: Float32Array, strideX: number, offsetX: number, y: Float32Array, strideY: number, offsetY: number, A: Float32Array, strideA1: number, strideA2: number, offsetA: number ): Float32Array;
8585
}
@@ -102,22 +102,22 @@ interface Routine {
102102
* @example
103103
* var Float32Array = require( '@stdlib/array/float32' );
104104
*
105-
* var A = new Float32Array( [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ] );
105+
* var A = new Float32Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] );
106106
* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] );
107107
* var y = new Float32Array( [ 1.0, 2.0, 3.0 ] );
108108
*
109109
* ssyr2( 'column-major', 'upper', 3, 1.0, x, 1, y, 1, A, 3 );
110-
* // A => <Float32Array>[ 3.0, 0.0, 0.0, 6.0, 9.0, 0.0, 9.0, 14.0, 19.0 ]
110+
* // A => <Float32Array>[ 3.0, 6.0, 9.0, 2.0, 9.0, 14.0, 3.0, 2.0, 19.0 ]
111111
*
112112
* @example
113113
* var Float32Array = require( '@stdlib/array/float32' );
114114
*
115-
* var A = new Float32Array( [ 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0 ] );
115+
* var A = new Float32Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] );
116116
* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] );
117117
* var y = new Float32Array( [ 1.0, 2.0, 3.0 ] );
118118
*
119119
* ssyr2.ndarray( 'upper', 3, 1.0, x, 1, 0, y, 1, 0, A, 1, 3, 0 );
120-
* // A => <Float32Array>[ 3.0, 0.0, 0.0, 6.0, 9.0, 0.0, 9.0, 14.0, 19.0 ]
120+
* // A => <Float32Array>[ 3.0, 6.0, 9.0, 2.0, 9.0, 14.0, 3.0, 2.0, 19.0 ]
121121
*/
122122
declare var ssyr2: Routine;
123123

lib/node_modules/@stdlib/blas/base/ssyr2/examples/c/example.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,37 @@
2323
int main( void ) {
2424
// Define 3x3 symmetric matrices stored in row-major layout:
2525
float A1[ 3*3 ] = {
26-
1.0, 2.0, 3.0,
27-
2.0, 1.0, 2.0,
28-
3.0, 2.0, 1.0
26+
1.0f, 2.0f, 3.0f,
27+
2.0f, 1.0f, 2.0f,
28+
3.0f, 2.0f, 1.0f
2929
};
3030

3131
float A2[ 3*3 ] = {
32-
1.0, 2.0, 3.0,
33-
2.0, 1.0, 2.0,
34-
3.0, 2.0, 1.0
32+
1.0f, 2.0f, 3.0f,
33+
2.0f, 1.0f, 2.0f,
34+
3.0f, 2.0f, 1.0f
3535
};
3636

3737
// Define `x` and `y` vectors:
38-
const float x[ 3 ] = { 1.0, 2.0, 3.0 };
39-
const float y[ 3 ] = { 1.0, 2.0, 3.0 };
38+
const float x[ 3 ] = { 1.0f, 2.0f, 3.0f };
39+
const float y[ 3 ] = { 1.0f, 2.0f, 3.0f };
4040

4141
// Specify the number of elements along each dimension of `A1` and `A2`:
4242
const int N = 3;
4343

4444
// Perform the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A`:
45-
c_ssyr2( CblasColMajor, CblasUpper, N, 1.0, x, 1, y, 1, A1, N );
45+
c_ssyr2( CblasColMajor, CblasUpper, N, 1.0f, x, 1, y, 1, A1, N );
4646

4747
// Print the result:
4848
for ( int i = 0; i < N*N; i++ ) {
49-
printf( "A1[ %i ] = %lf\n", i, A1[ i ] );
49+
printf( "A1[ %i ] = %f\n", i, A1[ i ] );
5050
}
5151

5252
// Perform the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` using alternative indexing semantics:
53-
c_ssyr2_ndarray( CblasUpper, N, 1.0, x, 1, 0, y, 1, 0, A2, N, 1, 0 );
53+
c_ssyr2_ndarray( CblasUpper, N, 1.0f, x, 1, 0, y, 1, 0, A2, N, 1, 0 );
5454

5555
// Print the result:
5656
for ( int i = 0; i < N*N; i++ ) {
57-
printf( "A2[ %i ] = %lf\n", i, A2[ i ] );
57+
printf( "A2[ %i ] = %f\n", i, A2[ i ] );
5858
}
5959
}

lib/node_modules/@stdlib/blas/base/ssyr2/examples/index.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ var opts = {
2828

2929
var N = 3;
3030

31-
var A = ones( N*N, opts.dtype );
31+
// Define N-by-N symmetric matrices:
32+
var A1 = ones( N*N, opts.dtype );
33+
var A2 = ones( N*N, opts.dtype );
34+
35+
// Create random vectors:
3236
var x = discreteUniform( N, -10.0, 10.0, opts );
3337
var y = discreteUniform( N, -10.0, 10.0, opts );
3438

35-
ssyr2( 'row-major', 'upper', 3, 1.0, x, 1, y, 1, A, 3 );
36-
console.log( A );
39+
ssyr2( 'row-major', 'upper', 3, 1.0, x, 1, y, 1, A1, 3 );
40+
console.log( A1 );
41+
42+
ssyr2.ndarray( 'upper', 3, 1.0, x, 1, 0, y, 1, 0, A2, 3, 1, 0 );
43+
console.log( A2 );

lib/node_modules/@stdlib/blas/base/ssyr2/include/stdlib/blas/base/ssyr2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
/**
2020
* Header file containing function declarations for the C interface to the BLAS Level 2 routine `ssyr2`.
2121
*/
22-
#ifndef SSYR2_H
23-
#define SSYR2_H
22+
#ifndef STDLIB_BLAS_BASE_SSYR2_H
23+
#define STDLIB_BLAS_BASE_SSYR2_H
2424

2525
#include "stdlib/blas/base/shared.h"
2626

@@ -45,4 +45,4 @@ void API_SUFFIX(c_ssyr2_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, cons
4545
}
4646
#endif
4747

48-
#endif // !SSYR2_H
48+
#endif // !STDLIB_BLAS_BASE_SSYR2_H

lib/node_modules/@stdlib/blas/base/ssyr2/include/stdlib/blas/base/ssyr2_cblas.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
/**
2020
* Header file containing function declarations for the C interface to the CBLAS Level 2 routine `cblas_ssyr2`.
2121
*/
22-
#ifndef SSYR2_CBLAS_H
23-
#define SSYR2_CBLAS_H
22+
#ifndef STDLIB_BLAS_BASE_SSYR2_CBLAS_H
23+
#define STDLIB_BLAS_BASE_SSYR2_CBLAS_H
2424

2525
#include "stdlib/blas/base/shared.h"
2626

@@ -40,4 +40,4 @@ void API_SUFFIX(cblas_ssyr2)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo,
4040
}
4141
#endif
4242

43-
#endif // !SSYR2_CBLAS_H
43+
#endif // !STDLIB_BLAS_BASE_SSYR2_CBLAS_H

lib/node_modules/@stdlib/blas/base/ssyr2/lib/base.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' );
4848
* @example
4949
* var Float32Array = require( '@stdlib/array/float32' );
5050
*
51-
* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ]
51+
* var A = new Float32Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ]
5252
* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] );
5353
* var y = new Float32Array( [ 1.0, 2.0, 3.0 ] );
5454
*
5555
* ssyr2( 'upper', 3, 1.0, x, 1, 0, y, 1, 0, A, 3, 1, 0 );
56-
* // A => <Float32Array>[ 3.0, 6.0, 9.0, 0.0, 9.0, 14.0, 0.0, 0.0, 19.0 ]
56+
* // A => <Float32Array>[ 3.0, 6.0, 9.0, 2.0, 9.0, 14.0, 3.0, 2.0, 19.0 ]
5757
*/
5858
function ssyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-len, max-params
5959
var tmp1;
@@ -67,7 +67,7 @@ function ssyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str
6767
var sa1;
6868
var i0;
6969
var i1;
70-
var oa;
70+
var ia;
7171
var ox;
7272
var oy;
7373

@@ -93,13 +93,14 @@ function ssyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str
9393
if ( ( x[ ix1 ] !== 0.0 ) || ( y[ iy1 ] !== 0.0 ) ) {
9494
tmp1 = f32( alpha * y[ iy1 ] );
9595
tmp2 = f32( alpha * x[ ix1 ] );
96-
oa = offsetA + (sa1*i1);
96+
ia = offsetA + ( sa1*i1 );
9797
ix0 = ox;
9898
iy0 = oy;
9999
for ( i0 = 0; i0 <= i1; i0++ ) {
100-
A[ oa+(sa0*i0) ] += f32( f32( x[ ix0 ] * tmp1 ) + f32( y[ iy0 ] * tmp2 ) ); // eslint-disable-line max-len
100+
A[ ia ] += f32( f32( x[ix0]*tmp1 ) + f32( y[iy0]*tmp2 ) );
101101
ix0 += strideX;
102102
iy0 += strideY;
103+
ia += sa0;
103104
}
104105
}
105106
ix1 += strideX;
@@ -112,13 +113,14 @@ function ssyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str
112113
if ( ( x[ ix1 ] !== 0.0 ) || ( y[ iy1 ] !== 0.0 ) ) {
113114
tmp1 = f32( alpha * y[ iy1 ] );
114115
tmp2 = f32( alpha * x[ ix1 ] );
115-
oa = offsetA + (sa1*i1);
116+
ia = offsetA + ( sa1*i1 ) + ( sa0*i1 );
116117
ix0 = ix1;
117118
iy0 = iy1;
118119
for ( i0 = i1; i0 < N; i0++ ) {
119-
A[ oa+(sa0*i0) ] += f32( f32( x[ ix0 ] * tmp1 ) + f32( y[ iy0 ] * tmp2 ) ); // eslint-disable-line max-len
120+
A[ ia ] += f32( f32( x[ix0]*tmp1 ) + f32( y[iy0]*tmp2 ) );
120121
ix0 += strideX;
121122
iy0 += strideY;
123+
ia += sa0;
122124
}
123125
}
124126
ix1 += strideX;

0 commit comments

Comments
 (0)