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/dnanasum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,15 @@ console.log( v );

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

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

Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision floating-point strided array elements, ignoring `NaN` values.

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

double v = stdlib_strided_dnanasum( 4, x, 1 );
// returns 7.0
Expand All @@ -220,7 +221,7 @@ double stdlib_strided_dnanasum( const CBLAS_INT N, const double *X, const CBLAS_
Computes the sum of absolute values ([_L1_ norm][l1norm]) of double-precision floating-point strided array elements, ignoring `NaN` values and using alternative indexing semantics.

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

double v = stdlib_strided_dnanasum_ndarray( 4, x, 1, 0 );
// returns 7.0
Expand Down Expand Up @@ -261,7 +262,7 @@ double stdlib_strided_dnanasum_ndarray( const CBLAS_INT N, const double *X, cons

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/dnanasum.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 @@ -143,7 +144,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,11 +17,12 @@
*/

#include "stdlib/blas/ext/base/dnanasum.h"
#include "stdlib/constants/float64/nan.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/dnanasum/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"@stdlib/blas/ext/base/dnanasumors",
"@stdlib/blas/base/shared",
"@stdlib/strided/base/stride2offset",
"@stdlib/napi/create-double"
"@stdlib/napi/create-double",
"@stdlib/constants/float64/nan"
]
},
{
Expand All @@ -59,7 +60,8 @@
"dependencies": [
"@stdlib/blas/ext/base/dnanasumors",
"@stdlib/blas/base/shared",
"@stdlib/strided/base/stride2offset"
"@stdlib/strided/base/stride2offset",
"@stdlib/constants/float64/nan"
]
},
{
Expand All @@ -75,7 +77,8 @@
"dependencies": [
"@stdlib/blas/ext/base/dnanasumors",
"@stdlib/blas/base/shared",
"@stdlib/strided/base/stride2offset"
"@stdlib/strided/base/stride2offset",
"@stdlib/constants/float64/nan"
]
},
{
Expand All @@ -91,7 +94,8 @@
"dependencies": [
"@stdlib/blas/ext/base/dnanasumors",
"@stdlib/blas/base/shared",
"@stdlib/strided/base/stride2offset"
"@stdlib/strided/base/stride2offset",
"@stdlib/constants/float64/nan"
]
}
]
Expand Down