Skip to content

Commit 0dc2899

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: na - 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: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 83509e3 commit 0dc2899

File tree

5 files changed

+100
-83
lines changed

5 files changed

+100
-83
lines changed

lib/node_modules/@stdlib/blas/base/gsyr/benchmark/benchmark.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var gsyr = require( './../lib' );
3232
// VARIABLES //
3333

3434
var options = {
35-
'dtype': 'float64'
35+
'dtype': 'generic'
3636
};
3737

3838

@@ -50,6 +50,12 @@ function createBenchmark( N ) {
5050
var A = uniform( N*N, -10.0, 10.0, options );
5151
return benchmark;
5252

53+
/**
54+
* Benchmark function.
55+
*
56+
* @private
57+
* @param {Benchmark} b - benchmark instance
58+
*/
5359
function benchmark( b ) {
5460
var z;
5561
var i;

lib/node_modules/@stdlib/blas/base/gsyr/benchmark/benchmark.ndarray.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var gsyr = require( './../lib' ).ndarray;
3232
// VARIABLES //
3333

3434
var options = {
35-
'dtype': 'float64'
35+
'dtype': 'generic'
3636
};
3737

3838

@@ -50,6 +50,12 @@ function createBenchmark( N ) {
5050
var A = uniform( N*N, -10.0, 10.0, options );
5151
return benchmark;
5252

53+
/**
54+
* Benchmark function.
55+
*
56+
* @private
57+
* @param {Benchmark} b - benchmark instance
58+
*/
5359
function benchmark( b ) {
5460
var z;
5561
var i;

lib/node_modules/@stdlib/blas/base/gsyr/lib/accessors.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' );
3737
* @param {Array<Function>} x.accessors - array element accessors
3838
* @param {integer} strideX - stride length for `x`
3939
* @param {NonNegativeInteger} offsetX - starting index for `x`
40-
* @param {Object} A - output matrix object
41-
* @param {Collection} A.data - output matrix data
40+
* @param {Object} A - input matrix object
41+
* @param {Collection} A.data - input matrix data
4242
* @param {Array<Function>} A.accessors - array element accessors
4343
* @param {integer} strideA1 - stride of the first dimension of `A`
4444
* @param {integer} strideA2 - stride of the second dimension of `A`
4545
* @param {NonNegativeInteger} offsetA - starting index for `A`
46-
* @returns {Object} output array object
46+
* @returns {Object} input matrix object
4747
*
4848
* @example
4949
* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
@@ -82,8 +82,6 @@ function gsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offse
8282
getA = A.accessors[ 0 ];
8383
setA = A.accessors[ 1 ];
8484

85-
// Note on variable naming convention: S#, da#, ia#, i# where # corresponds to the loop number, with `0` being the innermost loop...
86-
8785
isrm = isRowMajor( [ strideA1, strideA2 ] );
8886
if ( isrm ) {
8987
// For row-major matrices, the last dimension has the fastest changing index...
@@ -101,8 +99,9 @@ function gsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offse
10199
) {
102100
ix1 = ox;
103101
for ( i1 = 0; i1 < N; i1++ ) {
104-
if ( getX( xbuf, ix1 ) !== 0.0 ) {
105-
tmp = alpha * getX( xbuf, ix1 );
102+
v = getX( xbuf, ix1 );
103+
if ( v !== 0.0 ) {
104+
tmp = alpha * v;
106105
ia = offsetA + (sa1*i1);
107106
ix0 = ox;
108107
for ( i0 = 0; i0 <= i1; i0++ ) {
@@ -119,8 +118,9 @@ function gsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offse
119118
// ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' )
120119
ix1 = ox;
121120
for ( i1 = 0; i1 < N; i1++ ) {
122-
if ( getX( xbuf, ix1 ) !== 0.0 ) {
123-
tmp = alpha * getX( xbuf, ix1 );
121+
v = getX( xbuf, ix1 );
122+
if ( v !== 0.0 ) {
123+
tmp = alpha * v;
124124
ia = offsetA + (sa1*i1) + (sa0*i1);
125125
ix0 = ix1;
126126
for ( i0 = i1; i0 < N; i0++ ) {

lib/node_modules/@stdlib/blas/base/gsyr/test/test.main.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ var tape = require( 'tape' );
2626
var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
2727
var copy = require( '@stdlib/array/base/copy' );
2828
var gsyr = require( './../lib/main.js' );
29+
30+
31+
// FIXTURES //
32+
2933
var ru = require( './fixtures/row_major_u.json' );
3034
var rl = require( './fixtures/row_major_l.json' );
3135
var rxp = require( './fixtures/row_major_xp.json' );
3236
var rxn = require( './fixtures/row_major_xn.json' );
37+
3338
var cu = require( './fixtures/column_major_u.json' );
3439
var cl = require( './fixtures/column_major_l.json' );
3540
var cxp = require( './fixtures/column_major_xp.json' );
@@ -96,7 +101,7 @@ tape( 'the function throws an error if provided an invalid first argument (acces
96101

97102
function badValue( value ) {
98103
return function badValue() {
99-
gsyr( value, data.uplo, data.N, data.alpha, data.x, data.strideX, data.A, data.lda );
104+
gsyr( value, data.uplo, data.N, data.alpha, toAccessorArray( data.x ), data.strideX, toAccessorArray( data.A ), data.lda );
100105
};
101106
}
102107
});
@@ -148,7 +153,7 @@ tape( 'the function throws an error if provided an invalid second argument (acce
148153

149154
function badValue( value ) {
150155
return function badValue() {
151-
gsyr( data.order, value, data.N, data.alpha, data.x, data.strideX, data.A, data.lda );
156+
gsyr( data.order, value, data.N, data.alpha, toAccessorArray( data.x ), data.strideX, toAccessorArray( data.A ), data.lda );
152157
};
153158
}
154159
});
@@ -198,7 +203,7 @@ tape( 'the function throws an error if provided an invalid third argument (acces
198203

199204
function badValue( value ) {
200205
return function badValue() {
201-
gsyr( data.order, data.uplo, value, data.alpha, data.x, data.strideX, data.A, data.lda );
206+
gsyr( data.order, data.uplo, value, data.alpha, toAccessorArray( data.x ), data.strideX, toAccessorArray( data.A ), data.lda );
202207
};
203208
}
204209
});
@@ -244,7 +249,7 @@ tape( 'the function throws an error if provided an invalid sixth argument (acces
244249

245250
function badValue( value ) {
246251
return function badValue() {
247-
gsyr( data.order, data.uplo, data.N, data.alpha, data.x, value, data.A, data.lda );
252+
gsyr( data.order, data.uplo, data.N, data.alpha, toAccessorArray( data.x ), value, toAccessorArray( data.A ), data.lda );
248253
};
249254
}
250255
});
@@ -300,7 +305,7 @@ tape( 'the function throws an error if provided an invalid eighth argument (acce
300305

301306
function badValue( value ) {
302307
return function badValue() {
303-
gsyr( data.order, data.uplo, data.N, data.alpha, data.x, data.strideX, data.A, value );
308+
gsyr( data.order, data.uplo, data.N, data.alpha, toAccessorArray( data.x ), data.strideX, toAccessorArray( data.A ), value );
304309
};
305310
}
306311
});

0 commit comments

Comments
 (0)