Skip to content

Commit d8e84d4

Browse files
committed
refactor: use booleanarray
--- 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: na - task: lint_package_json status: na - task: lint_repl_help status: passed - 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: missing_dependencies - task: lint_c_examples status: na - 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 c0cae82 commit d8e84d4

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

lib/node_modules/@stdlib/blas/ext/base/swhere/docs/repl.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@
6363
> {{alias}}( 3, c, 2, x, 2, y, 2, out, 1 )
6464
<Float32Array>[ 1.0, 9.0, 5.0 ]
6565

66+
// Using view offsets:
67+
> var c0 = new {{alias:@stdlib/array/bool}}( [ false, true, false, true ] );
68+
> var x0 = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 3.0, 4.0 ] );
69+
> var y0 = new {{alias:@stdlib/array/float32}}( [ 5.0, 6.0, 7.0, 8.0 ] );
70+
> var o0 = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0, 0.0, 0.0 ] );
71+
> var c1 = new {{alias:@stdlib/array/bool}}( c0.buffer, c0.BYTES_PER_ELEMENT*1 );
72+
> var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
73+
> var y1 = new {{alias:@stdlib/array/float32}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 );
74+
> var o1 = new {{alias:@stdlib/array/float32}}( o0.buffer, o0.BYTES_PER_ELEMENT*1 );
75+
> {{alias}}( 2, c1, 1, x1, 1, y1, 1, o1, 1 )
76+
<Float32Array>[ 2.0, 7.0, 0.0 ]
77+
6678

6779
{{alias}}.ndarray( N, c, sc, oc, x, sx, ox, y, sy, oy, o, so, oo )
6880
Takes elements from one of two single-precision floating-point strided

lib/node_modules/@stdlib/blas/ext/base/swhere/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"@stdlib/napi/export",
4242
"@stdlib/napi/argv",
4343
"@stdlib/napi/argv-int64",
44-
"@stdlib/napi/argv-strided-float32array",
45-
"@stdlib/napi/argv-strided-uint8array"
44+
"@stdlib/napi/argv-strided-booleanarray",
45+
"@stdlib/napi/argv-strided-float32array"
4646
]
4747
},
4848
{

lib/node_modules/@stdlib/blas/ext/base/swhere/src/addon.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include "stdlib/napi/export.h"
2222
#include "stdlib/napi/argv.h"
2323
#include "stdlib/napi/argv_int64.h"
24+
#include "stdlib/napi/argv_strided_booleanarray.h"
2425
#include "stdlib/napi/argv_strided_float32array.h"
25-
#include "stdlib/napi/argv_strided_uint8array.h"
2626
#include <node_api.h>
2727
#include <stdbool.h>
2828

@@ -40,11 +40,11 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
4040
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 4 );
4141
STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 6 );
4242
STDLIB_NAPI_ARGV_INT64( env, strideOut, argv, 8 );
43-
STDLIB_NAPI_ARGV_STRIDED_UINT8ARRAY( env, Condition, N, strideC, argv, 1 );
43+
STDLIB_NAPI_ARGV_STRIDED_BOOLEANARRAY( env, Condition, N, strideC, argv, 1 );
4444
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 3 );
4545
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 5 );
4646
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Out, N, strideOut, argv, 7 );
47-
API_SUFFIX(stdlib_strided_swhere)( N, (const bool *)Condition, strideC, X, strideX, Y, strideY, Out, strideOut );
47+
API_SUFFIX(stdlib_strided_swhere)( N, Condition, strideC, X, strideX, Y, strideY, Out, strideOut );
4848
return NULL;
4949
}
5050

@@ -66,11 +66,11 @@ static napi_value addon_method( napi_env env, napi_callback_info info ) {
6666
STDLIB_NAPI_ARGV_INT64( env, offsetY, argv, 9 );
6767
STDLIB_NAPI_ARGV_INT64( env, strideOut, argv, 11 );
6868
STDLIB_NAPI_ARGV_INT64( env, offsetOut, argv, 12 );
69-
STDLIB_NAPI_ARGV_STRIDED_UINT8ARRAY( env, Condition, N, strideC, argv, 1 );
69+
STDLIB_NAPI_ARGV_STRIDED_BOOLEANARRAY( env, Condition, N, strideC, argv, 1 );
7070
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 4 );
7171
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 7 );
7272
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Out, N, strideOut, argv, 10 );
73-
API_SUFFIX(stdlib_strided_swhere_ndarray)( N, (const bool *)Condition, strideC, offsetC, X, strideX, offsetX, Y, strideY, offsetY, Out, strideOut, offsetOut );
73+
API_SUFFIX(stdlib_strided_swhere_ndarray)( N, Condition, strideC, offsetC, X, strideX, offsetX, Y, strideY, offsetY, Out, strideOut, offsetOut );
7474
return NULL;
7575
}
7676

0 commit comments

Comments
 (0)