diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/README.md b/lib/node_modules/@stdlib/stats/base/dnanrange/README.md index c28463d0197c..581aa8701b26 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/README.md +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/README.md @@ -57,14 +57,14 @@ The function has the following parameters: - **x**: input [`Float64Array`][@stdlib/array/float64]. - **strideX**: index increment for `x`. -The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, +The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [range][range] of every other element in `x`, ```javascript var Float64Array = require( '@stdlib/array/float64' ); var x = new Float64Array( [ 1.0, 2.0, -7.0, -2.0, 4.0, 3.0, NaN, NaN ] ); -var v = dnanrange( 4, x, 2 ); +var v = dnanrange( 5, x, 2 ); // returns 11.0 ``` @@ -78,7 +78,7 @@ var Float64Array = require( '@stdlib/array/float64' ); var x0 = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var v = dnanrange( 4, x1, 2 ); +var v = dnanrange( 5, x1, 2 ); // returns 6.0 ``` @@ -91,13 +91,13 @@ var Float64Array = require( '@stdlib/array/float64' ); var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -var v = dnanrange.ndarray( x.length, x, 1, 0 ); +var v = dnanrange.ndarray( 5, x, 1, 0 ); // returns 4.0 ``` The function has the following additional parameters: -- **offsetX**: starting index for `x`. +- **offset**: starting index for `x`. While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the [range][range] for every other element in `x` starting from the second element @@ -106,7 +106,7 @@ var Float64Array = require( '@stdlib/array/float64' ); var x = new Float64Array( [ 2.0, 1.0, -2.0, -2.0, 3.0, 4.0, NaN, NaN ] ); -var v = dnanrange.ndarray( 4, x, 2, 1 ); +var v = dnanrange.ndarray( 5, x, 2, 1 ); // returns 6.0 ``` @@ -157,22 +157,6 @@ console.log( v ); - - -* * * - -
- -## C APIs - - - -
- -
- - -
@@ -185,13 +169,13 @@ console.log( v ); #### stdlib_strided_dnanrange( N, \*X, strideX ) -Computes the [range][range] of a double-precision floating-point strided array `x`, ignoring `NaN` values. +Calculate the range value of a double-precision floating-point strided array `x`, ignoring `NaN` values. ```c -const double x[] = { 1.0, 0.0/0.0, 3.0, -4.0 }; +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 }; -double v = stdlib_strided_dnanrange( 4, x, 1 ); -// returns 7.0 +double v = stdlib_strided_dnanrange( 5, x, 2 ); +// returns 6.0 ``` The function accepts the following arguments: @@ -206,13 +190,13 @@ double stdlib_strided_dnanrange( const CBLAS_INT N, const double *X, const CBLAS #### stdlib_strided_dnanrange_ndarray( N, \*X, strideX, offsetX ) -Computes the [range][range] of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. +Computes the range value of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. ```c -const double x[] = { 1.0, 0.0/0.0, 3.0, -4.0 }; +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 }; -double v = stdlib_strided_dnanrange_ndarray( 4, x, 1, 0 ); -// returns 7.0 +double v = stdlib_strided_dnanrange_ndarray( 5, x, 2, 0 ); +// returns 6.0 ``` The function accepts the following arguments: diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.js index 6f1b4a45a85c..44aca7e4a918 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.js @@ -35,8 +35,7 @@ var dnanrange = require( './../lib/dnanrange.js' ); /** * Returns a random value or `NaN`. * -* @private -* @returns {number} random number or `NaN` +* @returns {number} Random number or `NaN` */ function rand() { if ( bernoulli( 0.2 ) ) { diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.native.js index 1d86c0f9b0ad..7e1ef21a89e1 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.native.js @@ -44,8 +44,7 @@ var opts = { /** * Returns a random value or `NaN`. * -* @private -* @returns {number} random number or `NaN` +* @returns {number} Random number or `NaN` */ function rand() { if ( bernoulli( 0.2 ) ) { diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.ndarray.js index ee94dc8e6b8b..2385e96d5644 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.ndarray.js @@ -35,8 +35,7 @@ var dnanrange = require( './../lib/ndarray.js' ); /** * Returns a random value or `NaN`. * -* @private -* @returns {number} random number or `NaN` +* @returns {number} Random number or `NaN` */ function rand() { if ( bernoulli( 0.2 ) ) { diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.ndarray.native.js index 3190d31e6bdb..00722e7b7b09 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/benchmark/benchmark.ndarray.native.js @@ -44,8 +44,7 @@ var opts = { /** * Returns a random value or `NaN`. * -* @private -* @returns {number} random number or `NaN` +* @returns {number} Random number or `NaN` */ function rand() { if ( bernoulli( 0.2 ) ) { diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dnanrange/docs/repl.txt index 3816f150889b..56caf403e538 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/docs/repl.txt +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/docs/repl.txt @@ -3,8 +3,8 @@ Computes the range of a double-precision floating-point strided array, ignoring `NaN` values. - The `N` and stride parameters determine which elements in `x` are accessed - at runtime. + The `N` and stride parameters determine which elements in the strided array + are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use a typed array view. @@ -20,7 +20,7 @@ Input array. strideX: integer - Stride Length. + Stride length. Returns ------- @@ -51,7 +51,7 @@ ignoring `NaN` values and using alternative indexing semantics. While typed array views mandate a view offset based on the underlying - buffer, the `offset` parameter supports indexing semantics based on a + buffer, the offset parameter supports indexing semantics based on a starting index. Parameters @@ -63,7 +63,7 @@ Input array. strideX: integer - Stride Length. + Stride length. offsetX: integer Starting index. diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/include/stdlib/stats/base/dnanrange.h b/lib/node_modules/@stdlib/stats/base/dnanrange/include/stdlib/stats/base/dnanrange.h index f227f9b6d7e9..e99f875fdd45 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/include/stdlib/stats/base/dnanrange.h +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/include/stdlib/stats/base/dnanrange.h @@ -34,7 +34,7 @@ extern "C" { double API_SUFFIX(stdlib_strided_dnanrange)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX ); /** -* Computes the range of a double-precision floating-point strided array, ignoring `NaN` values. +* Computes the range of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. */ double API_SUFFIX(stdlib_strided_dnanrange_ndarray)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/lib/ndarray.native.js b/lib/node_modules/@stdlib/stats/base/dnanrange/lib/ndarray.native.js index ba10be914176..20384cfe4dba 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/lib/ndarray.native.js @@ -40,7 +40,7 @@ var addon = require( './../src/addon.node' ); * var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] ); * * var v = dnanrange( 5, x, 2, 1 ); -* // returns 6.0 +* // returns 5.0 */ function dnanrange( N, x, strideX, offsetX ) { return addon.ndarray( N, x, strideX, offsetX ); diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/manifest.json b/lib/node_modules/@stdlib/stats/base/dnanrange/manifest.json index 7617f9ef5da7..f295db422c5c 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/manifest.json +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/manifest.json @@ -28,14 +28,16 @@ "confs": [ { "task": "build", - "wasm": false, + "wasm":false, "src": [ "./src/main.c" ], "include": [ "./include" ], - "libraries": [], + "libraries": [ + "-lm" + ], "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/src/addon.c b/lib/node_modules/@stdlib/stats/base/dnanrange/src/addon.c index 35c004a3e5b7..4861eac230a4 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/src/addon.c +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/src/addon.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/src/main.c b/lib/node_modules/@stdlib/stats/base/dnanrange/src/main.c index 81d2efc7bfe2..d8f6da741602 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/src/main.c +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/src/main.c @@ -35,7 +35,7 @@ double API_SUFFIX(stdlib_strided_dnanrange)( const CBLAS_INT N, const double *X, } /** -* Computes the range of a double-precision floating-point strided array, ignoring `NaN` values. +* Computes the range of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics. * * @param N number of indexed elements * @param X input array @@ -44,18 +44,18 @@ double API_SUFFIX(stdlib_strided_dnanrange)( const CBLAS_INT N, const double *X, * @return output value */ double API_SUFFIX(stdlib_strided_dnanrange_ndarray)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) { - CBLAS_INT ix; - CBLAS_INT i; double max; double min; + CBLAS_INT ix; + CBLAS_INT i; double v; if ( N <= 0 ) { return 0.0 / 0.0; // NaN } if ( N == 1 || strideX == 0 ) { - if ( stdlib_base_is_nan( X[ 0 ] ) ) { - return X[ offsetX ]; + if ( stdlib_base_is_nan( X[ offsetX ] ) ) { + return X[ 0 ]; } return 0.0; } diff --git a/lib/node_modules/@stdlib/stats/base/dnanrange/test/test.ndarray.native.js b/lib/node_modules/@stdlib/stats/base/dnanrange/test/test.ndarray.native.js index 019fe7070160..f80d1b638d74 100644 --- a/lib/node_modules/@stdlib/stats/base/dnanrange/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/stats/base/dnanrange/test/test.ndarray.native.js @@ -189,7 +189,7 @@ tape( 'the function supports an `offset` parameter', opts, function test( t ) { ]); v = dnanrange( 5, x, 2, 1 ); - t.strictEqual( v, 6.0, 'returns expected value' ); + t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); });