Skip to content

Commit 1e1ac8c

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: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - 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 e7bfad8 commit 1e1ac8c

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Note that indexing is relative to the first index. To introduce an offset, use [
8080
var Float32Array = require( '@stdlib/array/float32' );
8181

8282
// Initial arrays...
83-
var x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] );
83+
var x0 = new Float32Array( [ 0.0, 1.0, 1.0, 1.0 ] );
8484
var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] );
8585
var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] );
8686

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface Routine {
3030
* Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix.
3131
*
3232
* @param order - storage layout
33-
* @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced
33+
* @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced
3434
* @param N - number of elements along each dimension in the matrix `A`
3535
* @param alpha - scalar constant
3636
* @param A - input matrix
@@ -91,7 +91,7 @@ interface Routine {
9191
* Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix.
9292
*
9393
* @param order - storage layout
94-
* @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced
94+
* @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced
9595
* @param N - number of elements along each dimension in the matrix `A`
9696
* @param alpha - scalar constant
9797
* @param A - input matrix

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

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,10 @@ function ssymv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs
6969
var sa1;
7070
var i1;
7171
var i0;
72-
var oa;
72+
var ia;
7373

7474
// Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop...
7575

76-
isrm = isRowMajor( [ strideA1, strideA2 ] );
77-
if ( isrm ) {
78-
// For row-major matrices, the last dimension has the fastest changing index...
79-
sa0 = strideA2; // stride for innermost loop
80-
sa1 = strideA1; // stride for outermost loop
81-
} else { // isColMajor
82-
// For column-major matrices, the first dimension has the fastest changing index...
83-
sa0 = strideA1; // stride for innermost loop
84-
sa1 = strideA2; // stride for outermost loop
85-
}
8676
// y = beta*y
8777
if ( beta !== 1.0 ) {
8878
if ( beta === 0.0 ) {
@@ -94,6 +84,16 @@ function ssymv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs
9484
if ( alpha === 0.0 ) {
9585
return y;
9686
}
87+
isrm = isRowMajor( [ strideA1, strideA2 ] );
88+
if ( isrm ) {
89+
// For row-major matrices, the last dimension has the fastest changing index...
90+
sa0 = strideA2; // stride for innermost loop
91+
sa1 = strideA1; // stride for outermost loop
92+
} else { // isColMajor
93+
// For column-major matrices, the first dimension has the fastest changing index...
94+
sa0 = strideA1; // stride for innermost loop
95+
sa1 = strideA2; // stride for outermost loop
96+
}
9797
// Form: y = α*A*x + y
9898
if (
9999
( !isrm && uplo === 'upper' ) ||
@@ -103,17 +103,18 @@ function ssymv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs
103103
iy1 = offsetY;
104104
for ( i1 = 0; i1 < N; i1++ ) {
105105
tmp1 = f32( alpha * x[ ix1 ] );
106-
tmp2 = 0.0;
106+
tmp2 = f32( 0.0 );
107107
ix0 = offsetX;
108108
iy0 = offsetY;
109-
oa = offsetA + ( sa1 * i1 );
109+
ia = offsetA + ( sa1*i1 );
110110
for ( i0 = 0; i0 < i1; i0++ ) {
111-
y[ iy0 ] += f32( tmp1 * A[ oa + ( sa0 *i0 ) ] );
112-
tmp2 = f32( tmp2 + f32( A[ oa + ( sa0 * i0 ) ] * x[ ix0 ] ) );
111+
y[ iy0 ] += f32( tmp1 * A[ ia ] );
112+
tmp2 = f32( tmp2 + f32( A[ ia ] * x[ ix0 ] ) );
113113
ix0 += strideX;
114114
iy0 += strideY;
115+
ia += sa0;
115116
}
116-
y[ iy1 ] += f32( f32( tmp1 * A[ oa+( sa0 * i1 ) ] ) + f32( alpha * tmp2 ) ); // eslint-disable-line max-len
117+
y[ iy1 ] += f32( f32( tmp1*A[ ia ] ) + f32( alpha*tmp2 ) );
117118
ix1 += strideX;
118119
iy1 += strideY;
119120
}
@@ -124,18 +125,19 @@ function ssymv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offs
124125
iy1 = offsetY;
125126
for ( i1 = 0; i1 < N; i1++ ) {
126127
tmp1 = f32( alpha * x[ ix1 ] );
127-
tmp2 = 0.0;
128-
oa = offsetA + ( sa1 * i1 );
129-
y[ iy1 ] += f32( tmp1 * A[ oa + ( sa0 * i1 ) ] );
128+
tmp2 = f32( 0.0 );
129+
ia = offsetA + ( sa1*i1 ) + ( sa0*i1 );
130+
y[ iy1 ] += f32( tmp1 * A[ ia ] );
130131
ix0 = ix1;
131132
iy0 = iy1;
132133
for ( i0 = i1+1; i0 < N; i0++ ) {
133134
ix0 += strideX;
134135
iy0 += strideY;
135-
y[ iy0 ] += f32( tmp1 * A[ oa + ( sa0 * i0 ) ] );
136-
tmp2 = f32( tmp2 + f32( A[ oa + ( sa0 * i0 ) ] * x[ ix0 ] ) );
136+
ia += sa0;
137+
y[ iy0 ] += f32( tmp1 * A[ ia ] );
138+
tmp2 = f32( tmp2 + f32( A[ ia ] * x[ ix0 ] ) );
137139
}
138-
y[ iy1 ] += f32( alpha * tmp2 );
140+
y[ iy1 ] += f32( alpha*tmp2 );
139141
ix1 += strideX;
140142
iy1 += strideY;
141143
}

lib/node_modules/@stdlib/blas/base/ssymv/test/test.ndarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ tape( 'the function supports specifying `x` and `y` strides (row-major)', functi
724724
var x;
725725
var y;
726726

727-
data = rsa1sa2;
727+
data = rxpyp;
728728

729729
a = new Float32Array( data.A );
730730
x = new Float32Array( data.x );

0 commit comments

Comments
 (0)