Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/node_modules/@stdlib/blas/ext/base/dnancount/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,15 @@ console.log( v );

```c
#include "stdlib/blas/ext/base/dnancount.h"
#include "stdlib/constants/float64/nan.h"
```

#### stdlib_strided_dnancount( N, \*X, strideX )

Computes the number of non-`NaN` elements in a double-precision floating-point strided array.

```c
const double x[] = { 1.0, 2.0, 0.0/0.0, 4.0, 5.0, 6.0, 0.0/0.0, 8.0 };
const double x[] = { 1.0, 2.0, STDLIB_CONSTANT_FLOAT64_NAN, 4.0, 5.0, 6.0, STDLIB_CONSTANT_FLOAT64_NAN, 8.0 };

int v = stdlib_strided_dnancount( 4, x, 2 );
// returns 2
Expand All @@ -198,7 +199,7 @@ CBLAS_INT stdlib_strided_dnancount( const CBLAS_INT N, const double *X, const CB
Computes the number of non-`NaN` elements in a double-precision floating-point strided array using alternative indexing semantics.

```c
const double x[] = { 2.0, 1.0, 0.0/0.0, -2.0, 3.0, 4.0, 0.0/0.0, 0.0/0.0 };
const double x[] = { 2.0, 1.0, STDLIB_CONSTANT_FLOAT64_NAN, -2.0, 3.0, 4.0, STDLIB_CONSTANT_FLOAT64_NAN, STDLIB_CONSTANT_FLOAT64_NAN };

int v = stdlib_strided_dnancount_ndarray( 4, x, 2, 1 );
// returns 3
Expand Down Expand Up @@ -240,7 +241,7 @@ CBLAS_INT stdlib_strided_dnancount_ndarray( const CBLAS_INT N, const double *X,

int main( void ) {
// Create a strided array:
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 };
const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, STDLIB_CONSTANT_FLOAT64_NAN, STDLIB_CONSTANT_FLOAT64_NAN };

// Specify the number of elements:
const int N = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#include "stdlib/blas/ext/base/dnancount.h"
#include "stdlib/constants/float64/nan.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
Expand Down Expand Up @@ -104,7 +105,7 @@ static double benchmark1( int iterations, int len ) {
x = (double *) malloc( len * sizeof( double ) );
for ( i = 0; i < len; i++ ) {
if ( rand_double() < 0.2 ) {
x[ i ] = 0.0 / 0.0; // NaN
x[ i ] = STDLIB_CONSTANT_FLOAT64_NAN;
} else {
x[ i ] = ( rand_double() * 20000.0 ) - 10000.0;
}
Expand Down Expand Up @@ -144,7 +145,7 @@ static double benchmark2( int iterations, int len ) {
x = (double *) malloc( len * sizeof( double ) );
for ( i = 0; i < len; i++ ) {
if ( rand_double() < 0.2 ) {
x[ i ] = 0.0 / 0.0; // NaN
x[ i ] = STDLIB_CONSTANT_FLOAT64_NAN;
} else {
x[ i ] = ( rand_double() * 20000.0 ) - 10000.0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
*/

#include "stdlib/blas/ext/base/dnancount.h"
#include "stdlib/constants/float64/nan.h"
#include <stdint.h>
#include <stdio.h>

int main( void ) {
// Create a strided array:
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 };
const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, STDLIB_CONSTANT_FLOAT64_NAN, STDLIB_CONSTANT_FLOAT64_NAN };

// Specify the number of elements:
const int N = 5;
Expand Down
12 changes: 8 additions & 4 deletions lib/node_modules/@stdlib/blas/ext/base/dnancount/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"@stdlib/napi/argv",
"@stdlib/napi/argv-int64",
"@stdlib/napi/argv-strided-float64array",
"@stdlib/napi/create-int32"
"@stdlib/napi/create-int32",
"@stdlib/constants/float64/nan"
]
},
{
Expand All @@ -62,7 +63,8 @@
"dependencies": [
"@stdlib/blas/base/shared",
"@stdlib/strided/base/stride2offset",
"@stdlib/math/base/assert/is-nan"
"@stdlib/math/base/assert/is-nan",
"@stdlib/constants/float64/nan"
]
},
{
Expand All @@ -79,7 +81,8 @@
"dependencies": [
"@stdlib/blas/base/shared",
"@stdlib/strided/base/stride2offset",
"@stdlib/math/base/assert/is-nan"
"@stdlib/math/base/assert/is-nan",
"@stdlib/constants/float64/nan"
]
},
{
Expand All @@ -96,7 +99,8 @@
"dependencies": [
"@stdlib/blas/base/shared",
"@stdlib/strided/base/stride2offset",
"@stdlib/math/base/assert/is-nan"
"@stdlib/math/base/assert/is-nan",
"@stdlib/constants/float64/nan"
]
}
]
Expand Down