Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Sep 29, 2024
1 parent 830b111 commit e95d4df
Show file tree
Hide file tree
Showing 12 changed files with 183 additions and 239 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

19 changes: 17 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,27 @@
<section class="release" id="unreleased">

## Unreleased (2024-09-01)
## Unreleased (2024-09-29)

<section class="issues">

### Closed Issues

This release closes the following issue:

[#1536](https://github.com/stdlib-js/stdlib/issues/1536)

</section>

<!-- /.issues -->

<section class="commits">

### Commits

<details>

- [`b57ae2e`](https://github.com/stdlib-js/stdlib/commit/b57ae2e52609433b1d07e0384a1c724a7308f401) - **refactor:** updated `blas/ext/base/ssort2sh` to follow current project conventions [(#2957)](https://github.com/stdlib-js/stdlib/pull/2957) _(by Aayush Khanna, Philipp Burckhardt)_
- [`272ae7a`](https://github.com/stdlib-js/stdlib/commit/272ae7ac5c576c68cfab1b6e304c86407faa20cd) - **docs:** remove comment _(by Athan Reines)_

</details>
Expand All @@ -24,9 +37,11 @@

### Contributors

A total of 1 person contributed to this release. Thank you to this contributor:
A total of 3 people contributed to this release. Thank you to the following contributors:

- Aayush Khanna
- Athan Reines
- Philipp Burckhardt

</section>

Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# Contributors listed in alphabetical order.

Aayush Khanna <96649223+aayush0325@users.noreply.github.com>
Adarsh Palaskar <adarshpalaskar99@gmail.com>
Aditya Sapra <adityaework@gmail.com>
AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com>
Expand All @@ -20,23 +21,27 @@ Christopher Dambamuromo <chridam@gmail.com>
Dan Rose <danoftheroses@gmail.com>
Daniel Killenberger <daniel.killenberger@gmail.com>
Daniel Yu <40680511+Daniel777y@users.noreply.github.com>
Debashis Maharana <debashismaharana7854@gmail.com>
Dominik Moritz <domoritz@gmail.com>
Dorrin Sotoudeh <dorrinsotoudeh123@gmail.com>
EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com>
Frank Kovacs <fran70kk@gmail.com>
Golden Kumar <103646877+AuenKr@users.noreply.github.com>
Gunj Joshi <gunjjoshi8372@gmail.com>
HarshaNP <96897754+GittyHarsha@users.noreply.github.com>
Harshita Kalani <harshitakalani02@gmail.com>
Hridyanshu <124202756+HRIDYANSHU054@users.noreply.github.com>
Jaimin Godhani <112328542+Jai0401@users.noreply.github.com>
James Gelok <jdgelok@gmail.com>
Jaysukh Makvana <jaysukhmakvana2004@gmail.com>
Jenish Thapa <141203631+jenish-thapa@users.noreply.github.com>
Jithin KS <jithinks112@gmail.com>
Joel Mathew Koshy <joelmathewkoshy@gmail.com>
Joey Reed <joeyrreed@gmail.com>
Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
Joris Labie <joris.labie1@gmail.com>
Justin Dennison <justin1dennison@gmail.com>
Kaif Mohd <mdkaifprofession@gmail.com>
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
Khaldon <kahmd1444@gmail.com>
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
Expand Down Expand Up @@ -86,13 +91,17 @@ Stephannie Jiménez Gacha <steff456@hotmail.com>
Suraj kumar <125961509+kumarsuraj212003@users.noreply.github.com>
Tirtadwipa Manunggal <tirtadwipa.manunggal@gmail.com>
Tudor Pagu <104032457+tudor-pagu@users.noreply.github.com>
Tufailahmed Bargir <142114244+Tufailahmed-Bargir@users.noreply.github.com>
Utkarsh <http://utkarsh11105@gmail.com>
Utkarsh Raj <rajutkarsh2505@gmail.com>
Vaibhav Patel <98279986+noobCoderVP@users.noreply.github.com>
Varad Gupta <varadgupta21@gmail.com>
Xiaochuan Ye <tap91624@gmail.com>
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
naveen <stupiddint@gmail.com>
nishant-s7 <97207366+nishant-s7@users.noreply.github.com>
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
orimiles5 <97595296+orimiles5@users.noreply.github.com>
rainn <88160429+AmCodesLame@users.noreply.github.com>
rei2hu <reimu@reimu.ws>
yaswanth <116426380+yaswanthkosuru@users.noreply.github.com>
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,15 @@ 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 );

ssort2sh( N, -1.0, x, 2, y, 2 );
ssort2sh( 2, -1.0, x, 2, y, 2 );

console.log( x );
// => <Float32Array>[ 3.0, -2.0, 1.0, -4.0 ]
Expand All @@ -114,7 +112,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 ] );
Expand All @@ -123,10 +120,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...
ssort2sh( N, -1.0, x1, 2, y1, 2 );
ssort2sh( 2, -1.0, x1, 2, y1, 2 );

console.log( x0 );
// => <Float32Array>[ 1.0, 4.0, 3.0, 2.0 ]
Expand Down Expand Up @@ -159,7 +155,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' );
Expand Down Expand Up @@ -210,12 +206,10 @@ var ssort2sh = require( '@stdlib/blas-ext-base-ssort2sh' );

var rand;
var sign;
var x;
var y;
var i;

x = new Float32Array( 10 );
y = new Float32Array( 10 ); // index array
var x = new Float32Array( 10 );
var y = new Float32Array( 10 ); // index array
for ( i = 0; i < x.length; i++ ) {
rand = round( randu()*100.0 );
sign = randu();
Expand Down
20 changes: 9 additions & 11 deletions docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Simultaneously sorts two single-precision floating-point strided arrays
based on the sort order of the first array using Shellsort.

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 accessed at runtime.

Indexing is relative to the first index. To introduce an offset, use typed
array views.
Expand Down Expand Up @@ -67,11 +67,10 @@
> y
<Float32Array>[ 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 )
<Float32Array>[ 3.0, -2.0, 1.0, -4.0 ]
> y
<Float32Array>[ 2.0, 1.0, 0.0, 3.0 ]
Expand All @@ -81,22 +80,22 @@
> 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 )
<Float32Array>[ -4.0, 3.0, -2.0 ]
> x0
<Float32Array>[ 1.0, -4.0, 3.0, -2.0 ]
> y0
<Float32Array>[ 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 Shellsort and 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
starting index.
buffer, the offset parameter supports indexing semantics based on a starting
index.

Parameters
----------
Expand Down Expand Up @@ -143,8 +142,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 )
<Float32Array>[ 1.0, -4.0, 3.0, -2.0 ]
> y
<Float32Array>[ 0.0, 3.0, 2.0, 1.0 ]
Expand Down
4 changes: 2 additions & 2 deletions docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ interface Routine {
* @param N - number of indexed elements
* @param order - sort order
* @param x - first input array
* @param strideX - `x` stride length
* @param strideX - first stride length
* @param y - second input array
* @param strideY - `y` stride length
* @param strideY - second stride length
* @returns `x`
*
* @example
Expand Down
6 changes: 2 additions & 4 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ var ssort2sh = require( './../lib' );

var rand;
var sign;
var x;
var y;
var i;

x = new Float32Array( 10 );
y = new Float32Array( 10 ); // index array
var x = new Float32Array( 10 );
var y = new Float32Array( 10 ); // index array
for ( i = 0; i < x.length; i++ ) {
if ( randu() < 0.2 ) {
x[ i ] = NaN;
Expand Down
2 changes: 1 addition & 1 deletion include.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Source files:
'src_files': [
'<(src_dir)/addon.cpp',
'<(src_dir)/addon.c',
'<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).src; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
],

Expand Down
124 changes: 83 additions & 41 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,85 @@
{
"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
}
],
"confs": [
{
"src": [
"./src/ssort2sh.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libpath": [],
"dependencies": [
"@stdlib/math-base-assert-is-nanf",
"@stdlib/math-base-assert-is-negative-zerof"
]
}
]
"options": {
"task": "build"
},
"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
}
],
"confs": [
{
"task": "build",
"src": [
"./src/ssort2sh.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-float32array"
]
},
{
"task": "benchmark",
"src": [
"./src/ssort2sh.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libpath": [],
"dependencies": [
"@stdlib/math-base-assert-is-nanf",
"@stdlib/math-base-assert-is-negative-zerof"
]
},
{
"task": "examples",
"src": [
"./src/ssort2sh.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libpath": [],
"dependencies": [
"@stdlib/math-base-assert-is-nanf",
"@stdlib/math-base-assert-is-negative-zerof"
]
}
]
}
Loading

0 comments on commit e95d4df

Please sign in to comment.