From 904305131cddefca9be88df407377b171d170b81 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 04:14:09 +0530 Subject: [PATCH 01/33] refactor: update to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/README.md | 15 +- .../blas/ext/base/ssort2ins/docs/repl.txt | 19 +- .../ext/base/ssort2ins/examples/c/example.c | 6 +- .../blas/ext/base/ssort2ins/examples/index.js | 31 +--- .../blas/ext/base/ssort2ins/include.gypi | 2 +- .../ext/base/ssort2ins/lib/ndarray.native.js | 20 +-- .../blas/ext/base/ssort2ins/manifest.json | 86 ++++----- .../blas/ext/base/ssort2ins/src/addon.c | 48 +++++ .../blas/ext/base/ssort2ins/src/addon.cpp | 164 ------------------ 9 files changed, 123 insertions(+), 268 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c delete mode 100644 lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.cpp diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md index d6588a161ab7..6bd9409cd2aa 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/README.md @@ -58,17 +58,14 @@ The function has the following parameters: - **y**: second input [`Float32Array`][@stdlib/array/float32]. - **strideY**: `y` index increment. -The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to sort every other element +The `N` and `stride` parameters determine which elements in the strided arrays are accessed at runtime. For example, to sort every other element ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); - var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] ); var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); -var N = floor( x.length / 2 ); -ssort2ins( N, -1.0, x, 2, y, 2 ); +ssort2ins( 2, -1.0, x, 2, y, 2 ); console.log( x ); // => [ 3.0, -2.0, 1.0, -4.0 ] @@ -81,7 +78,6 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); // Initial arrays... var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0 ] ); @@ -90,10 +86,9 @@ var y0 = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] ); // Create offset views... var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length/2 ); // Sort every other element... -ssort2ins( N, -1.0, x1, 2, y1, 2 ); +ssort2ins( 2, -1.0, x1, 2, y1, 2 ); console.log( x0 ); // => [ 1.0, 4.0, 3.0, 2.0 ] @@ -104,7 +99,7 @@ console.log( y0 ); #### ssort2ins.ndarray( N, order, x, strideX, offsetX, y, strideY, offsetY ) -Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array `x` using insertion sort and alternative indexing semantics. +Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array the strided array using insertion sort and alternative indexing semantics. ```javascript var Float32Array = require( '@stdlib/array/float32' ); @@ -126,7 +121,7 @@ The function has the following additional parameters: - **offsetX**: `x` starting index. - **offsetY**: `y` starting index. -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 access only the last three elements of `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 access only the last three elements of `x`. ```javascript var Float32Array = require( '@stdlib/array/float32' ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt index 40144a8ed6c3..01fb77495bde 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt @@ -3,13 +3,14 @@ Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort. - The `N` and `stride` parameters determine which elements in `x` and `y` are - accessed at runtime. + The `N` and `stride` parameters determine which elements in the strided + arrays are are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use typed array views. - If `N <= 0` or `order == 0`, the function leaves `x` and `y` unchanged. + If `N <= 0` or `order == 0`, the function leaves the strided arrays + are unchanged. The algorithm distinguishes between `-0` and `+0`. When sorted in increasing order, `-0` is sorted before `+0`. When sorted in decreasing order, `-0` is @@ -69,11 +70,10 @@ > y [ 3.0, 1.0, 0.0, 2.0 ] - // Using `N` and `stride` parameters: + // Using `N` and stride parameters: > x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, -4.0 ] ); > y = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 2.0, 3.0 ] ); - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); - > {{alias}}( N, -1, x, 2, y, 2 ) + > {{alias}}( 2, -1, x, 2, y, 2 ) [ 3.0, -2.0, 1.0, -4.0 ] > y [ 2.0, 1.0, 0.0, 3.0 ] @@ -83,14 +83,14 @@ > var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); > var y0 = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 2.0, 3.0 ] ); > var y1 = new {{alias:@stdlib/array/float32}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); - > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 ); - > {{alias}}( N, 1, x1, 2, y1, 2 ) + > {{alias}}( 2, 1, x1, 2, y1, 2 ) [ -4.0, 3.0, -2.0 ] > x0 [ 1.0, -4.0, 3.0, -2.0 ] > y0 [ 0.0, 3.0, 2.0, 1.0 ] + {{alias}}.ndarray( N, order, x, strideX, offsetX, y, strideY, offsetY ) Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort and @@ -145,8 +145,7 @@ // Using an index offset: > x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, -4.0 ] ); > y = new {{alias:@stdlib/array/float32}}( [ 0.0, 1.0, 2.0, 3.0 ] ); - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); - > {{alias}}.ndarray( N, 1, x, 2, 1, y, 2, 1 ) + > {{alias}}.ndarray( 2, 1, x, 2, 1, y, 2, 1 ) [ 1.0, -4.0, 3.0, -2.0 ] > y [ 0.0, 3.0, 2.0, 1.0 ] diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c index a483e432a83e..d11f0a6b216b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c @@ -26,11 +26,11 @@ int main( void ) { float y[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 }; // Specify the number of elements: - int N = 8; + const int N = 8; // Specify strides: - int strideX = 1; - int strideY = 1; + const int strideX = 1; + const int strideY = 1; // Sort the arrays: c_ssort2ins( N, 1.0f, x, strideX, y, strideY ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/index.js index a62a36983460..668d48895f2e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/index.js @@ -18,35 +18,14 @@ 'use strict'; -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float32Array = require( '@stdlib/array/float32' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var ssort2ins = require( './../lib' ); -var rand; -var sign; -var x; -var y; -var i; - -x = new Float32Array( 10 ); -y = new Float32Array( 10 ); // index array -for ( i = 0; i < x.length; i++ ) { - if ( randu() < 0.2 ) { - x[ i ] = NaN; - } else { - rand = round( randu()*100.0 ); - sign = randu(); - if ( sign < 0.5 ) { - sign = -1.0; - } else { - sign = 1.0; - } - x[ i ] = sign * rand; - } - y[ i ] = i; -} +var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); + +var y = filledarrayBy( x.length, 'float32', discreteUniform( 0, 10 ) ); console.log( y ); ssort2ins( x.length, -1.0, x, -1, y, -1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/include.gypi index 868c5c12e852..26476a8c2655 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/include.gypi +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/include.gypi @@ -36,7 +36,7 @@ # Source files: 'src_files': [ - '<(src_dir)/addon.cpp', + '<(src_dir)/addon.c', ' + +/** +* Receives JavaScript callback invocation data. +* +* @private +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 6 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_FLOAT( env, alpha, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); + STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 4 ); + c_ssort2ins( N, alpha, X, strideX, Y, strideY ); + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.cpp b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.cpp deleted file mode 100644 index b40a9bd0ee19..000000000000 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "stdlib/blas/ext/base/ssort2ins.h" -#include -#include -#include -#include -#include - -/** -* Add-on namespace. -*/ -namespace stdlib_blas_ext_base_ssort2ins { - - /** - * Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort. - * - * ## Notes - * - * - When called from JavaScript, the function expects six arguments: - * - * - `N`: number of indexed elements - * - `order`: sort order - * - `X`: first input array - * - `strideX`: `X` stride length - * - `Y`: second input array - * - `strideY`: `Y` stride length - */ - napi_value node_ssort2ins( napi_env env, napi_callback_info info ) { - napi_status status; - - size_t argc = 6; - napi_value argv[ 6 ]; - status = napi_get_cb_info( env, info, &argc, argv, nullptr, nullptr ); - assert( status == napi_ok ); - - if ( argc < 6 ) { - napi_throw_error( env, nullptr, "invalid invocation. Must provide 6 arguments." ); - return nullptr; - } - - napi_valuetype vtype0; - status = napi_typeof( env, argv[ 0 ], &vtype0 ); - assert( status == napi_ok ); - if ( vtype0 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. First argument must be a number." ); - return nullptr; - } - - napi_valuetype vtype1; - status = napi_typeof( env, argv[ 1 ], &vtype1 ); - assert( status == napi_ok ); - if ( vtype1 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a number." ); - return nullptr; - } - - bool res2; - status = napi_is_typedarray( env, argv[ 2 ], &res2 ); - assert( status == napi_ok ); - if ( res2 == false ) { - napi_throw_type_error( env, nullptr, "invalid argument. Third argument must be a Float32Array." ); - return nullptr; - } - - napi_valuetype vtype3; - status = napi_typeof( env, argv[ 3 ], &vtype3 ); - assert( status == napi_ok ); - if ( vtype3 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. Fourth argument must be a number." ); - return nullptr; - } - - bool res4; - status = napi_is_typedarray( env, argv[ 4 ], &res4 ); - assert( status == napi_ok ); - if ( res4 == false ) { - napi_throw_type_error( env, nullptr, "invalid argument. Fifth argument must be a Float32Array." ); - return nullptr; - } - - napi_valuetype vtype5; - status = napi_typeof( env, argv[ 5 ], &vtype5 ); - assert( status == napi_ok ); - if ( vtype5 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. Sixth argument must be a number." ); - return nullptr; - } - - int64_t N; - status = napi_get_value_int64( env, argv[ 0 ], &N ); - assert( status == napi_ok ); - - double order; - status = napi_get_value_double( env, argv[ 1 ], &order ); - assert( status == napi_ok ); - - int64_t strideX; - status = napi_get_value_int64( env, argv[ 3 ], &strideX ); - assert( status == napi_ok ); - - int64_t strideY; - status = napi_get_value_int64( env, argv[ 5 ], &strideY ); - assert( status == napi_ok ); - - napi_typedarray_type vtype2; - size_t xlen; - void *X; - status = napi_get_typedarray_info( env, argv[ 2 ], &vtype2, &xlen, &X, nullptr, nullptr ); - assert( status == napi_ok ); - if ( vtype2 != napi_float32_array ) { - napi_throw_type_error( env, nullptr, "invalid argument. Third argument must be a Float32Array." ); - return nullptr; - } - if ( (N-1)*llabs(strideX) >= (int64_t)xlen ) { - napi_throw_range_error( env, nullptr, "invalid argument. Third argument has insufficient elements based on the associated stride and the number of indexed elements." ); - return nullptr; - } - - napi_typedarray_type vtype4; - size_t ylen; - void *Y; - status = napi_get_typedarray_info( env, argv[ 4 ], &vtype4, &ylen, &Y, nullptr, nullptr ); - assert( status == napi_ok ); - if ( vtype4 != napi_float32_array ) { - napi_throw_type_error( env, nullptr, "invalid argument. Fifth argument must be a Float32Array." ); - return nullptr; - } - if ( (N-1)*llabs(strideY) >= (int64_t)ylen ) { - napi_throw_range_error( env, nullptr, "invalid argument. Fifth argument has insufficient elements based on the associated stride and the number of indexed elements." ); - return nullptr; - } - - c_ssort2ins( N, (float)order, (float *)X, strideX, (float *)Y, strideY ); - - return nullptr; - } - - napi_value Init( napi_env env, napi_value exports ) { - napi_status status; - napi_value fcn; - status = napi_create_function( env, "exports", NAPI_AUTO_LENGTH, node_ssort2ins, NULL, &fcn ); - assert( status == napi_ok ); - return fcn; - } - - NAPI_MODULE( NODE_GYP_MODULE_NAME, Init ) -} // end namespace stdlib_blas_ext_base_ssort2ins From 92d90134e2426becf5bfc6be1fa2c5f821038f5a Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 04:24:38 +0530 Subject: [PATCH 02/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/examples/c/example.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c index d11f0a6b216b..a483e432a83e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c @@ -26,11 +26,11 @@ int main( void ) { float y[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 }; // Specify the number of elements: - const int N = 8; + int N = 8; // Specify strides: - const int strideX = 1; - const int strideY = 1; + int strideX = 1; + int strideY = 1; // Sort the arrays: c_ssort2ins( N, 1.0f, x, strideX, y, strideY ); From abc33167b78eca4c71a6778b4a174c170353975f Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 04:26:54 +0530 Subject: [PATCH 03/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/examples/c/example.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c index a483e432a83e..d11f0a6b216b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c @@ -26,11 +26,11 @@ int main( void ) { float y[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 }; // Specify the number of elements: - int N = 8; + const int N = 8; // Specify strides: - int strideX = 1; - int strideY = 1; + const int strideX = 1; + const int strideY = 1; // Sort the arrays: c_ssort2ins( N, 1.0f, x, strideX, y, strideY ); From 4a3d8c9826a4102b293661896453779b0ab4b2ef Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 04:33:04 +0530 Subject: [PATCH 04/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/examples/c/example.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c index d11f0a6b216b..1ccacdc4d8bc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c @@ -26,11 +26,11 @@ int main( void ) { float y[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 }; // Specify the number of elements: - const int N = 8; + int N = 8; // Specify strides: - const int strideX = 1; - const int strideY = 1; + int strideX = 1; + int strideY = 1; // Sort the arrays: c_ssort2ins( N, 1.0f, x, strideX, y, strideY ); @@ -40,4 +40,4 @@ int main( void ) { printf( "x[ %i ] = %f\n", i, x[ i ] ); printf( "y[ %i ] = %"PRId64"\n", i, (int64_t)y[ i ] ); } -} +} \ No newline at end of file From f74eeddfe518417f051e62014d221f7671deffb3 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 04:36:54 +0530 Subject: [PATCH 05/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/examples/c/example.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c index 1ccacdc4d8bc..7b819d28d60b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c @@ -19,6 +19,7 @@ #include "stdlib/blas/ext/base/ssort2ins.h" #include #include +#include int main( void ) { // Create strided arrays: From 0db2bf0177c7f7b31875d37ab4aa132d21091454 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 04:41:17 +0530 Subject: [PATCH 06/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/examples/c/example.c | 1 - lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c index 7b819d28d60b..1ccacdc4d8bc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c @@ -19,7 +19,6 @@ #include "stdlib/blas/ext/base/ssort2ins.h" #include #include -#include int main( void ) { // Create strided arrays: diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c index 7b40c16e9a26..cee6943e0aeb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c @@ -23,7 +23,6 @@ #include "stdlib/napi/argv_float.h" #include "stdlib/napi/argv_int64.h" #include "stdlib/napi/argv_strided_float32array.h" -#include /** * Receives JavaScript callback invocation data. From 3b66462fa14f9f6514860aeabc164b59e5f888ed Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 04:44:01 +0530 Subject: [PATCH 07/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- lib/node_modules/@stdlib/blas/ext/base/ssort2ins/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/package.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/package.json index a99ebdeb2584..4ee83acee7d7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/package.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/package.json @@ -72,5 +72,7 @@ "single", "float32array" ], - "__stdlib__": {} + "__stdlib__": { + "wasm": false + } } From da6595c2b1e80c740091117abeb0bf3d1a7caeba Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 04:52:47 +0530 Subject: [PATCH 08/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json | 1 + lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index e5cca8c6bf8a..921008c2ebf1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -39,6 +39,7 @@ "@stdlib/math/base/assert/is-negative-zerof", "@stdlib/napi/export", "@stdlib/napi/argv", + "@stdlib/napi/argv-float", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-strided-float64array" ] diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c index cee6943e0aeb..7b40c16e9a26 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c @@ -23,6 +23,7 @@ #include "stdlib/napi/argv_float.h" #include "stdlib/napi/argv_int64.h" #include "stdlib/napi/argv_strided_float32array.h" +#include /** * Receives JavaScript callback invocation data. From a3b8e2f8e01d01f74a7a271487f3c975dc265397 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 04:54:32 +0530 Subject: [PATCH 09/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c index 7b40c16e9a26..b56fc8c5a25d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c @@ -16,6 +16,7 @@ * limitations under the License. */ +#include #include "stdlib/blas/ext/base/ssort2ins.h" #include "stdlib/blas/base/saxpy.h" #include "stdlib/napi/export.h" @@ -23,7 +24,6 @@ #include "stdlib/napi/argv_float.h" #include "stdlib/napi/argv_int64.h" #include "stdlib/napi/argv_strided_float32array.h" -#include /** * Receives JavaScript callback invocation data. From a2dbfd6a55150d37d6615d8fa8bcee5ecf3c90c5 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 05:00:12 +0530 Subject: [PATCH 10/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/src/addon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c index b56fc8c5a25d..ac8b9bf8d1dd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c @@ -16,7 +16,6 @@ * limitations under the License. */ -#include #include "stdlib/blas/ext/base/ssort2ins.h" #include "stdlib/blas/base/saxpy.h" #include "stdlib/napi/export.h" @@ -24,6 +23,7 @@ #include "stdlib/napi/argv_float.h" #include "stdlib/napi/argv_int64.h" #include "stdlib/napi/argv_strided_float32array.h" +#include /** * Receives JavaScript callback invocation data. @@ -36,12 +36,12 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV( env, info, argv, argc, 6 ); STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); - STDLIB_NAPI_ARGV_FLOAT( env, alpha, argv, 1 ); + STDLIB_NAPI_ARGV_FLOAT( env, order, argv, 1 ); STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 4 ); - c_ssort2ins( N, alpha, X, strideX, Y, strideY ); + c_ssort2ins( N, order, X, strideX, Y, strideY ); return NULL; } From 7d6fd89edc44ef5071c731d04248836771bc09f8 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 11:48:45 +0530 Subject: [PATCH 11/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../blas/ext/base/ssort2ins/docs/repl.txt | 8 +- .../ext/base/ssort2ins/lib/ndarray.native.js | 14 +++- .../blas/ext/base/ssort2ins/manifest.json | 81 +++++++++---------- .../blas/ext/base/ssort2ins/src/addon.c | 26 +++--- 4 files changed, 68 insertions(+), 61 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt index 01fb77495bde..49e09ecfa6ea 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt @@ -3,7 +3,7 @@ Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort. - The `N` and `stride` parameters determine which elements in the strided + The `N` and stride parameters determine which elements in the strided arrays are are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use typed @@ -58,7 +58,7 @@ Returns ------- x: Float32Array - Input array `x`. + Output array. Examples -------- @@ -97,7 +97,7 @@ 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 @@ -130,7 +130,7 @@ Returns ------- x: Float32Array - Input array `x`. + Output array. Examples -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js index b1cf1190363a..8828c2b8a370 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js @@ -20,8 +20,8 @@ // MODULES // -var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' ); var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); +var offsetView = require( '@stdlib/strided/base/offset-view' ); var addon = require( './ssort2ins.native.js' ); @@ -59,11 +59,19 @@ function ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) { var viewY; var flg; + flg = 1.0; + if ( strideX < 0 ) { + flg *= -1.0; // reversing order + order *= -1.0; + strideX *= -1; + } + offsetX = minViewBufferIndex( N, strideX, offsetX ); offsetY = minViewBufferIndex( N, strideY, offsetY ); - viewX = reinterpret( x, offsetX ); - viewY = reinterpret( y, offsetY ); + viewX = offsetView( x, offsetX ); + viewY = offsetView( y, offsetY ); + addon( N, order, viewX, strideX, viewY, flg*strideY ); return x; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index 921008c2ebf1..caed3d57b69b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -1,48 +1,47 @@ { "options": {}, "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } ], "confs": [ - { - "src": [ - "./src/ssort2ins.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lm" - ], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/assert/is-nanf", - "@stdlib/math/base/assert/is-negative-zerof", - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-float", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float64array" - ] - } + { + "src": [ + "./src/ssort2ins.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/assert/is-nanf", + "@stdlib/math/base/assert/is-negative-zerof", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + } ] } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c index ac8b9bf8d1dd..9b0c524bd289 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c @@ -16,12 +16,11 @@ * limitations under the License. */ -#include "stdlib/blas/ext/base/ssort2ins.h" -#include "stdlib/blas/base/saxpy.h" +##include "stdlib/blas/ext/base/ssort2ins.h" #include "stdlib/napi/export.h" #include "stdlib/napi/argv.h" -#include "stdlib/napi/argv_float.h" #include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_float64.h" #include "stdlib/napi/argv_strided_float32array.h" #include @@ -34,15 +33,16 @@ * @return Node-API value */ static napi_value addon( napi_env env, napi_callback_info info ) { - STDLIB_NAPI_ARGV( env, info, argv, argc, 6 ); - STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); - STDLIB_NAPI_ARGV_FLOAT( env, order, argv, 1 ); - STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); - STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 ); - STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 ); - STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 4 ); - c_ssort2ins( N, order, X, strideX, Y, strideY ); - return NULL; + STDLIB_NAPI_ARGV( env, info, argv, argc, 6 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_FLOAT64( env, order, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); + STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 4 ); + c_ssort2ins( N, order, (void *)X, strideX, (void *)Y, strideY ); + return NULL; } -STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) \ No newline at end of file +STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) + From 4421608afbfca26b2cb645f93e7b3022f44abc8d Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 12:04:59 +0530 Subject: [PATCH 12/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../blas/ext/base/ssort2ins/manifest.json | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index caed3d57b69b..a7d0c3993a9f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -42,6 +42,34 @@ "@stdlib/napi/argv-int64", "@stdlib/napi/argv-strided-float64array" ] + }, + { + "task": "benchmark", + "src": [ + "./src/ssort2ins.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [] + }, + { + "task": "examples", + "src": [ + "./src/ssort2ins.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [] } ] } From 85365a8127ad451f8479c59af23a8023d0206235 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 12:05:46 +0530 Subject: [PATCH 13/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/manifest.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index a7d0c3993a9f..8fa513769ffc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -69,7 +69,12 @@ "-lm" ], "libpath": [], - "dependencies": [] + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] } ] } From 5f00ef57d50aadc33d3ef60673564a9680d13531 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 12:06:42 +0530 Subject: [PATCH 14/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/manifest.json | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index 8fa513769ffc..cdfb9d44ee91 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -1,5 +1,7 @@ { - "options": {}, + "options": { + "task": "build" + }, "fields": [ { "field": "src", @@ -69,12 +71,7 @@ "-lm" ], "libpath": [], - "dependencies": [ - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float64array" - ] + "dependencies": [] } ] } From a9a483616466c4171721afe659181c45f541536e Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 12:09:52 +0530 Subject: [PATCH 15/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/manifest.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index cdfb9d44ee91..72976b11a21f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -37,8 +37,6 @@ ], "libpath": [], "dependencies": [ - "@stdlib/math/base/assert/is-nanf", - "@stdlib/math/base/assert/is-negative-zerof", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", @@ -71,7 +69,10 @@ "-lm" ], "libpath": [], - "dependencies": [] + "dependencies": [ + "@stdlib/math/base/assert/is-nanf", + "@stdlib/math/base/assert/is-negative-zerof" + ] } ] } From 4f7514acc44403ae1575be88d72d548370559dd1 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Thu, 14 Mar 2024 13:19:09 +0530 Subject: [PATCH 16/33] refactor: update blas/ext/base/ssort2ins to follow current project conventions --- .../@stdlib/blas/ext/base/ssort2ins/docs/repl.txt | 4 ++-- .../@stdlib/blas/ext/base/ssort2ins/docs/types/index.d.ts | 6 +++--- .../@stdlib/blas/ext/base/ssort2ins/examples/c/example.c | 3 ++- .../@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js | 5 ++--- .../@stdlib/blas/ext/base/ssort2ins/manifest.json | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt index 49e09ecfa6ea..ab535b167dd1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt @@ -58,7 +58,7 @@ Returns ------- x: Float32Array - Output array. + First input array. Examples -------- @@ -130,7 +130,7 @@ Returns ------- x: Float32Array - Output array. + First input array. Examples -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/types/index.d.ts index 653a9b40b97f..7483cac46674 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/types/index.d.ts @@ -31,7 +31,7 @@ interface Routine { * @param strideX - `x` stride length * @param y - second input array * @param strideY - `y` stride length - * @returns `x` + * @returns first input array * * @example * var Float32Array = require( '@stdlib/array/float32' ); @@ -60,7 +60,7 @@ interface Routine { * @param y - second input array * @param strideY - `y` stride length * @param offsetY - `y` starting index - * @returns `x` + * @returns first input array * * @example * var Float32Array = require( '@stdlib/array/float32' ); @@ -88,7 +88,7 @@ interface Routine { * @param strideX - `x` stride length * @param y - second input array * @param strideY - `y` stride length -* @returns `x` +* @returns first input array * * @example * var Float32Array = require( '@stdlib/array/float32' ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c index 1ccacdc4d8bc..f66e8c59235c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/examples/c/example.c @@ -40,4 +40,5 @@ int main( void ) { printf( "x[ %i ] = %f\n", i, x[ i ] ); printf( "y[ %i ] = %"PRId64"\n", i, (int64_t)y[ i ] ); } -} \ No newline at end of file +} + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js index 8828c2b8a370..b94b3d7d0bd4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js @@ -59,9 +59,8 @@ function ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) { var viewY; var flg; - flg = 1.0; - if ( strideX < 0 ) { - flg *= -1.0; // reversing order + flg = (strideX < 0) ? -1.0 : 1.0; + if (flg < 0) { order *= -1.0; strideX *= -1; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index 72976b11a21f..43baf430febe 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -40,7 +40,7 @@ "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float64array" + "@stdlib/napi/argv-strided-float32array" ] }, { From 504306fb1312ce0707628285a6c938cac27d5d61 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Mon, 25 Mar 2024 01:57:55 +0530 Subject: [PATCH 17/33] fix: resolved issues --- .../@stdlib/blas/ext/base/ssort2ins/docs/repl.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt index ab535b167dd1..846f02d70ca1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/docs/repl.txt @@ -3,8 +3,8 @@ Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort. - The `N` and stride parameters determine which elements in the strided - arrays are are accessed at runtime. + The `N` and stride parameters determine which elements in the strided + arrays are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use typed array views. From 0362d8ab26530fcaeee53d18dff68fe6b30350e3 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Mon, 25 Mar 2024 02:10:05 +0530 Subject: [PATCH 18/33] fix: resolved issues --- lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index 43baf430febe..44be38ba0a3f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -26,6 +26,7 @@ ], "confs": [ { + "task": "build", "src": [ "./src/ssort2ins.c" ], From fc5c90803a49fd898a4d188d8488fe84023b4f5b Mon Sep 17 00:00:00 2001 From: vr-varad Date: Mon, 25 Mar 2024 02:12:51 +0530 Subject: [PATCH 19/33] fix: resolved issues --- lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c index 9b0c524bd289..46c51544b9bb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c @@ -16,7 +16,7 @@ * limitations under the License. */ -##include "stdlib/blas/ext/base/ssort2ins.h" +#include "stdlib/blas/ext/base/ssort2ins.h" #include "stdlib/napi/export.h" #include "stdlib/napi/argv.h" #include "stdlib/napi/argv_int64.h" From 945ea98a86688d73a1c3b864481227decdfae0e5 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Mon, 25 Mar 2024 02:16:12 +0530 Subject: [PATCH 20/33] fix: made changes in manifest.json --- lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index 44be38ba0a3f..61769b540a7d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -41,6 +41,7 @@ "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", + "@stdlib/math/base/assert/argv-float64", "@stdlib/napi/argv-strided-float32array" ] }, From feac823d47883b966bf0bb16c24c39500f81acd4 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Mon, 25 Mar 2024 02:25:46 +0530 Subject: [PATCH 21/33] fix: made changes in manifest.json --- lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index 61769b540a7d..55d36cbe1f43 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -41,7 +41,7 @@ "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", - "@stdlib/math/base/assert/argv-float64", + "@stdlib/napi/argv-float64", "@stdlib/napi/argv-strided-float32array" ] }, From bfbbcfbbab63e3d818b143d4d3c8220e6ae11aa7 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Mon, 25 Mar 2024 02:34:12 +0530 Subject: [PATCH 22/33] fix: made changes in manifest.json --- lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json | 1 - lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index 55d36cbe1f43..44be38ba0a3f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -41,7 +41,6 @@ "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-float64", "@stdlib/napi/argv-strided-float32array" ] }, diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c index 46c51544b9bb..3713d84b6377 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c @@ -20,7 +20,6 @@ #include "stdlib/napi/export.h" #include "stdlib/napi/argv.h" #include "stdlib/napi/argv_int64.h" -#include "stdlib/napi/argv_float64.h" #include "stdlib/napi/argv_strided_float32array.h" #include @@ -35,7 +34,6 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV( env, info, argv, argc, 6 ); STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); - STDLIB_NAPI_ARGV_FLOAT64( env, order, argv, 1 ); STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 ); From d60a85fa0302551588f3242f1cf8431602ba8b8d Mon Sep 17 00:00:00 2001 From: vr-varad Date: Mon, 25 Mar 2024 02:40:47 +0530 Subject: [PATCH 23/33] fix: made changes in manifest.json --- lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json | 1 + lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index 44be38ba0a3f..95f5735fda6c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -41,6 +41,7 @@ "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-double", "@stdlib/napi/argv-strided-float32array" ] }, diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c index 3713d84b6377..787b2d999370 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c @@ -20,6 +20,7 @@ #include "stdlib/napi/export.h" #include "stdlib/napi/argv.h" #include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_double.h" #include "stdlib/napi/argv_strided_float32array.h" #include @@ -34,6 +35,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV( env, info, argv, argc, 6 ); STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_DOUBLE( env, order, argv, 1 ); STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 ); From 3892a6bdd7a247d14d6c0efdb1714557b63d30f0 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Mon, 25 Mar 2024 02:46:56 +0530 Subject: [PATCH 24/33] fix: made changes --- .../@stdlib/blas/ext/base/ssort2ins/manifest.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index 95f5735fda6c..681cb8850252 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -42,7 +42,9 @@ "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-double", - "@stdlib/napi/argv-strided-float32array" + "@stdlib/napi/argv-strided-float32array", + "@stdlib/math/base/assert/is-nanf", + "@stdlib/math/base/assert/is-negative-zerof" ] }, { @@ -71,10 +73,7 @@ "-lm" ], "libpath": [], - "dependencies": [ - "@stdlib/math/base/assert/is-nanf", - "@stdlib/math/base/assert/is-negative-zerof" - ] + "dependencies": [] } ] } From 61e9c6f3003e21fb11969d93faaf2989f2cd9759 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Mon, 25 Mar 2024 02:49:24 +0530 Subject: [PATCH 25/33] fix: made changes --- .../@stdlib/blas/ext/base/ssort2ins/manifest.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json index 681cb8850252..1d5b62bd8416 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/manifest.json @@ -73,7 +73,10 @@ "-lm" ], "libpath": [], - "dependencies": [] + "dependencies": [ + "@stdlib/math/base/assert/is-nanf", + "@stdlib/math/base/assert/is-negative-zerof" + ] } ] } From f3e07d2e755b575d23c31b5bc704a8e7d3c09d8f Mon Sep 17 00:00:00 2001 From: vr-varad Date: Sat, 30 Mar 2024 12:19:42 +0530 Subject: [PATCH 26/33] fix: fixed some issues in ndarray.native.js --- .../ext/base/ssort2ins/lib/ndarray.native.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js index b94b3d7d0bd4..061d2da4081c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js @@ -22,6 +22,7 @@ var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); var offsetView = require( '@stdlib/strided/base/offset-view' ); +var abs = require( '@stdlib/math/base/special/abs' ); var addon = require( './ssort2ins.native.js' ); @@ -57,12 +58,20 @@ var addon = require( './ssort2ins.native.js' ); function ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) { var viewX; var viewY; - var flg; + var flg=1.0; - flg = (strideX < 0) ? -1.0 : 1.0; - if (flg < 0) { + if (strideX < 0 || strideY < 0) { + flg *= -1.0; // Reversing order order *= -1.0; - strideX *= -1; + strideX = abs(strideX); // Ensure positive strideX + strideY = abs(strideY); // Ensure positive strideY + } + + if (strideX < 0) { + offsetX -= (N - 1) * abs(strideX); + } + if (strideY < 0) { + offsetY -= (N - 1) * abs(strideY); } offsetX = minViewBufferIndex( N, strideX, offsetX ); From 8821185d78ba2f43fcec501185ec4b8edc85bc05 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Sat, 30 Mar 2024 14:52:48 +0530 Subject: [PATCH 27/33] fix: fixed some issues in ndarray.native.js --- .../ext/base/ssort2ins/lib/ndarray.native.js | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js index 061d2da4081c..71ce2a5bd4a9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js @@ -20,9 +20,7 @@ // MODULES // -var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); -var offsetView = require( '@stdlib/strided/base/offset-view' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var Float32Array = require( '@stdlib/array/float32' ); var addon = require( './ssort2ins.native.js' ); @@ -58,28 +56,20 @@ var addon = require( './ssort2ins.native.js' ); function ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) { var viewX; var viewY; - var flg=1.0; + var flg; - if (strideX < 0 || strideY < 0) { - flg *= -1.0; // Reversing order + flg = 1.0; + if ( strideX < 0 ) { + flg *= -1.0; // reversing order order *= -1.0; - strideX = abs(strideX); // Ensure positive strideX - strideY = abs(strideY); // Ensure positive strideY + strideX *= -1; + offsetX -= (N-1) * strideX; } - - if (strideX < 0) { - offsetX -= (N - 1) * abs(strideX); - } - if (strideY < 0) { - offsetY -= (N - 1) * abs(strideY); + if ( strideY < 0 ) { + offsetY += (N-1) * strideY; } - - offsetX = minViewBufferIndex( N, strideX, offsetX ); - offsetY = minViewBufferIndex( N, strideY, offsetY ); - - viewX = offsetView( x, offsetX ); - viewY = offsetView( y, offsetY ); - + viewX = new Float32Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offsetX), x.length-offsetX ); // eslint-disable-line max-len + viewY = new Float32Array( y.buffer, y.byteOffset+(y.BYTES_PER_ELEMENT*offsetY), y.length-offsetY ); // eslint-disable-line max-len addon( N, order, viewX, strideX, viewY, flg*strideY ); return x; } From 95aa3db1259232e38d22361ca42d040587948e8f Mon Sep 17 00:00:00 2001 From: vr-varad Date: Sat, 30 Mar 2024 15:14:31 +0530 Subject: [PATCH 28/33] fix: fixed some issues in ndarray.native.js --- .../blas/ext/base/ssort2ins/lib/ndarray.native.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js index 71ce2a5bd4a9..f6e6ddf73233 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js @@ -20,7 +20,8 @@ // MODULES // -var Float32Array = require( '@stdlib/array/float32' ); +var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); +var offsetView = require( '@stdlib/strided/base/offset-view' ); var addon = require( './ssort2ins.native.js' ); @@ -63,13 +64,13 @@ function ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) { flg *= -1.0; // reversing order order *= -1.0; strideX *= -1; - offsetX -= (N-1) * strideX; + offsetX = minViewBufferIndex( N, strideX, offsetX ); } if ( strideY < 0 ) { - offsetY += (N-1) * strideY; + offsetY = minViewBufferIndex( N, strideY, offsetY ); } - viewX = new Float32Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offsetX), x.length-offsetX ); // eslint-disable-line max-len - viewY = new Float32Array( y.buffer, y.byteOffset+(y.BYTES_PER_ELEMENT*offsetY), y.length-offsetY ); // eslint-disable-line max-len + viewX = offsetView( x, offsetX ); + viewY = offsetView( x, offsetY ); addon( N, order, viewX, strideX, viewY, flg*strideY ); return x; } From 1c99356bf0c4358b6cdb2ef9f7cfc84979e44912 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Sat, 30 Mar 2024 15:21:57 +0530 Subject: [PATCH 29/33] fix: fixed some issues in ndarray.native.js --- .../@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js index f6e6ddf73233..7565255c5812 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js @@ -64,11 +64,10 @@ function ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) { flg *= -1.0; // reversing order order *= -1.0; strideX *= -1; - offsetX = minViewBufferIndex( N, strideX, offsetX ); - } - if ( strideY < 0 ) { - offsetY = minViewBufferIndex( N, strideY, offsetY ); } + offsetY = minViewBufferIndex( N, strideY, offsetY ); + offsetX = minViewBufferIndex( N, strideX, offsetX ); + viewX = offsetView( x, offsetX ); viewY = offsetView( x, offsetY ); addon( N, order, viewX, strideX, viewY, flg*strideY ); From f178d03834266362df3fed26065d23cbfde98092 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Sat, 30 Mar 2024 15:29:21 +0530 Subject: [PATCH 30/33] fix: fixed some issues in ndarray.native.js --- .../blas/ext/base/ssort2ins/lib/ndarray.native.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js index 7565255c5812..89616fde7780 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js @@ -57,19 +57,20 @@ var addon = require( './ssort2ins.native.js' ); function ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) { var viewX; var viewY; - var flg; + var flg = 1.0; - flg = 1.0; if ( strideX < 0 ) { flg *= -1.0; // reversing order order *= -1.0; strideX *= -1; } - offsetY = minViewBufferIndex( N, strideY, offsetY ); + offsetX = minViewBufferIndex( N, strideX, offsetX ); + offsetY = minViewBufferIndex( N, strideY, offsetY ); viewX = offsetView( x, offsetX ); - viewY = offsetView( x, offsetY ); + viewY = offsetView( y, offsetY ); + addon( N, order, viewX, strideX, viewY, flg*strideY ); return x; } From 741c938bec64e1a0ce0dd65adbf22c08d274da55 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Sat, 30 Mar 2024 15:47:00 +0530 Subject: [PATCH 31/33] fix: fixed some issues in ndarray.native.js --- .../@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js index 89616fde7780..4f460f3a2f6d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js @@ -63,10 +63,11 @@ function ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) { flg *= -1.0; // reversing order order *= -1.0; strideX *= -1; + offsetX = minViewBufferIndex( N, strideX, offsetX ); + } + if ( strideY < 0 ) { + offsetY = minViewBufferIndex( N, strideY, offsetY ); } - - offsetX = minViewBufferIndex( N, strideX, offsetX ); - offsetY = minViewBufferIndex( N, strideY, offsetY ); viewX = offsetView( x, offsetX ); viewY = offsetView( y, offsetY ); From 79a40af8f4385b2f02f4a49efa90d60391294353 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Sat, 30 Mar 2024 15:54:54 +0530 Subject: [PATCH 32/33] fix: fixed some issues in ndarray.native.js --- .../@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js index 4f460f3a2f6d..100c8e2d4e3c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/lib/ndarray.native.js @@ -59,14 +59,12 @@ function ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) { var viewY; var flg = 1.0; + offsetX = minViewBufferIndex( N, strideX, offsetX ); + offsetY = minViewBufferIndex( N, strideY, offsetY ); if ( strideX < 0 ) { flg *= -1.0; // reversing order order *= -1.0; strideX *= -1; - offsetX = minViewBufferIndex( N, strideX, offsetX ); - } - if ( strideY < 0 ) { - offsetY = minViewBufferIndex( N, strideY, offsetY ); } viewX = offsetView( x, offsetX ); From 0b58f32cfb5c1f00bd491857b86d450b29616fec Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 28 Apr 2024 15:15:10 -0400 Subject: [PATCH 33/33] chore: remove unneeded casts --- lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c index 787b2d999370..844a0d5d3095 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/ssort2ins/src/addon.c @@ -40,7 +40,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 4 ); - c_ssort2ins( N, order, (void *)X, strideX, (void *)Y, strideY ); + c_ssort2ins( N, order, X, strideX, Y, strideY ); return NULL; }