Skip to content

Commit f8e6ce3

Browse files
committed
Auto-generated commit
1 parent 5c1a2e1 commit f8e6ce3

26 files changed

+373
-221
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: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,37 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2024-12-30)
7+
## Unreleased (2025-01-22)
8+
9+
<section class="features">
10+
11+
### Features
12+
13+
- [`54148e1`](https://github.com/stdlib-js/stdlib/commit/54148e18d543531ecfa547d752eb4f252d8e51f5) - add C `ndarray` API and refactor `blas/ext/base/srev` [(#4848)](https://github.com/stdlib-js/stdlib/pull/4848)
14+
15+
</section>
16+
17+
<!-- /.features -->
18+
19+
<section class="breaking-changes">
20+
21+
### BREAKING CHANGES
22+
23+
- [`54148e1`](https://github.com/stdlib-js/stdlib/commit/54148e18d543531ecfa547d752eb4f252d8e51f5): rename `c_srev`
24+
25+
- To migrate, users should replace usage of `c_srev` with `stdlib_strided_srev`. The API signatures remain the same.
26+
27+
</section>
28+
29+
<!-- /.breaking-changes -->
830

931
<section class="commits">
1032

1133
### Commits
1234

1335
<details>
1436

37+
- [`54148e1`](https://github.com/stdlib-js/stdlib/commit/54148e18d543531ecfa547d752eb4f252d8e51f5) - **feat:** add C `ndarray` API and refactor `blas/ext/base/srev` [(#4848)](https://github.com/stdlib-js/stdlib/pull/4848) _(by Muhammad Haris, Athan Reines)_
1538
- [`62364f6`](https://github.com/stdlib-js/stdlib/commit/62364f62ea823a3b52c2ad25660ecd80c71f8f36) - **style:** fix C comment alignment _(by Philipp Burckhardt)_
1639
- [`272ae7a`](https://github.com/stdlib-js/stdlib/commit/272ae7ac5c576c68cfab1b6e304c86407faa20cd) - **docs:** remove comment _(by Athan Reines)_
1740
- [`2777e4b`](https://github.com/stdlib-js/stdlib/commit/2777e4be161869d09406e3b17947d24c64b47af2) - **bench:** resolve lint errors in benchmarks _(by Athan Reines)_
@@ -26,9 +49,10 @@
2649

2750
### Contributors
2851

29-
A total of 2 people contributed to this release. Thank you to the following contributors:
52+
A total of 3 people contributed to this release. Thank you to the following contributors:
3053

3154
- Athan Reines
55+
- Muhammad Haris
3256
- Philipp Burckhardt
3357

3458
</section>

CONTRIBUTORS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Daniel Killenberger <[email protected]>
2727
Daniel Yu <[email protected]>
2828
Debashis Maharana <[email protected]>
2929
Desh Deepak Kant <[email protected]>
30+
31+
Dhruv Arvind Singh <[email protected]>
3032
Divyansh Seth <[email protected]>
3133
Dominic Lim <[email protected]>
3234
Dominik Moritz <[email protected]>
@@ -49,6 +51,7 @@ Joey Reed <[email protected]>
4951
Jordan Gallivan <[email protected]>
5052
Joris Labie <[email protected]>
5153
Justin Dennison <[email protected]>
54+
Karan Anand <[email protected]>
5255
Karthik Prakash <[email protected]>
5356
Kohantika Nath <[email protected]>
5457
Krishnendu Das <[email protected]>
@@ -117,7 +120,7 @@ UtkershBasnet <[email protected]>
117120
Vaibhav Patel <[email protected]>
118121
Varad Gupta <[email protected]>
119122
Vinit Pandit <[email protected]>
120-
Vivek maurya <[email protected].com>
123+
Vivek Maurya <vm8118134@gmail.com>
121124
Xiaochuan Ye <[email protected]>
122125
Yaswanth Kosuru <[email protected]>
123126
Yernar Yergaziyev <[email protected]>

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: 130 additions & 14 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 srev = require( '@stdlib/blas-ext-base-srev' );
6464
```
6565

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

68-
Reverses a single-precision floating-point strided array `x` in-place.
68+
Reverses a single-precision floating-point strided array in-place.
6969

7070
```javascript
7171
var Float32Array = require( '@stdlib/array-float32' );
@@ -80,9 +80,9 @@ The function has the following parameters:
8080

8181
- **N**: number of indexed elements.
8282
- **x**: input [`Float32Array`][@stdlib/array/float32].
83-
- **stride**: index increment.
83+
- **strideX**: stride length.
8484

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

8787
```javascript
8888
var Float32Array = require( '@stdlib/array-float32' );
@@ -109,9 +109,9 @@ srev( 3, x1, 2 );
109109
// x0 => <Float32Array>[ 1.0, -6.0, 3.0, -4.0, 5.0, -2.0 ]
110110
```
111111

112-
#### srev.ndarray( N, x, stride, offset )
112+
#### srev.ndarray( N, x, strideX, offsetX )
113113

114-
Reverses a single-precision floating-point strided array `x` in-place using alternative indexing semantics.
114+
Reverses a single-precision floating-point strided array in-place using alternative indexing semantics.
115115

116116
```javascript
117117
var Float32Array = require( '@stdlib/array-float32' );
@@ -124,9 +124,9 @@ srev.ndarray( x.length, x, 1, 0 );
124124

125125
The function has the following additional parameters:
126126

127-
- **offset**: starting index.
127+
- **offsetX**: starting index.
128128

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 the strided array
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 the strided array:
130130

131131
```javascript
132132
var Float32Array = require( '@stdlib/array-float32' );
@@ -159,13 +159,12 @@ srev.ndarray( 3, x, 1, x.length-3 );
159159
<!-- eslint no-undef: "error" -->
160160

161161
```javascript
162-
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' ).factory;
163-
var filledarrayBy = require( '@stdlib/array-filled-by' );
162+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
164163
var srev = require( '@stdlib/blas-ext-base-srev' );
165164

166-
var rand = discreteUniform( -100, 100 );
167-
168-
var x = filledarrayBy( 10, 'float32', rand );
165+
var x = discreteUniform( 10, -100, 100, {
166+
'dtype': 'float32'
167+
});
169168
console.log( x );
170169

171170
srev( x.length, x, 1 );
@@ -176,6 +175,123 @@ console.log( x );
176175

177176
<!-- /.examples -->
178177

178+
<!-- C interface documentation. -->
179+
180+
* * *
181+
182+
<section class="c">
183+
184+
## C APIs
185+
186+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
187+
188+
<section class="intro">
189+
190+
</section>
191+
192+
<!-- /.intro -->
193+
194+
<!-- C usage documentation. -->
195+
196+
<section class="usage">
197+
198+
### Usage
199+
200+
```c
201+
#include "stdlib/blas/ext/base/srev.h"
202+
```
203+
204+
#### stdlib_strided_srev( N, \*X, strideX )
205+
206+
Reverses a single-precision floating-point strided array in-place.
207+
208+
```c
209+
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
210+
211+
stdlib_strided_srev( 4, x, 1 );
212+
```
213+
214+
The function accepts the following arguments:
215+
216+
- **N**: `[in] CBLAS_INT` number of indexed elements.
217+
- **X**: `[inout] float*` input array.
218+
- **strideX**: `[in] CBLAS_INT` stride length.
219+
220+
```c
221+
void stdlib_strided_srev( const CBLAS_INT N, float *X, const CBLAS_INT strideX );
222+
```
223+
224+
#### stdlib_strided_srev_ndarray( N, \*X, strideX, offsetX )
225+
226+
Reverses a single-precision floating-point strided array in-place using alternative indexing semantics.
227+
228+
```c
229+
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
230+
231+
stdlib_strided_srev_ndarray( 4, x, 1, 0 );
232+
```
233+
234+
The function accepts the following arguments:
235+
236+
- **N**: `[in] CBLAS_INT` number of indexed elements.
237+
- **X**: `[inout] float*` input array.
238+
- **strideX**: `[in] CBLAS_INT` stride length.
239+
- **offsetX**: `[in] CBLAS_INT` starting index.
240+
241+
```c
242+
void stdlib_strided_srev_ndarray( const CBLAS_INT N, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
243+
```
244+
245+
</section>
246+
247+
<!-- /.usage -->
248+
249+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
250+
251+
<section class="notes">
252+
253+
</section>
254+
255+
<!-- /.notes -->
256+
257+
<!-- C API usage examples. -->
258+
259+
<section class="examples">
260+
261+
### Examples
262+
263+
```c
264+
#include "stdlib/blas/ext/base/srev.h"
265+
#include <stdio.h>
266+
267+
int main( void ) {
268+
// Create a strided array:
269+
float x[] = { 1.0f, -2.0f, 3.0f, -4.0f, 5.0f, -6.0f, 7.0f, -8.0f };
270+
271+
// Specify the number of elements:
272+
const int N = 8;
273+
274+
// Specify a stride:
275+
const int strideX = 1;
276+
277+
// Reverse the array:
278+
stdlib_strided_srev( N, x, strideX );
279+
280+
// Print the result:
281+
for ( int i = 0; i < 8; i++ ) {
282+
printf( "x[ %i ] = %f\n", i, x[ i ] );
283+
}
284+
}
285+
```
286+
287+
</section>
288+
289+
<!-- /.examples -->
290+
291+
</section>
292+
293+
<!-- /.c -->
294+
179295
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
180296
181297
<section class="related">
@@ -217,7 +333,7 @@ See [LICENSE][stdlib-license].
217333
218334
## Copyright
219335
220-
Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
336+
Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
221337
222338
</section>
223339

benchmark/benchmark.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench-harness' );
24-
var uniform = require( '@stdlib/random-base-uniform' ).factory;
25-
var filledarrayBy = require( '@stdlib/array-filled-by' );
24+
var uniform = require( '@stdlib/random-array-uniform' );
2625
var isnanf = require( '@stdlib/math-base-assert-is-nanf' );
2726
var pow = require( '@stdlib/math-base-special-pow' );
2827
var pkg = require( './../package.json' ).name;
@@ -31,7 +30,9 @@ var srev = require( './../lib/srev.js' );
3130

3231
// VARIABLES //
3332

34-
var rand = uniform( -10.0, 10.0 );
33+
var options = {
34+
'dtype': 'float32'
35+
};
3536

3637

3738
// FUNCTIONS //
@@ -44,7 +45,7 @@ var rand = uniform( -10.0, 10.0 );
4445
* @returns {Function} benchmark function
4546
*/
4647
function createBenchmark( len ) {
47-
var x = filledarrayBy( len, 'float32', rand );
48+
var x = uniform( len, -100, 100, options );
4849
return benchmark;
4950

5051
function benchmark( b ) {

benchmark/benchmark.native.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench-harness' );
25-
var uniform = require( '@stdlib/random-base-uniform' ).factory;
26-
var filledarrayBy = require( '@stdlib/array-filled-by' );
25+
var uniform = require( '@stdlib/random-array-uniform' );
2726
var isnanf = require( '@stdlib/math-base-assert-is-nanf' );
2827
var pow = require( '@stdlib/math-base-special-pow' );
2928
var tryRequire = require( '@stdlib/utils-try-require' );
@@ -36,7 +35,9 @@ var srev = tryRequire( resolve( __dirname, './../lib/srev.native.js' ) );
3635
var opts = {
3736
'skip': ( srev instanceof Error )
3837
};
39-
var rand = uniform( -10.0, 10.0 );
38+
var options = {
39+
'dtype': 'float32'
40+
};
4041

4142

4243
// FUNCTIONS //
@@ -49,7 +50,7 @@ var rand = uniform( -10.0, 10.0 );
4950
* @returns {Function} benchmark function
5051
*/
5152
function createBenchmark( len ) {
52-
var x = filledarrayBy( len, 'float32', rand );
53+
var x = uniform( len, -100, 100, options );
5354
return benchmark;
5455

5556
function benchmark( b ) {

benchmark/benchmark.ndarray.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench-harness' );
24-
var uniform = require( '@stdlib/random-base-uniform' ).factory;
25-
var filledarrayBy = require( '@stdlib/array-filled-by' );
24+
var uniform = require( '@stdlib/random-array-uniform' );
2625
var isnanf = require( '@stdlib/math-base-assert-is-nanf' );
2726
var pow = require( '@stdlib/math-base-special-pow' );
2827
var pkg = require( './../package.json' ).name;
@@ -31,7 +30,9 @@ var srev = require( './../lib/ndarray.js' );
3130

3231
// VARIABLES //
3332

34-
var rand = uniform( -10.0, 10.0 );
33+
var options = {
34+
'dtype': 'float32'
35+
};
3536

3637

3738
// FUNCTIONS //
@@ -44,7 +45,7 @@ var rand = uniform( -10.0, 10.0 );
4445
* @returns {Function} benchmark function
4546
*/
4647
function createBenchmark( len ) {
47-
var x = filledarrayBy( len, 'float32', rand );
48+
var x = uniform( len, -100, 100, options );
4849
return benchmark;
4950

5051
function benchmark( b ) {

0 commit comments

Comments
 (0)