Skip to content

Commit cef24be

Browse files
committed
Auto-generated commit
1 parent c18695f commit cef24be

20 files changed

+346
-144
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: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,52 @@
22

33
> Package changelog.
44
5+
<section class="release" id="unreleased">
6+
7+
## Unreleased (2025-02-09)
8+
9+
<section class="features">
10+
11+
### Features
12+
13+
- [`152dfd2`](https://github.com/stdlib-js/stdlib/commit/152dfd2a9f6f420dee659694435c9e44f3095601) - add accessor arrays support to `blas/ext/base/gsum` [(#5134)](https://github.com/stdlib-js/stdlib/pull/5134)
14+
15+
</section>
16+
17+
<!-- /.features -->
18+
19+
<section class="commits">
20+
21+
### Commits
22+
23+
<details>
24+
25+
- [`152dfd2`](https://github.com/stdlib-js/stdlib/commit/152dfd2a9f6f420dee659694435c9e44f3095601) - **feat:** add accessor arrays support to `blas/ext/base/gsum` [(#5134)](https://github.com/stdlib-js/stdlib/pull/5134) _(by Muhammad Haris)_
26+
- [`7456e9f`](https://github.com/stdlib-js/stdlib/commit/7456e9f877610353d1d91969bd7cd30e3ef211c8) - **refactor:** update `blas/base/gsum` to follow current project conventions [(#4924)](https://github.com/stdlib-js/stdlib/pull/4924) _(by Aayush Khanna)_
27+
28+
</details>
29+
30+
</section>
31+
32+
<!-- /.commits -->
33+
34+
<section class="contributors">
35+
36+
### Contributors
37+
38+
A total of 2 people contributed to this release. Thank you to the following contributors:
39+
40+
- Aayush Khanna
41+
- Muhammad Haris
42+
43+
</section>
44+
45+
<!-- /.contributors -->
46+
47+
</section>
48+
49+
<!-- /.release -->
50+
551
<section class="release" id="v0.2.2">
652

753
## 0.2.2 (2024-07-28)

CONTRIBUTORS

Lines changed: 8 additions & 2 deletions
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>
@@ -35,7 +37,7 @@ EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com>
3537
Frank Kovacs <fran70kk@gmail.com>
3638
Golden Kumar <103646877+AuenKr@users.noreply.github.com>
3739
Gunj Joshi <gunjjoshi8372@gmail.com>
38-
Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com>
40+
Gururaj Gurram <gururajgurram1512@gmail.com>
3941
HarshaNP <96897754+GittyHarsha@users.noreply.github.com>
4042
Harshita Kalani <harshitakalani02@gmail.com>
4143
Hridyanshu <124202756+HRIDYANSHU054@users.noreply.github.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,12 @@ 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>
128+
ekambains <bainsinbusiness@gmail.com>
124129
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
130+
pranav-1720 <123018993+pranav-1720@users.noreply.github.com>
125131
rainn <88160429+AmCodesLame@users.noreply.github.com>
126132
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: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -69,33 +69,29 @@ To view installation and usage instructions specific to each branch build, be su
6969
var gsum = require( '@stdlib/blas-ext-base-gsum' );
7070
```
7171

72-
#### gsum( N, x, stride )
72+
#### gsum( N, x, strideX )
7373

7474
Computes the sum of strided array elements.
7575

7676
```javascript
7777
var x = [ 1.0, -2.0, 2.0 ];
78-
var N = x.length;
7978

80-
var v = gsum( N, x, 1 );
79+
var v = gsum( x.length, x, 1 );
8180
// returns 1.0
8281
```
8382

8483
The function has the following parameters:
8584

8685
- **N**: number of indexed elements.
8786
- **x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
88-
- **stride**: index increment for `x`.
87+
- **strideX**: stride length.
8988

90-
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of every other element in `x`,
89+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of every other element:
9190

9291
```javascript
93-
var floor = require( '@stdlib/math-base-special-floor' );
94-
9592
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ];
96-
var N = floor( x.length / 2 );
9793

98-
var v = gsum( N, x, 2 );
94+
var v = gsum( 4, x, 2 );
9995
// returns 5.0
10096
```
10197

@@ -105,42 +101,35 @@ Note that indexing is relative to the first index. To introduce an offset, use [
105101

106102
```javascript
107103
var Float64Array = require( '@stdlib/array-float64' );
108-
var floor = require( '@stdlib/math-base-special-floor' );
109104

110105
var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
111106
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
112107

113-
var N = floor( x0.length / 2 );
114-
115-
var v = gsum( N, x1, 2 );
108+
var v = gsum( 4, x1, 2 );
116109
// returns 5.0
117110
```
118111

119-
#### gsum.ndarray( N, x, stride, offset )
112+
#### gsum.ndarray( N, x, strideX, offsetX )
120113

121114
Computes the sum of strided array elements using alternative indexing semantics.
122115

123116
```javascript
124117
var x = [ 1.0, -2.0, 2.0 ];
125-
var N = x.length;
126118

127-
var v = gsum.ndarray( N, x, 1, 0 );
119+
var v = gsum.ndarray( x.length, x, 1, 0 );
128120
// returns 1.0
129121
```
130122

131123
The function has the following additional parameters:
132124

133-
- **offset**: starting index for `x`.
125+
- **offsetX**: starting index.
134126

135-
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 calculate the sum of every other value in `x` starting from the second value
127+
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 calculate the sum of every other element starting from the second element:
136128

137129
```javascript
138-
var floor = require( '@stdlib/math-base-special-floor' );
139-
140130
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];
141-
var N = floor( x.length / 2 );
142131

143-
var v = gsum.ndarray( N, x, 2, 1 );
132+
var v = gsum.ndarray( 4, x, 2, 1 );
144133
// returns 5.0
145134
```
146135

@@ -153,6 +142,7 @@ var v = gsum.ndarray( N, x, 2, 1 );
153142
## Notes
154143

155144
- If `N <= 0`, both functions return `0.0`.
145+
- 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])
156146
- Depending on the environment, the typed versions ([`dsum`][@stdlib/blas/ext/base/dsum], [`ssum`][@stdlib/blas/ext/base/ssum], etc.) are likely to be significantly more performant.
157147

158148
</section>
@@ -166,18 +156,12 @@ var v = gsum.ndarray( N, x, 2, 1 );
166156
<!-- eslint no-undef: "error" -->
167157

168158
```javascript
169-
var randu = require( '@stdlib/random-base-randu' );
170-
var round = require( '@stdlib/math-base-special-round' );
171-
var Float64Array = require( '@stdlib/array-float64' );
159+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
172160
var gsum = require( '@stdlib/blas-ext-base-gsum' );
173161

174-
var x;
175-
var i;
176-
177-
x = new Float64Array( 10 );
178-
for ( i = 0; i < x.length; i++ ) {
179-
x[ i ] = round( randu()*100.0 );
180-
}
162+
var x = discreteUniform( 10, -100, 100, {
163+
'dtype': 'float64'
164+
});
181165
console.log( x );
182166

183167
var v = gsum( x.length, x, 1 );
@@ -237,7 +221,7 @@ See [LICENSE][stdlib-license].
237221

238222
## Copyright
239223

240-
Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
224+
Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
241225

242226
</section>
243227

@@ -285,6 +269,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
285269

286270
[mdn-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
287271

272+
[@stdlib/array/base/accessor]: https://github.com/stdlib-js/array-base-accessor
273+
288274
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
289275

290276
<!-- <related-links> -->

benchmark/benchmark.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench-harness' );
24-
var randu = require( '@stdlib/random-base-randu' );
24+
var uniform = require( '@stdlib/random-array-uniform' );
2525
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2626
var pow = require( '@stdlib/math-base-special-pow' );
2727
var pkg = require( './../package.json' ).name;
2828
var gsum = require( './../lib/main.js' );
2929

3030

31+
// VARIABLES //
32+
33+
var options = {
34+
'dtype': 'generic'
35+
};
36+
37+
3138
// FUNCTIONS //
3239

3340
/**
@@ -38,13 +45,7 @@ var gsum = require( './../lib/main.js' );
3845
* @returns {Function} benchmark function
3946
*/
4047
function createBenchmark( len ) {
41-
var x;
42-
var i;
43-
44-
x = [];
45-
for ( i = 0; i < len; i++ ) {
46-
x.push( ( randu()*10.0 ) - 20.0 );
47-
}
48+
var x = uniform( len, -100, 100, options );
4849
return benchmark;
4950

5051
function benchmark( b ) {

benchmark/benchmark.ndarray.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench-harness' );
24-
var randu = require( '@stdlib/random-base-randu' );
24+
var uniform = require( '@stdlib/random-array-uniform' );
2525
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2626
var pow = require( '@stdlib/math-base-special-pow' );
2727
var pkg = require( './../package.json' ).name;
2828
var gsum = require( './../lib/ndarray.js' );
2929

3030

31+
// VARIABLES //
32+
33+
var options = {
34+
'dtype': 'generic'
35+
};
36+
37+
3138
// FUNCTIONS //
3239

3340
/**
@@ -38,13 +45,7 @@ var gsum = require( './../lib/ndarray.js' );
3845
* @returns {Function} benchmark function
3946
*/
4047
function createBenchmark( len ) {
41-
var x;
42-
var i;
43-
44-
x = [];
45-
for ( i = 0; i < len; i++ ) {
46-
x.push( ( randu()*10.0 ) - 20.0 );
47-
}
48+
var x = uniform( len, -100, 100, options );
4849
return benchmark;
4950

5051
function benchmark( b ) {

dist/index.js

Lines changed: 5 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)