Skip to content
Merged
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
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ The function accepts the following arguments:
- **N**: `[in] CBLAS_INT` number of indexed elements.
- **X**: `[in] double*` input array.
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
- **n**: `[out] CBLAS_INT*` number of non-NaN elements.
- **n**: `[out] CBLAS_INT*` pointer for storing the number of non-NaN elements.

```c
double stdlib_strided_dnannsumkbn2( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, CBLAS_INT *n );
Expand All @@ -231,7 +231,7 @@ The function accepts the following arguments:
- **X**: `[in] double*` input array.
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
- **n**: `[out] CBLAS_INT*` number of non-NaN elements.
- **n**: `[out] CBLAS_INT*` pointer for storing the number of non-NaN elements.

```c
double stdlib_strided_dnannsumkbn2_ndarray( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, CBLAS_INT *n );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ function dnannsumkbn2( N, x, strideX, out, strideOut ) {
var io;

ix = stride2offset( N, strideX );
if ( strideOut < 0 ) {
io = -strideOut;
} else {
io = 0;
}
io = stride2offset( 2, strideOut );
return ndarray( N, x, strideX, ix, out, strideOut, io );
}

Expand Down
15 changes: 5 additions & 10 deletions lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/src/addon.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "stdlib/napi/argv.h"
#include "stdlib/napi/argv_int64.h"
#include "stdlib/napi/argv_strided_float64array.h"
#include "stdlib/strided/base/stride2offset.h"
#include <stdint.h>
#include <node_api.h>

/**
Expand All @@ -39,13 +41,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Out, 2, strideOut, argv, 3 );

int io;
if ( strideOut < 0 ) {
io = -strideOut;
} else {
io = 0;
}

int64_t io = stdlib_strided_stride2offset( 2, strideOut );
double *out = Out;
CBLAS_INT n;
out[ io ] = API_SUFFIX(stdlib_strided_dnannsumkbn2)( N, X, strideX, &n );
Expand All @@ -71,11 +67,10 @@ static napi_value addon_method( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Out, 2, strideOut, argv, 4 );

int io = offsetOut;
double *out = Out;
CBLAS_INT n;
out[ io ] = API_SUFFIX(stdlib_strided_dnannsumkbn2_ndarray)( N, X, strideX, offsetX, &n );
out[ io+strideOut ] = (double)n;
out[ offsetOut ] = API_SUFFIX(stdlib_strided_dnannsumkbn2_ndarray)( N, X, strideX, offsetX, &n );
out[ offsetOut+strideOut ] = (double)n;

return NULL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @param N number of indexed elements
* @param X input array
* @param strideX stride length
* @param n number of non-NaN elements
* @param n pointer for storing the number of non-NaN elements
* @return output value
*/
double API_SUFFIX(stdlib_strided_dnannsumkbn2)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, CBLAS_INT *n ) {
Expand All @@ -59,16 +59,16 @@ double API_SUFFIX(stdlib_strided_dnannsumkbn2)( const CBLAS_INT N, const double
* @param X input array
* @param strideX stride length
* @param offsetX starting index
* @param n number of non-NaN elements
* @param n pointer for storing the number of non-NaN elements
* @return output value
*/
double API_SUFFIX(stdlib_strided_dnannsumkbn2_ndarray)( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, CBLAS_INT *n ) {
CBLAS_INT ix;
CBLAS_INT i;
double sum;
double ccs;
double cs;
double cc;
CBLAS_INT ix;
CBLAS_INT i;
double v;
double t;
double c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
var out;
var x;
var v;

x = new Float64Array( [ 1.0, -2.0, -4.0, 5.0, 3.0 ] );
out = new Float64Array( 2 );
v = dnannsumkbn2( x.length, x, 0, out, 1 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
var out;
var x;
var v;

x = new Float64Array( [ 1.0, -2.0, -4.0, 5.0, 3.0 ] );
out = new Float64Array( 2 );
v = dnannsumkbn2( x.length, x, 0, out, 1 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
var out;
var x;
var v;

x = new Float64Array( [ 1.0, -2.0, -4.0, 5.0, 3.0 ] );
out = new Float64Array( 2 );
v = dnannsumkbn2( x.length, x, 0, 0, out, 1, 0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
var out;
var x;
var v;

x = new Float64Array( [ 1.0, -2.0, -4.0, 5.0, 3.0 ] );
out = new Float64Array( 2 );
v = dnannsumkbn2( x.length, x, 0, 0, out, 1, 0 );
Expand Down
Loading