Skip to content

Commit c3bd583

Browse files
committed
Auto-generated commit
1 parent 15210a6 commit c3bd583

File tree

17 files changed

+124
-113
lines changed

17 files changed

+124
-113
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: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,41 @@
22

33
> Package changelog.
44
5+
<section class="release" id="unreleased">
6+
7+
## Unreleased (2025-01-18)
8+
9+
<section class="commits">
10+
11+
### Commits
12+
13+
<details>
14+
15+
- [`897aa61`](https://github.com/stdlib-js/stdlib/commit/897aa61d3548b7dceec551b64dd353d506bb307b) - **refactor:** update `blas/ext/base/gcusum` to follow current project conventions [(#4435)](https://github.com/stdlib-js/stdlib/pull/4435) _(by Muhammad Haris, Athan Reines)_
16+
17+
</details>
18+
19+
</section>
20+
21+
<!-- /.commits -->
22+
23+
<section class="contributors">
24+
25+
### Contributors
26+
27+
A total of 2 people contributed to this release. Thank you to the following contributors:
28+
29+
- Athan Reines
30+
- Muhammad Haris
31+
32+
</section>
33+
34+
<!-- /.contributors -->
35+
36+
</section>
37+
38+
<!-- /.release -->
39+
540
<section class="release" id="v0.2.2">
641

742
## 0.2.2 (2024-07-28)

CONTRIBUTORS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ 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+
Dhruv Arvind Singh <154677013+DhruvArvindSingh@users.noreply.github.com>
3031
Divyansh Seth <59174836+sethdivyansh@users.noreply.github.com>
3132
Dominic Lim <46486515+domlimm@users.noreply.github.com>
3233
Dominik Moritz <domoritz@gmail.com>
@@ -49,6 +50,7 @@ Joey Reed <joeyrreed@gmail.com>
4950
Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
5051
Joris Labie <joris.labie1@gmail.com>
5152
Justin Dennison <justin1dennison@gmail.com>
53+
Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
5254
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
5355
Kohantika Nath <145763549+kohantikanath@users.noreply.github.com>
5456
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
@@ -117,7 +119,7 @@ UtkershBasnet <119008923+UtkershBasnet@users.noreply.github.com>
117119
Vaibhav Patel <98279986+noobCoderVP@users.noreply.github.com>
118120
Varad Gupta <varadgupta21@gmail.com>
119121
Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
120-
Vivek maurya <155618190+vivekmaurya001@users.noreply.github.com>
122+
Vivek Maurya <vm8118134@gmail.com>
121123
Xiaochuan Ye <tap91624@gmail.com>
122124
Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
123125
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>

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: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,17 @@ The function has the following parameters:
9292
- **N**: number of indexed elements.
9393
- **sum**: initial sum.
9494
- **x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
95-
- **strideX**: index increment for `x`.
95+
- **strideX**: stride length for `x`.
9696
- **y**: output [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
97-
- **strideY**: index increment for `y`.
97+
- **strideY**: stride length for `y`.
9898

99-
The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`,
99+
The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element:
100100

101101
```javascript
102-
var floor = require( '@stdlib/math-base-special-floor' );
103-
104102
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ];
105103
var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
106104

107-
var N = floor( x.length / 2 );
108-
109-
var v = gcusum( N, 0.0, x, 2, y, 1 );
105+
var v = gcusum( 4, 0.0, x, 2, y, 1 );
110106
// y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]
111107
```
112108

@@ -116,7 +112,6 @@ Note that indexing is relative to the first index. To introduce an offset, use [
116112

117113
```javascript
118114
var Float64Array = require( '@stdlib/array-float64' );
119-
var floor = require( '@stdlib/math-base-special-floor' );
120115

121116
// Initial arrays...
122117
var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
@@ -126,9 +121,7 @@ var y0 = new Float64Array( x0.length );
126121
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
127122
var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element
128123

129-
var N = floor( x0.length / 2 );
130-
131-
gcusum( N, 0.0, x1, -2, y1, 1 );
124+
gcusum( 4, 0.0, x1, -2, y1, 1 );
132125
// y0 => <Float64Array>[ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ]
133126
```
134127

@@ -149,17 +142,13 @@ The function has the following additional parameters:
149142
- **offsetX**: starting index for `x`.
150143
- **offsetY**: starting index for `y`.
151144

152-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element
145+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to calculate the cumulative sum of every other element in the strided input array starting from the second element and to store in the last `N` elements of the strided output array starting from the last element:
153146

154147
```javascript
155-
var floor = require( '@stdlib/math-base-special-floor' );
156-
157148
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];
158149
var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
159150

160-
var N = floor( x.length / 2 );
161-
162-
gcusum.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 );
151+
gcusum.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 );
163152
// y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ]
164153
```
165154

@@ -185,20 +174,14 @@ gcusum.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 );
185174
<!-- eslint no-undef: "error" -->
186175

187176
```javascript
188-
var randu = require( '@stdlib/random-base-randu' );
189-
var round = require( '@stdlib/math-base-special-round' );
177+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
190178
var Float64Array = require( '@stdlib/array-float64' );
191179
var gcusum = require( '@stdlib/blas-ext-base-gcusum' );
192180

193-
var y;
194-
var x;
195-
var i;
196-
197-
x = new Float64Array( 10 );
198-
y = new Float64Array( x.length );
199-
for ( i = 0; i < x.length; i++ ) {
200-
x[ i ] = round( randu()*100.0 );
201-
}
181+
var x = discreteUniform( 10, -100, 100, {
182+
'dtype': 'float64'
183+
});
184+
var y = new Float64Array( x.length );
202185
console.log( x );
203186
console.log( y );
204187

@@ -258,7 +241,7 @@ See [LICENSE][stdlib-license].
258241

259242
## Copyright
260243

261-
Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
244+
Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
262245

263246
</section>
264247

benchmark/benchmark.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,22 @@
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 gfill = require( '@stdlib/blas-ext-base-gfill' );
28+
var zeros = require( '@stdlib/array-zeros' );
2829
var pkg = require( './../package.json' ).name;
2930
var gcusum = require( './../lib/main.js' );
3031

3132

33+
// VARIABLES //
34+
35+
var options = {
36+
'dtype': 'generic'
37+
};
38+
39+
3240
// FUNCTIONS //
3341

3442
/**
@@ -39,16 +47,8 @@ var gcusum = require( './../lib/main.js' );
3947
* @returns {Function} benchmark function
4048
*/
4149
function createBenchmark( len ) {
42-
var y;
43-
var x;
44-
var i;
45-
46-
x = [];
47-
y = [];
48-
for ( i = 0; i < len; i++ ) {
49-
x.push( ( randu()*20.0 ) - 10.0 );
50-
y.push( 0.0 );
51-
}
50+
var x = uniform( len, -100, 100, options );
51+
var y = zeros( len, options.dtype );
5252
return benchmark;
5353

5454
function benchmark( b ) {

benchmark/benchmark.ndarray.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,22 @@
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 gfill = require( '@stdlib/blas-ext-base-gfill' );
28+
var zeros = require( '@stdlib/array-zeros' );
2829
var pkg = require( './../package.json' ).name;
2930
var gcusum = require( './../lib/ndarray.js' );
3031

3132

33+
// VARIABLES //
34+
35+
var options = {
36+
'dtype': 'generic'
37+
};
38+
39+
3240
// FUNCTIONS //
3341

3442
/**
@@ -39,16 +47,8 @@ var gcusum = require( './../lib/ndarray.js' );
3947
* @returns {Function} benchmark function
4048
*/
4149
function createBenchmark( len ) {
42-
var x;
43-
var y;
44-
var i;
45-
46-
x = [];
47-
y = [];
48-
for ( i = 0; i < len; i++ ) {
49-
x.push( ( randu()*20.0 ) - 10.0 );
50-
y.push( 0.0 );
51-
}
50+
var x = uniform( len, -100, 100, options );
51+
var y = zeros( len, options.dtype );
5252
return benchmark;
5353

5454
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)