Skip to content

Commit 84cc466

Browse files
committed
Auto-generated commit
1 parent 794e842 commit 84cc466

File tree

12 files changed

+1245
-1
lines changed

12 files changed

+1245
-1
lines changed

CHANGELOG.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-04-03)
7+
## Unreleased (2025-04-09)
88

99
<section class="packages">
1010

@@ -1074,6 +1074,28 @@ This release closes the following issue:
10741074

10751075
<!-- /.package -->
10761076

1077+
<section class="package" id="array-base-reshape-unreleased">
1078+
1079+
#### [@stdlib/array/base/reshape](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/reshape)
1080+
1081+
<details>
1082+
1083+
<section class="features">
1084+
1085+
##### Features
1086+
1087+
- [`40de89d`](https://github.com/stdlib-js/stdlib/commit/40de89d0b84ab345f198d6a90696c0762efde887) - add `array/base/reshape` [(#5639)](https://github.com/stdlib-js/stdlib/pull/5639)
1088+
1089+
</section>
1090+
1091+
<!-- /.features -->
1092+
1093+
</details>
1094+
1095+
</section>
1096+
1097+
<!-- /.package -->
1098+
10771099
<section class="package" id="array-base-scatter-filled-unreleased">
10781100

10791101
#### [@stdlib/array/base/scatter-filled](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/scatter-filled)
@@ -1627,6 +1649,7 @@ A total of 14 people contributed to this release. Thank you to the following con
16271649

16281650
<details>
16291651

1652+
- [`40de89d`](https://github.com/stdlib-js/stdlib/commit/40de89d0b84ab345f198d6a90696c0762efde887) - **feat:** add `array/base/reshape` [(#5639)](https://github.com/stdlib-js/stdlib/pull/5639) _(by Muhammad Haris, Athan Reines)_
16301653
- [`54534dd`](https://github.com/stdlib-js/stdlib/commit/54534ddb74b35d0b99915f8017ed9d9e692a7502) - **chore:** address commit comments [(#5978)](https://github.com/stdlib-js/stdlib/pull/5978) _(by Jay Soni, Athan Reines, stdlib-bot)_
16311654
- [`e28064f`](https://github.com/stdlib-js/stdlib/commit/e28064f9d93a232d82297842a9a4bd2895952a55) - **docs:** update namespace TypeScript declarations [(#6478)](https://github.com/stdlib-js/stdlib/pull/6478) _(by stdlib-bot)_
16321655
- [`f2c38e2`](https://github.com/stdlib-js/stdlib/commit/f2c38e218661b2aa21fe58bf2e56ed7c57c2e013) - **docs:** update namespace table of contents [(#6480)](https://github.com/stdlib-js/stdlib/pull/6480) _(by stdlib-bot)_

CONTRIBUTORS

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Dev Goel <[email protected]>
4343
Dhanyabad behera <[email protected]>
4444
Dhruv Arvind Singh <[email protected]>
4545
Dhruvil Mehta <[email protected]>
46+
Dipjyoti Das <[email protected]>
4647
Divyansh Seth <[email protected]>
4748
Dominic Lim <[email protected]>
4849
Dominik Moritz <[email protected]>
@@ -76,6 +77,7 @@ Joris Labie <[email protected]>
7677
Justin Dennison <[email protected]>
7778
Justyn Shelby <[email protected]>
7879
Karan Anand <[email protected]>
80+
Karan Yadav <[email protected]>
7981
Karthik Prakash <[email protected]>
8082
Kaushikgtm <[email protected]>
8183
Kavyansh-Bagdi <[email protected]>
@@ -95,6 +97,8 @@ Mohammad Bin Aftab <[email protected]>
9597
Mohammad Kaif <[email protected]>
9698
Momtchil Momtchev <[email protected]>
9799
Muhammad Haris <[email protected]>
100+
Muhammad Taaha Tariq <[email protected]>
101+
Muhmmad Saad <[email protected]>
98102
Naresh Jagadeesan <[email protected]>
99103
Naveen Kumar <[email protected]>
100104
Neeraj Pathak <[email protected]>
@@ -112,6 +116,7 @@ Prajwal Kulkarni <[email protected]>
112116
Pranav Goswami <[email protected]>
113117
Pranjal Jha <[email protected]>
114118
Prashant Kumar Yadav <[email protected]>
119+
PrathamBhamare <[email protected]>
115120
Pratik Singh <[email protected]>
116121
Pratyush Kumar Chouhan <[email protected]>
117122
Priyansh Prajapati <[email protected]>
@@ -127,6 +132,7 @@ Rishav <[email protected]>
127132
Rishav Tarway <[email protected]>
128133
Robert Gislason <[email protected]>
129134
Roman Stetsyk <[email protected]>
135+
130136
Rutam Kathale <[email protected]>
131137
Ruthwik Chikoti <[email protected]>
132138
Ryan Seal <[email protected]>

base/reshape/README.md

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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+
# reshape
22+
23+
> Reshape a nested array into another nested array having a desired shape.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var reshape = require( '@stdlib/array/base/reshape' );
31+
```
32+
33+
#### reshape( x, fromShape, toShape, colexicographic )
34+
35+
Reshapes a nested array into another nested array having a desired shape.
36+
37+
```javascript
38+
var x = [ [ 1, 2, 3 ], [ 4, 5, 6 ] ];
39+
40+
var out = reshape( x, [ 2, 3 ], [ 3, 2 ], false );
41+
// returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ]
42+
```
43+
44+
- **x**: input array.
45+
- **fromShape**: input array shape.
46+
- **toShape**: output array shape.
47+
- **colexicographic**: boolean indicating whether to reshape the array in colexicographic order.
48+
49+
To reshape in colexicographic order, set the `colexicographic` argument to `true`.
50+
51+
```javascript
52+
var x = [ [ 1, 2, 3 ], [ 4, 5, 6 ] ];
53+
54+
var out = reshape( x, [ 2, 3 ], [ 3, 2 ], true );
55+
// [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
56+
```
57+
58+
</section>
59+
60+
<!-- /.usage -->
61+
62+
<section class="notes">
63+
64+
## Notes
65+
66+
- The function assumes that `fromShape` and `toShape` describe arrays having the same number of elements.
67+
68+
</section>
69+
70+
<!-- /.notes -->
71+
72+
<section class="examples">
73+
74+
## Examples
75+
76+
<!-- eslint no-undef: "error" -->
77+
78+
```javascript
79+
var reshape = require( '@stdlib/array/base/reshape' );
80+
81+
var x = [
82+
[ 1, 2, 3, 4 ],
83+
[ 5, 6, 7, 8 ],
84+
[ 9, 10, 11, 12 ]
85+
];
86+
87+
var out = reshape( x, [ 3, 4 ], [ 4, 3 ], false );
88+
// returns [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ], [ 10, 11, 12 ] ]
89+
90+
out = reshape( x, [ 3, 4 ], [ 6, 2 ], false );
91+
// returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ], [ 7, 8 ], [ 9, 10 ], [ 11, 12 ] ]
92+
93+
out = reshape( x, [ 3, 4 ], [ 1, 12 ], false );
94+
// returns [ [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] ]
95+
96+
out = reshape( x, [ 3, 4 ], [ 12, 1 ], false );
97+
// returns [ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ], [ 7 ], [ 8 ], [ 9 ], [ 10 ], [ 11 ], [ 12 ] ]
98+
```
99+
100+
</section>
101+
102+
<!-- /.examples -->
103+
104+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
105+
106+
<section class="related">
107+
108+
</section>
109+
110+
<!-- /.related -->
111+
112+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
113+
114+
<section class="links">
115+
116+
<!-- <related-links> -->
117+
118+
<!-- </related-links> -->
119+
120+
</section>
121+
122+
<!-- /.links -->

0 commit comments

Comments
 (0)