Skip to content

Commit 16f1748

Browse files
committed
Auto-generated commit
1 parent c3bd583 commit 16f1748

File tree

8 files changed

+488
-43
lines changed

8 files changed

+488
-43
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-01-18)
7+
## Unreleased (2025-02-05)
8+
9+
<section class="features">
10+
11+
### Features
12+
13+
- [`e5a8c65`](https://github.com/stdlib-js/stdlib/commit/e5a8c6593a68bdf3d385fbb4c1d75ba4309bad5d) - add accessor arrays support to `blas/ext/base/gcusum` [(#5065)](https://github.com/stdlib-js/stdlib/pull/5065)
14+
15+
</section>
16+
17+
<!-- /.features -->
818

919
<section class="commits">
1020

1121
### Commits
1222

1323
<details>
1424

25+
- [`e5a8c65`](https://github.com/stdlib-js/stdlib/commit/e5a8c6593a68bdf3d385fbb4c1d75ba4309bad5d) - **feat:** add accessor arrays support to `blas/ext/base/gcusum` [(#5065)](https://github.com/stdlib-js/stdlib/pull/5065) _(by Muhammad Haris, stdlib-bot)_
1526
- [`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)_
1627

1728
</details>

CONTRIBUTORS

Lines changed: 2 additions & 0 deletions
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+
Dev Goel <135586571+corsairier@users.noreply.github.com>
3031
Dhruv Arvind Singh <154677013+DhruvArvindSingh@users.noreply.github.com>
3132
Divyansh Seth <59174836+sethdivyansh@users.noreply.github.com>
3233
Dominic Lim <46486515+domlimm@users.noreply.github.com>
@@ -62,6 +63,7 @@ Marcus Fantham <mfantham@users.noreply.github.com>
6263
Matt Cochrane <matthew.cochrane.eng@gmail.com>
6364
Mihir Pandit <129577900+MSP20086@users.noreply.github.com>
6465
Milan Raj <rajsite@users.noreply.github.com>
66+
Mohammad Bin Aftab <48010758+MohammadBinAftab@users.noreply.github.com>
6567
Mohammad Kaif <mdkaifprofession@gmail.com>
6668
Momtchil Momtchev <momtchil@momtchev.com>
6769
Muhammad Haris <harriskhan047@outlook.com>

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ gcusum.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 );
161161
## Notes
162162

163163
- If `N <= 0`, both functions return `y` unchanged.
164+
- 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])
164165
- Depending on the environment, the typed versions ([`dcusum`][@stdlib/blas/ext/base/dcusum], [`scusum`][@stdlib/blas/ext/base/scusum], etc.) are likely to be significantly more performant.
165166

166167
</section>
@@ -291,6 +292,8 @@ Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
291292

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

295+
[@stdlib/array/base/accessor]: https://github.com/stdlib-js/array-base-accessor
296+
294297
<!-- <related-links> -->
295298

296299
[@stdlib/blas/ext/base/dcusum]: https://github.com/stdlib-js/blas-ext-base-dcusum

docs/types/index.d.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { NumericArray } from '@stdlib/types/array';
23+
import { NumericArray, Collection, AccessorArrayLike } from '@stdlib/types/array';
24+
25+
/**
26+
* Input array.
27+
*/
28+
type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
29+
30+
/**
31+
* Output array.
32+
*/
33+
type OutputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
2434

2535
/**
2636
* Interface describing `gcusum`.
@@ -44,7 +54,7 @@ interface Routine {
4454
* gcusum( x.length, 0.0, x, 1, y, 1 );
4555
* // y => [ 1.0, -1.0, 1.0 ]
4656
*/
47-
( N: number, sum: number, x: NumericArray, strideX: number, y: NumericArray, strideY: number ): NumericArray;
57+
<T extends OutputArray>( N: number, sum: number, x: InputArray, strideX: number, y: T, strideY: number ): T;
4858

4959
/**
5060
* Computes the cumulative sum of strided array elements using alternative indexing semantics.
@@ -66,7 +76,7 @@ interface Routine {
6676
* gcusum.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 );
6777
* // y => [ 1.0, -1.0, 1.0 ]
6878
*/
69-
ndarray( N: number, sum: number, x: NumericArray, strideX: number, offsetX: number, y: NumericArray, strideY: number, offsetY: number ): NumericArray;
79+
ndarray<T extends OutputArray>( N: number, sum: number, x: InputArray, strideX: number, offsetX: number, y: T, strideY: number, offsetY: number ): T;
7080
}
7181

7282
/**

docs/types/test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19+
import AccessorArray = require( '@stdlib/array-base-accessor' );
1920
import gcusum = require( './index' );
2021

2122

@@ -26,7 +27,8 @@ import gcusum = require( './index' );
2627
const x = new Float64Array( 10 );
2728
const y = new Float64Array( 10 );
2829

29-
gcusum( x.length, 0.0, x, 1, y, 1 ); // $ExpectType NumericArray
30+
gcusum( x.length, 0.0, x, 1, y, 1 ); // $ExpectType Float64Array
31+
gcusum( x.length, 0.0, new AccessorArray( x ), 1, new AccessorArray( y ), 1 ); // $ExpectType AccessorArray<number>
3032
}
3133

3234
// The compiler throws an error if the function is provided a first argument which is not a number...
@@ -139,7 +141,8 @@ import gcusum = require( './index' );
139141
const x = new Float64Array( 10 );
140142
const y = new Float64Array( 10 );
141143

142-
gcusum.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // $ExpectType NumericArray
144+
gcusum.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // $ExpectType Float64Array
145+
gcusum.ndarray( x.length, 0.0, new AccessorArray( x ), 1, 0, new AccessorArray( y ), 1, 0 ); // $ExpectType AccessorArray<number>
143146
}
144147

145148
// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2"
4444
},
4545
"devDependencies": {
46+
"@stdlib/array-base-to-accessor-array": "^0.2.2",
4647
"@stdlib/array-float64": "^0.2.2",
4748
"@stdlib/array-zeros": "^0.2.2",
4849
"@stdlib/blas-ext-base-gfill": "^0.2.1",
4950
"@stdlib/math-base-assert-is-nan": "^0.2.2",
50-
"@stdlib/math-base-special-floor": "^0.2.3",
5151
"@stdlib/math-base-special-pow": "^0.3.0",
5252
"@stdlib/random-array-discrete-uniform": "^0.2.1",
5353
"@stdlib/random-array-uniform": "^0.2.1",

0 commit comments

Comments
 (0)