Skip to content

Commit 24b7fa2

Browse files
committed
chore: addressing review comments
--- 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: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - 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 2f3835b commit 24b7fa2

13 files changed

Lines changed: 103 additions & 100 deletions

File tree

lib/node_modules/@stdlib/blas/ext/base/znancount/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ int main( void ) {
316316

317317
<!-- <related-links> -->
318318

319-
320319
<!-- </related-links> -->
321320

322321
</section>

lib/node_modules/@stdlib/blas/ext/base/znancount/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function rand() {
5555
* @returns {Function} benchmark function
5656
*/
5757
function createBenchmark( len ) {
58-
var xbuf = filledarrayBy( len, 'float64', rand );
58+
var xbuf = filledarrayBy( len*2, 'float64', rand );
5959
var x = new Complex128Array( xbuf );
6060

6161
return benchmark;

lib/node_modules/@stdlib/blas/ext/base/znancount/benchmark/benchmark.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function rand() {
6464
* @returns {Function} benchmark function
6565
*/
6666
function createBenchmark( len ) {
67-
var xbuf = filledarrayBy( len, 'float64', rand );
67+
var xbuf = filledarrayBy( len*2, 'float64', rand );
6868
var x = new Complex128Array( xbuf );
6969

7070
return benchmark;

lib/node_modules/@stdlib/blas/ext/base/znancount/benchmark/benchmark.ndarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function rand() {
5555
* @returns {Function} benchmark function
5656
*/
5757
function createBenchmark( len ) {
58-
var xbuf = filledarrayBy( len, 'float64', rand );
58+
var xbuf = filledarrayBy( len*2, 'float64', rand );
5959
var x = new Complex128Array( xbuf );
6060

6161
return benchmark;

lib/node_modules/@stdlib/blas/ext/base/znancount/benchmark/benchmark.ndarray.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function rand() {
6464
* @returns {Function} benchmark function
6565
*/
6666
function createBenchmark( len ) {
67-
var xbuf = filledarrayBy( len, 'float64', rand );
67+
var xbuf = filledarrayBy( len*2, 'float64', rand );
6868
var x = new Complex128Array( xbuf );
6969

7070
return benchmark;

lib/node_modules/@stdlib/blas/ext/base/znancount/lib/ndarray.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,21 @@ function znancount( N, x, strideX, offsetX ) {
4747
var count;
4848
var view;
4949
var ix;
50+
var sx;
5051
var i;
5152

5253
if ( N <= 0 ) {
5354
return 0;
5455
}
5556
view = reinterpret( x, 0 );
5657
ix = offsetX * 2;
58+
sx = strideX * 2;
5759
count = 0;
5860
for ( i = 0; i < N; i++ ) {
59-
if ( !isnan( view[ ix ] ) && !isnan( view[ ix + 1 ] ) ) {
61+
if ( !isnan( view[ ix ] ) && !isnan( view[ ix+1 ] ) ) {
6062
count += 1;
6163
}
62-
ix += strideX * 2;
64+
ix += sx;
6365
}
6466
return count;
6567
}

lib/node_modules/@stdlib/blas/ext/base/znancount/lib/ndarray.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ var addon = require( './../src/addon.node' );
4040
*
4141
* var x = new Complex128Array( [ 1.0, 2.0, NaN, NaN, 3.0, 4.0 ] );
4242
*
43-
* var v = znancount( 2, x, 1, 0 );
44-
* // returns 1
43+
* var v = znancount( 3, x, 1, 0 );
44+
* // returns 2
4545
*/
4646
function znancount( N, x, strideX, offsetX ) {
4747
return addon.ndarray( N, reinterpret( x, 0 ), strideX, offsetX );

lib/node_modules/@stdlib/blas/ext/base/znancount/lib/znancount.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var addon = require( './../src/addon.node' );
3939
*
4040
* var x = new Complex128Array( [ 1.0, 2.0, NaN, NaN, 3.0, 4.0 ] );
4141
*
42-
* var v = znancount( x.length, x, 1 );
42+
* var v = znancount( 3, x, 1 );
4343
* // returns 2
4444
*/
4545
function znancount( N, x, strideX ) {

lib/node_modules/@stdlib/blas/ext/base/znancount/src/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,27 @@ CBLAS_INT API_SUFFIX(stdlib_strided_znancount)( const CBLAS_INT N, const stdlib_
4040
* @param N number of indexed elements
4141
* @param X input array
4242
* @param strideX stride length
43-
* @param offsetX starting index for X
43+
* @param offsetX starting index
4444
* @return number of non-`NaN` elements
4545
*/
4646
CBLAS_INT API_SUFFIX(stdlib_strided_znancount_ndarray)( const CBLAS_INT N, const stdlib_complex128_t *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) {
4747
const double *view = (const double *)X;
4848
CBLAS_INT count;
49+
CBLAS_INT sx;
4950
CBLAS_INT ix;
5051
CBLAS_INT i;
5152

5253
if ( N <= 0 ) {
5354
return 0;
5455
}
5556
ix = offsetX * 2;
57+
sx = strideX * 2;
5658
count = 0;
5759
for ( i = 0; i < N; i++ ) {
5860
if ( !stdlib_base_is_nan( view[ ix ] ) && !stdlib_base_is_nan( view[ ix+1 ] ) ) {
5961
count += 1;
6062
}
61-
ix += strideX * 2;
63+
ix += sx;
6264
}
6365
return count;
6466
}

lib/node_modules/@stdlib/blas/ext/base/znancount/test/test.ndarray.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,24 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
9090
var v;
9191

9292
x = new Complex128Array([
93-
1.0,
94-
2.0, // 0
93+
1.0, // 0
94+
2.0, // 0
9595
2.0,
9696
-7.0,
97-
-2.0,
98-
3.0, // 1
97+
-2.0, // 1
98+
3.0, // 1
9999
4.0,
100100
2.0,
101-
NaN,
102-
1.0, // 2
101+
NaN, // 2
102+
1.0, // 2
103103
1.0,
104104
1.0,
105-
3.0,
106-
4.0, // 3
105+
3.0, // 3
106+
4.0, // 3
107107
2.0,
108108
2.0,
109-
1.0,
110-
NaN // 4
109+
1.0, // 4
110+
NaN // 4
111111
]);
112112

113113
v = znancount( 5, x, 2, 0 );
@@ -120,24 +120,24 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
120120
var v;
121121

122122
x = new Complex128Array([
123-
1.0,
124-
NaN, // 4
123+
1.0, // 4
124+
NaN, // 4
125125
2.0,
126126
2.0,
127-
3.0,
128-
4.0, // 3
127+
3.0, // 3
128+
4.0, // 3
129129
1.0,
130130
1.0,
131-
NaN,
132-
1.0, // 2
131+
NaN, // 2
132+
1.0, // 2
133133
4.0,
134134
2.0,
135-
-2.0,
136-
3.0, // 1
135+
-2.0, // 1
136+
3.0, // 1
137137
2.0,
138138
-7.0,
139-
1.0,
140-
2.0 // 0
139+
1.0, // 0
140+
2.0 // 0
141141
]);
142142

143143
v = znancount( 5, x, -2, 8 );
@@ -171,23 +171,23 @@ tape( 'the function supports an `offset` parameter', function test( t ) {
171171
x = new Complex128Array([
172172
2.0,
173173
1.0,
174-
1.0,
174+
1.0, // 0
175175
2.0, // 0
176176
2.0,
177177
-2.0,
178-
-2.0,
179-
2.0, // 1
180-
2.0,
178+
-2.0, // 1
179+
2.0, // 1
181180
2.0,
182181
2.0,
183182
2.0, // 2
183+
2.0, // 2
184184
3.0,
185185
4.0,
186-
3.0,
186+
3.0, // 3
187187
4.0, // 3
188188
NaN,
189189
1.0,
190-
1.0,
190+
1.0, // 4
191191
NaN // 4
192192
]);
193193

0 commit comments

Comments
 (0)