Skip to content

Commit 4dfcf1c

Browse files
committed
Auto-generated commit
1 parent fd1d84c commit 4dfcf1c

18 files changed

+1229
-211
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ indent_style = tab
8686
[*.{f,f.txt}]
8787
indent_style = space
8888
indent_size = 2
89-
insert_final_newline = false
9089

9190
# Set properties for shell files:
9291
[*.{sh,sh.txt}]

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,50 @@
22

33
> Package changelog.
44
5+
<section class="release" id="unreleased">
6+
7+
## Unreleased (2025-02-08)
8+
9+
<section class="features">
10+
11+
### Features
12+
13+
- [`112b7ef`](https://github.com/stdlib-js/stdlib/commit/112b7ef36a44bc8b27ad757cc3099d2595aa8aaa) - add accessor arrays support and refactor `blas/ext/base/gsorthp` [(#5117)](https://github.com/stdlib-js/stdlib/pull/5117)
14+
15+
</section>
16+
17+
<!-- /.features -->
18+
19+
<section class="commits">
20+
21+
### Commits
22+
23+
<details>
24+
25+
- [`112b7ef`](https://github.com/stdlib-js/stdlib/commit/112b7ef36a44bc8b27ad757cc3099d2595aa8aaa) - **feat:** add accessor arrays support and refactor `blas/ext/base/gsorthp` [(#5117)](https://github.com/stdlib-js/stdlib/pull/5117) _(by Muhammad Haris)_
26+
27+
</details>
28+
29+
</section>
30+
31+
<!-- /.commits -->
32+
33+
<section class="contributors">
34+
35+
### Contributors
36+
37+
A total of 1 person contributed to this release. Thank you to this contributor:
38+
39+
- Muhammad Haris
40+
41+
</section>
42+
43+
<!-- /.contributors -->
44+
45+
</section>
46+
47+
<!-- /.release -->
48+
549
<section class="release" id="v0.2.2">
650

751
## 0.2.2 (2024-07-28)

CONTRIBUTORS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Daniel Killenberger <daniel.killenberger@gmail.com>
2727
Daniel Yu <40680511+Daniel777y@users.noreply.github.com>
2828
Debashis Maharana <debashismaharana7854@gmail.com>
2929
Desh Deepak Kant <118960904+DeshDeepakKant@users.noreply.github.com>
30+
Dev Goel <135586571+corsairier@users.noreply.github.com>
31+
Dhruv Arvind Singh <154677013+DhruvArvindSingh@users.noreply.github.com>
3032
Divyansh Seth <59174836+sethdivyansh@users.noreply.github.com>
3133
Dominic Lim <46486515+domlimm@users.noreply.github.com>
3234
Dominik Moritz <domoritz@gmail.com>
@@ -49,6 +51,7 @@ Joey Reed <joeyrreed@gmail.com>
4951
Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
5052
Joris Labie <joris.labie1@gmail.com>
5153
Justin Dennison <justin1dennison@gmail.com>
54+
Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
5255
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
5356
Kohantika Nath <145763549+kohantikanath@users.noreply.github.com>
5457
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
@@ -60,6 +63,7 @@ Marcus Fantham <mfantham@users.noreply.github.com>
6063
Matt Cochrane <matthew.cochrane.eng@gmail.com>
6164
Mihir Pandit <129577900+MSP20086@users.noreply.github.com>
6265
Milan Raj <rajsite@users.noreply.github.com>
66+
Mohammad Bin Aftab <48010758+MohammadBinAftab@users.noreply.github.com>
6367
Mohammad Kaif <mdkaifprofession@gmail.com>
6468
Momtchil Momtchev <momtchil@momtchev.com>
6569
Muhammad Haris <harriskhan047@outlook.com>
@@ -117,10 +121,11 @@ UtkershBasnet <119008923+UtkershBasnet@users.noreply.github.com>
117121
Vaibhav Patel <98279986+noobCoderVP@users.noreply.github.com>
118122
Varad Gupta <varadgupta21@gmail.com>
119123
Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
120-
Vivek maurya <155618190+vivekmaurya001@users.noreply.github.com>
124+
Vivek Maurya <vm8118134@gmail.com>
121125
Xiaochuan Ye <tap91624@gmail.com>
122126
Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
123127
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
124128
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
129+
pranav-1720 <123018993+pranav-1720@users.noreply.github.com>
125130
rainn <88160429+AmCodesLame@users.noreply.github.com>
126131
rei2hu <reimu@reimu.ws>

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Copyright (c) 2016-2024 The Stdlib Authors.
1+
Copyright (c) 2016-2025 The Stdlib Authors.

README.md

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ To view installation and usage instructions specific to each branch build, be su
6363
var gsorthp = require( '@stdlib/blas-ext-base-gsorthp' );
6464
```
6565

66-
#### gsorthp( N, order, x, stride )
66+
#### gsorthp( N, order, x, strideX )
6767

68-
Sorts a strided array `x` using heapsort.
68+
Sorts a strided array using heapsort.
6969

7070
```javascript
7171
var x = [ 1.0, -2.0, 3.0, -4.0 ];
@@ -79,41 +79,36 @@ The function has the following parameters:
7979
- **N**: number of indexed elements.
8080
- **order**: sort order. If `order < 0.0`, the input strided array is sorted in **decreasing** order. If `order > 0.0`, the input strided array is sorted in **increasing** order. If `order == 0.0`, the input strided array is left unchanged.
8181
- **x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
82-
- **stride**: index increment.
82+
- **strideX**: stride length.
8383

84-
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to sort every other element
84+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to sort every other element:
8585

8686
```javascript
87-
var floor = require( '@stdlib/math-base-special-floor' );
88-
8987
var x = [ 1.0, -2.0, 3.0, -4.0 ];
90-
var N = floor( x.length / 2 );
9188

92-
gsorthp( N, -1.0, x, 2 );
89+
gsorthp( 2, -1.0, x, 2 );
9390
// x => [ 3.0, -2.0, 1.0, -4.0 ]
9491
```
9592

9693
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
9794

9895
```javascript
9996
var Float64Array = require( '@stdlib/array-float64' );
100-
var floor = require( '@stdlib/math-base-special-floor' );
10197

10298
// Initial array...
10399
var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
104100

105101
// Create an offset view...
106102
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
107-
var N = floor( x0.length/2 );
108103

109104
// Sort every other element...
110-
gsorthp( N, -1.0, x1, 2 );
105+
gsorthp( 2, -1.0, x1, 2 );
111106
// x0 => <Float64Array>[ 1.0, 4.0, 3.0, 2.0 ]
112107
```
113108

114-
#### gsorthp.ndarray( N, order, x, stride, offset )
109+
#### gsorthp.ndarray( N, order, x, strideX, offsetX )
115110

116-
Sorts a strided array `x` using heapsort and alternative indexing semantics.
111+
Sorts a strided array using heapsort and alternative indexing semantics.
117112

118113
```javascript
119114
var x = [ 1.0, -2.0, 3.0, -4.0 ];
@@ -124,9 +119,9 @@ gsorthp.ndarray( x.length, 1.0, x, 1, 0 );
124119

125120
The function has the following additional parameters:
126121

127-
- **offset**: starting index.
122+
- **offsetX**: starting index.
128123

129-
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`
124+
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:
130125

131126
```javascript
132127
var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];
@@ -144,6 +139,7 @@ gsorthp.ndarray( 3, 1.0, x, 1, x.length-3 );
144139
## Notes
145140

146141
- If `N <= 0` or `order == 0.0`, both functions return `x` unchanged.
142+
- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array-base/accessor`][@stdlib/array/base/accessor])
147143
- The algorithm distinguishes between `-0` and `+0`. When sorted in increasing order, `-0` is sorted before `+0`. When sorted in decreasing order, `-0` is sorted after `+0`.
148144
- The algorithm sorts `NaN` values to the end. When sorted in increasing order, `NaN` values are sorted last. When sorted in decreasing order, `NaN` values are sorted first.
149145
- The algorithm has space complexity `O(1)` and time complexity `O(N log2 N)`.
@@ -162,27 +158,12 @@ gsorthp.ndarray( 3, 1.0, x, 1, x.length-3 );
162158
<!-- eslint no-undef: "error" -->
163159

164160
```javascript
165-
var round = require( '@stdlib/math-base-special-round' );
166-
var randu = require( '@stdlib/random-base-randu' );
167-
var Float64Array = require( '@stdlib/array-float64' );
161+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
168162
var gsorthp = require( '@stdlib/blas-ext-base-gsorthp' );
169163

170-
var rand;
171-
var sign;
172-
var x;
173-
var i;
174-
175-
x = new Float64Array( 10 );
176-
for ( i = 0; i < x.length; i++ ) {
177-
rand = round( randu()*100.0 );
178-
sign = randu();
179-
if ( sign < 0.5 ) {
180-
sign = -1.0;
181-
} else {
182-
sign = 1.0;
183-
}
184-
x[ i ] = sign * rand;
185-
}
164+
var x = discreteUniform( 10, -100, 100, {
165+
'dtype': 'float64'
166+
});
186167
console.log( x );
187168

188169
gsorthp( x.length, -1.0, x, -1 );
@@ -248,7 +229,7 @@ See [LICENSE][stdlib-license].
248229

249230
## Copyright
250231

251-
Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
232+
Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
252233

253234
</section>
254235

@@ -298,6 +279,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
298279

299280
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
300281

282+
[@stdlib/array/base/accessor]: https://github.com/stdlib-js/array-base-accessor
283+
301284
[@williams:1964a]: https://doi.org/10.1145/512274.512284
302285

303286
[@floyd:1964a]: https://doi.org/10.1145/355588.365103

dist/index.js

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)