Skip to content

Commit fe26db4

Browse files
committed
Auto-generated commit
1 parent 98d9d2c commit fe26db4

File tree

11 files changed

+1095
-1
lines changed

11 files changed

+1095
-1
lines changed

CHANGELOG.md

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

7-
## Unreleased (2025-12-08)
7+
## Unreleased (2025-12-09)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`1080085`](https://github.com/stdlib-js/stdlib/commit/1080085cbf97a2d217339594fda596759a49386b) - add `ndarray/base/to-flippedlr` [(#8848)](https://github.com/stdlib-js/stdlib/pull/8848)
1314
- [`c034ac5`](https://github.com/stdlib-js/stdlib/commit/c034ac5a8b15ac837619c50efa8db3266c897f8e) - add `ndarray/concat1d` [(#8584)](https://github.com/stdlib-js/stdlib/pull/8584)
1415
- [`493f0c2`](https://github.com/stdlib-js/stdlib/commit/493f0c2fe4ce47b5ea8e5fedd81ef68d028b83f9) - update `ndarray` TypeScript declarations
1516
- [`53295ce`](https://github.com/stdlib-js/stdlib/commit/53295ce482ae3c95cc80afd5295acbc9f2a476eb) - update `ndarray/base` TypeScript declarations
@@ -647,6 +648,7 @@ A total of 36 issues were closed in this release:
647648

648649
<details>
649650

651+
- [`1080085`](https://github.com/stdlib-js/stdlib/commit/1080085cbf97a2d217339594fda596759a49386b) - **feat:** add `ndarray/base/to-flippedlr` [(#8848)](https://github.com/stdlib-js/stdlib/pull/8848) _(by Muhammad Haris, Athan Reines)_
650652
- [`2772189`](https://github.com/stdlib-js/stdlib/commit/2772189443aedf358ee73b3232feadd2a0acc581) - **docs:** improve doctests for complex number instances in `ndarray/base/broadcast-scalar` [(#8869)](https://github.com/stdlib-js/stdlib/pull/8869) _(by ashutoshsao, Athan Reines)_
651653
- [`ae93d82`](https://github.com/stdlib-js/stdlib/commit/ae93d8247174e8ba0a0bdcb20a14dfa6569b1542) - **docs:** add missing space _(by Philipp Burckhardt)_
652654
- [`c034ac5`](https://github.com/stdlib-js/stdlib/commit/c034ac5a8b15ac837619c50efa8db3266c897f8e) - **feat:** add `ndarray/concat1d` [(#8584)](https://github.com/stdlib-js/stdlib/pull/8584) _(by Muhammad Haris, Athan Reines)_

base/to-flippedlr/README.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# toFlippedlr
22+
23+
> Return a new ndarray where the order of elements along the last dimension of an input ndarray is reversed.
24+
25+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26+
27+
<section class="intro">
28+
29+
</section>
30+
31+
<!-- /.intro -->
32+
33+
<!-- Package usage documentation. -->
34+
35+
<section class="usage">
36+
37+
## Usage
38+
39+
```javascript
40+
var toFlippedlr = require( '@stdlib/ndarray/base/to-flippedlr' );
41+
```
42+
43+
#### toFlippedlr( x )
44+
45+
Returns a new ndarray where the order of elements along the last dimension of an input ndarray is reversed.
46+
47+
```javascript
48+
var ndarray = require( '@stdlib/ndarray/ctor' );
49+
var ndarray2array = require( '@stdlib/ndarray/to-array' );
50+
51+
var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
52+
var shape = [ 3, 2 ];
53+
var strides = [ 2, 1 ];
54+
var offset = 0;
55+
56+
var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
57+
// returns <ndarray>
58+
59+
var sh = x.shape;
60+
// returns [ 3, 2 ]
61+
62+
var arr = ndarray2array( x );
63+
// returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
64+
65+
var y = toFlippedlr( x );
66+
// returns <ndarray>
67+
68+
sh = y.shape;
69+
// returns [ 3, 2 ]
70+
71+
arr = ndarray2array( y );
72+
// returns [ [ 2.0, 1.0 ], [ 4.0, 3.0 ], [ 6.0, 5.0 ] ]
73+
```
74+
75+
The function accepts the following arguments:
76+
77+
- **x**: input ndarray.
78+
79+
</section>
80+
81+
<!-- /.usage -->
82+
83+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
84+
85+
<section class="notes">
86+
87+
## Notes
88+
89+
- If provided a zero-dimensional ndarray, as the ndarray has no dimensions to reverse, the function simply returns a copy of the input ndarray.
90+
91+
</section>
92+
93+
<!-- /.notes -->
94+
95+
<!-- Package usage examples. -->
96+
97+
<section class="examples">
98+
99+
## Examples
100+
101+
<!-- eslint no-undef: "error" -->
102+
103+
```javascript
104+
var array = require( '@stdlib/ndarray/array' );
105+
var ndarray2array = require( '@stdlib/ndarray/to-array' );
106+
var zeroTo = require( '@stdlib/array/base/zero-to' );
107+
var toFlippedlr = require( '@stdlib/ndarray/base/to-flippedlr' );
108+
109+
// Create a linear ndarray buffer:
110+
var buf = zeroTo( 16 );
111+
112+
// Create a three-dimensional ndarray:
113+
var x = array( buf, {
114+
'shape': [ 2, 4, 2 ]
115+
});
116+
117+
// Reverse the order of last dimension:
118+
var y = toFlippedlr( x );
119+
// returns <ndarray>
120+
121+
var a = ndarray2array( y );
122+
console.log( a );
123+
// => [ [ [ 1, 0 ], [ 3, 2 ], [ 5, 4 ], [ 7, 6 ] ], [ [ 9, 8 ], [ 11, 10 ], [ 13, 12 ], [ 15, 14 ] ] ]
124+
```
125+
126+
</section>
127+
128+
<!-- /.examples -->
129+
130+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
131+
132+
<section class="references">
133+
134+
</section>
135+
136+
<!-- /.references -->
137+
138+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
139+
140+
<section class="related">
141+
142+
</section>
143+
144+
<!-- /.related -->
145+
146+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
147+
148+
<section class="links">
149+
150+
</section>
151+
152+
<!-- /.links -->

0 commit comments

Comments
 (0)