Skip to content

Commit f044a9e

Browse files
committed
Auto-generated commit
1 parent f08de9b commit f044a9e

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Features
1212

13+
- [`b6cd4ce`](https://github.com/stdlib-js/stdlib/commit/b6cd4ce12c9a6a123963dca5e8b8bd9647f2ac47) - update `ndarray/base` TypeScript declarations [(#11113)](https://github.com/stdlib-js/stdlib/pull/11113)
1314
- [`0a0d966`](https://github.com/stdlib-js/stdlib/commit/0a0d966d4d29db076510cabadc79aa66a037ec28) - add `full` to namespace
1415
- [`204c9d9`](https://github.com/stdlib-js/stdlib/commit/204c9d9ac9befd22cce40a0f9b6db373dd6d62df) - add `ndarray/base/full` [(#11017)](https://github.com/stdlib-js/stdlib/pull/11017)
1516
- [`af91b63`](https://github.com/stdlib-js/stdlib/commit/af91b6343883ad338f02e4930bae849b10c36cf8) - add `assignScalar` to namespace
@@ -86,6 +87,7 @@ This release closes the following issue:
8687

8788
<details>
8889

90+
- [`b6cd4ce`](https://github.com/stdlib-js/stdlib/commit/b6cd4ce12c9a6a123963dca5e8b8bd9647f2ac47) - **feat:** update `ndarray/base` TypeScript declarations [(#11113)](https://github.com/stdlib-js/stdlib/pull/11113) _(by stdlib-bot)_
8991
- [`0a0d966`](https://github.com/stdlib-js/stdlib/commit/0a0d966d4d29db076510cabadc79aa66a037ec28) - **feat:** add `full` to namespace _(by Athan Reines)_
9092
- [`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)_
9193
- [`647e0b1`](https://github.com/stdlib-js/stdlib/commit/647e0b1fd6fbf9e5b1c0d704c6a0621f23f71acd) - **refactor:** use scalar assign utility _(by Athan Reines)_

docs/types/index.d.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import any = require( '@stdlib/ndarray-base-any' );
2424
import anyBy = require( '@stdlib/ndarray-base-any-by' );
2525
import assert = require( '@stdlib/ndarray-base-assert' );
2626
import assign = require( '@stdlib/ndarray-base-assign' );
27+
import assignScalar = require( '@stdlib/ndarray-base-assign-scalar' );
2728
import atleastnd = require( '@stdlib/ndarray-base-atleastnd' );
2829
import binary = require( '@stdlib/ndarray-base-binary' );
2930
import binaryInputCastingDataType = require( '@stdlib/ndarray-base-binary-input-casting-dtype' );
@@ -87,6 +88,7 @@ import forEach = require( '@stdlib/ndarray-base-for-each' );
8788
import array2ndarray = require( '@stdlib/ndarray-base-from-array' );
8889
import scalar2ndarray = require( '@stdlib/ndarray-base-from-scalar' );
8990
import scalar2ndarrayLike = require( '@stdlib/ndarray-base-from-scalar-like' );
91+
import full = require( '@stdlib/ndarray-base-full' );
9092
import includes = require( '@stdlib/ndarray-base-includes' );
9193
import ind = require( '@stdlib/ndarray-base-ind' );
9294
import ind2sub = require( '@stdlib/ndarray-base-ind2sub' );
@@ -305,6 +307,44 @@ interface Namespace {
305307
*/
306308
assign: typeof assign;
307309

310+
/**
311+
* Assigns a scalar value to every element of an output ndarray.
312+
*
313+
* @param arrays - array-like object containing a zero-dimensional input ndarray containing the scalar value and one output ndarray
314+
*
315+
* @example
316+
* var Float64Array = require( '@stdlib/array-float64' );
317+
* var scalar2ndarray = require( '@stdlib/ndarray-from-scalar' );
318+
* var ndarray = require( '@stdlib/ndarray-ctor' );
319+
*
320+
* // Create a zero-dimensional ndarray containing the scalar value:
321+
* var x = scalar2ndarray( 5.0, {
322+
* 'dtype': 'float64'
323+
* });
324+
*
325+
* // Create a data buffer:
326+
* var ybuf = new Float64Array( 4 );
327+
*
328+
* // Define the shape of the output array:
329+
* var shape = [ 2, 2 ];
330+
*
331+
* // Define the array strides:
332+
* var sy = [ 2, 1 ];
333+
*
334+
* // Define the index offset:
335+
* var oy = 0;
336+
*
337+
* // Create the output ndarray:
338+
* var y = ndarray( 'float64', ybuf, shape, sy, oy, 'row-major' );
339+
*
340+
* // Assign the scalar value:
341+
* ns.assignScalar( [ x, y ] );
342+
*
343+
* console.log( y.data );
344+
* // => <Float64Array>[ 5.0, 5.0, 5.0, 5.0 ]
345+
*/
346+
assignScalar: typeof assignScalar;
347+
308348
/**
309349
* Converts a list of values (scalars and/or ndarrays) to ndarrays having at least a specified number of dimensions.
310350
*
@@ -2041,6 +2081,30 @@ interface Namespace {
20412081
*/
20422082
scalar2ndarrayLike: typeof scalar2ndarrayLike;
20432083

2084+
/**
2085+
* Returns an ndarray filled with a specified value and having a specified shape and data type.
2086+
*
2087+
* @param value - fill value
2088+
* @param dtype - underlying data type
2089+
* @param shape - array shape
2090+
* @param order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)
2091+
* @returns output array
2092+
*
2093+
* @example
2094+
* var getShape = require( '@stdlib/ndarray-shape' );
2095+
* var getDType = require( '@stdlib/ndarray-dtype' );
2096+
*
2097+
* var arr = ns.full( 10.0, 'float32', [ 2, 2 ], 'row-major' );
2098+
* // returns <ndarray>[ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ]
2099+
*
2100+
* var sh = getShape( arr );
2101+
* // returns [ 2, 2 ]
2102+
*
2103+
* var dt = String( getDType( arr ) );
2104+
* // returns 'float32'
2105+
*/
2106+
full: typeof full;
2107+
20442108
/**
20452109
* Tests whether an ndarray contains a specified value.
20462110
*

0 commit comments

Comments
 (0)