Skip to content

Commit 58e8a2e

Browse files
committed
Auto-generated commit
1 parent ecc1154 commit 58e8a2e

24 files changed

Lines changed: 3150 additions & 2 deletions

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

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

7-
## Unreleased (2026-03-23)
7+
## Unreleased (2026-03-24)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`204c9d9`](https://github.com/stdlib-js/stdlib/commit/204c9d9ac9befd22cce40a0f9b6db373dd6d62df) - add `ndarray/base/full` [(#11017)](https://github.com/stdlib-js/stdlib/pull/11017)
1314
- [`af91b63`](https://github.com/stdlib-js/stdlib/commit/af91b6343883ad338f02e4930bae849b10c36cf8) - add `assignScalar` to namespace
1415
- [`9cdcdaa`](https://github.com/stdlib-js/stdlib/commit/9cdcdaa02def03413192fa975055590f4179c766) - add `ndarray/base/assign-scalar` [(#11029)](https://github.com/stdlib-js/stdlib/pull/11029)
1516
- [`da4d88c`](https://github.com/stdlib-js/stdlib/commit/da4d88c64f605abb92f06579bbc166cec7cea45d) - update `ndarray` TypeScript declarations [(#11084)](https://github.com/stdlib-js/stdlib/pull/11084)
@@ -798,6 +799,7 @@ A total of 44 issues were closed in this release:
798799

799800
<details>
800801

802+
- [`204c9d9`](https://github.com/stdlib-js/stdlib/commit/204c9d9ac9befd22cce40a0f9b6db373dd6d62df) - **feat:** add `ndarray/base/full` [(#11017)](https://github.com/stdlib-js/stdlib/pull/11017) _(by Loay Ahmed, Athan Reines, stdlib-bot)_
801803
- [`647e0b1`](https://github.com/stdlib-js/stdlib/commit/647e0b1fd6fbf9e5b1c0d704c6a0621f23f71acd) - **refactor:** use scalar assign utility _(by Athan Reines)_
802804
- [`af91b63`](https://github.com/stdlib-js/stdlib/commit/af91b6343883ad338f02e4930bae849b10c36cf8) - **feat:** add `assignScalar` to namespace _(by Athan Reines)_
803805
- [`9cdcdaa`](https://github.com/stdlib-js/stdlib/commit/9cdcdaa02def03413192fa975055590f4179c766) - **feat:** add `ndarray/base/assign-scalar` [(#11029)](https://github.com/stdlib-js/stdlib/pull/11029) _(by Muhammad Haris, Athan Reines)_
@@ -2281,7 +2283,7 @@ A total of 44 issues were closed in this release:
22812283

22822284
### Contributors
22832285

2284-
A total of 39 people contributed to this release. Thank you to the following contributors:
2286+
A total of 40 people contributed to this release. Thank you to the following contributors:
22852287

22862288
- Aryan kumar
22872289
- Athan Reines
@@ -2299,6 +2301,7 @@ A total of 39 people contributed to this release. Thank you to the following con
22992301
- Harshit Verma
23002302
- Karan Vasudevamurthy
23012303
- Kate Suraev
2304+
- Loay Ahmed
23022305
- Lokesh Ranjan
23032306
- MANI
23042307
- Muhammad Haris

base/full/README.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2026 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+
# full
22+
23+
> Create an [ndarray][@stdlib/ndarray/base/ctor] filled with a specified value and having a specified shape and [data type][@stdlib/ndarray/dtypes].
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 full = require( '@stdlib/ndarray/base/full' );
41+
```
42+
43+
#### full( value, dtype, shape, order )
44+
45+
Returns an [ndarray][@stdlib/ndarray/base/ctor] filled with a specified value and having a specified shape and [data type][@stdlib/ndarray/dtypes].
46+
47+
```javascript
48+
var getShape = require( '@stdlib/ndarray/shape' );
49+
var getDType = require( '@stdlib/ndarray/dtype' );
50+
51+
var arr = full( 10.0, 'float64', [ 2, 2 ], 'row-major' );
52+
// returns <ndarray>[ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ]
53+
54+
var sh = getShape( arr );
55+
// returns [ 2, 2 ]
56+
57+
var dt = String( getDType( arr ) );
58+
// returns 'float64'
59+
```
60+
61+
This function accepts the following arguments:
62+
63+
- **value**: scalar fill value.
64+
- **dtype**: underlying [data type][@stdlib/ndarray/dtypes].
65+
- **shape**: array shape.
66+
- **order**: specifies whether an [ndarray][@stdlib/ndarray/base/ctor] is `'row-major'` (C-style) or `'column-major'` (Fortran-style).
67+
68+
</section>
69+
70+
<!-- /.usage -->
71+
72+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
73+
74+
<section class="notes">
75+
76+
## Notes
77+
78+
- If `value` is a number and `x` has a complex [data type][@stdlib/ndarray/dtypes], the function fills an output ndarray with a complex number whose real component equals the provided scalar `value` and whose imaginary component is zero.
79+
- A `value` must be able to safely cast to the output ndarray [data type][@stdlib/ndarray/dtypes]. Scalar values having floating-point data types (both real and complex) are allowed to downcast to a lower precision data type of the same kind (e.g., a scalar double-precision floating-point number can be used to fill a `'float32'` output ndarray).
80+
81+
</section>
82+
83+
<!-- /.notes -->
84+
85+
<!-- Package usage examples. -->
86+
87+
<section class="examples">
88+
89+
## Examples
90+
91+
<!-- eslint no-undef: "error" -->
92+
93+
```javascript
94+
var dtypes = require( '@stdlib/ndarray/dtypes' );
95+
var ndarray2array = require( '@stdlib/ndarray/to-array' );
96+
var full = require( '@stdlib/ndarray/base/full' );
97+
98+
// Get a list of data types:
99+
var dt = dtypes( 'integer_and_generic' );
100+
101+
// Generate initialized arrays...
102+
var arr;
103+
var i;
104+
for ( i = 0; i < dt.length; i++ ) {
105+
arr = full( 10, dt[ i ], [ 2, 2 ], 'row-major' );
106+
console.log( ndarray2array( arr ) );
107+
}
108+
```
109+
110+
</section>
111+
112+
<!-- /.examples -->
113+
114+
<!-- 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. -->
115+
116+
<section class="references">
117+
118+
</section>
119+
120+
<!-- /.references -->
121+
122+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
123+
124+
<section class="related">
125+
126+
</section>
127+
128+
<!-- /.related -->
129+
130+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
131+
132+
<section class="links">
133+
134+
[@stdlib/ndarray/base/ctor]: https://github.com/stdlib-js/ndarray/tree/main/base/ctor
135+
136+
[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray/tree/main/dtypes
137+
138+
</section>
139+
140+
<!-- /.links -->

0 commit comments

Comments
 (0)