Skip to content

Commit a5e744b

Browse files
committed
chore: cleanup
--- 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: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - 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: 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 1097098 commit a5e744b

3 files changed

Lines changed: 17 additions & 12 deletions

File tree

lib/node_modules/@stdlib/stats/strided/dnancount/README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ var v = dnancount.ndarray( 4, x, 2, 1 );
117117
## Notes
118118

119119
- If `N <= 0`, both functions return `0`.
120-
- If `strideX == 0`, the same indexed element is evaluated `N` times.
121-
- The C APIs return `CBLAS_INT`.
122120

123121
</section>
124122

@@ -179,7 +177,10 @@ console.log( v );
179177
Computes the number of non-`NaN` elements in a double-precision floating-point strided array.
180178

181179
```c
182-
CBLAS_INT stdlib_strided_dnancount( const CBLAS_INT N, const double *X, const CBLAS_INT strideX );
180+
const double x[] = { 1.0, 2.0, NaN, 4.0, 5.0, 6.0, NaN, 8.0 };
181+
182+
CBLAS_INT v = stdlib_strided_dnancount( 4, x, 2 );
183+
// returns 2
183184
```
184185
185186
The function accepts the following arguments:
@@ -189,10 +190,7 @@ The function accepts the following arguments:
189190
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
190191
191192
```c
192-
const double x[] = { 1.0, 2.0, NaN, 4.0, 5.0, 6.0, NaN, 8.0 };
193-
194-
CBLAS_INT v = stdlib_strided_dnancount( 4, x, 2 );
195-
// returns 2
193+
CBLAS_INT stdlib_strided_dnancount( const CBLAS_INT N, const double *X, const CBLAS_INT strideX );
196194
```
197195

198196
#### stdlib_strided_dnancount_ndarray( N, \*X, strideX, offsetX )
@@ -238,13 +236,20 @@ CBLAS_INT v = stdlib_strided_dnancount_ndarray( 4, x, 2, 1 );
238236
#include <stdio.h>
239237

240238
int main( void ) {
239+
// Create a strided array:
241240
const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0/0.0, 0.0/0.0 };
241+
242+
// Specify the number of elements:
242243
const int N = 5;
244+
245+
// Specify the stride length:
243246
const int strideX = 2;
244247

245-
CBLAS_INT v = stdlib_strided_dnancount( N, x, strideX );
248+
// Compute the number of non-NaN elements:
249+
int v = stdlib_strided_dnancount( N, x, strideX );
246250

247-
printf( "count: %d\n", (int)v );
251+
// Print the result:
252+
printf( "count: %d\n", v );
248253
}
249254
```
250255

lib/node_modules/@stdlib/stats/strided/dnancount/examples/c/example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ int main( void ) {
3131
const int strideX = 2;
3232

3333
// Compute the number of non-NaN elements:
34-
CBLAS_INT v = stdlib_strided_dnancount( N, x, strideX );
34+
int v = stdlib_strided_dnancount( N, x, strideX );
3535

3636
// Print the result:
37-
printf( "count: %d\n", (int)v );
37+
printf( "count: %d\n", v );
3838
}

lib/node_modules/@stdlib/stats/strided/dnancount/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ CBLAS_INT API_SUFFIX(stdlib_strided_dnancount)( const CBLAS_INT N, const double
4646
CBLAS_INT API_SUFFIX(stdlib_strided_dnancount_ndarray)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) {
4747
CBLAS_INT count;
4848
CBLAS_INT ix;
49-
double v;
5049
CBLAS_INT i;
50+
double v;
5151

5252
if ( N <= 0 ) {
5353
return 0;

0 commit comments

Comments
 (0)