Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Dec 16, 2024
1 parent 7762b2f commit 8b71ded
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

##### Features

- [`58e795d`](https://github.com/stdlib-js/stdlib/commit/58e795db467b7bd1d3dc6c5847f91a97fed2ccff) - update namespace TypeScript declarations [(#3937)](https://github.com/stdlib-js/stdlib/pull/3937)
- [`14427c7`](https://github.com/stdlib-js/stdlib/commit/14427c79bc62f82b16cbadc9d34749901e48d105) - add `fill`, `map`, and `toReversed` to namespace
- [`a0d6619`](https://github.com/stdlib-js/stdlib/commit/a0d66193409576538d0f16aa89cbaeedec7898be) - add `minSignedIntegerDataType` and `minUnsignedIntegerDataType` to namespace
- [`8b1548f`](https://github.com/stdlib-js/stdlib/commit/8b1548fb45c1ff131f5edac20cb984344a2d28ec) - update namespace TypeScript declarations [(#3190)](https://github.com/stdlib-js/stdlib/pull/3190)
Expand Down Expand Up @@ -386,6 +387,8 @@ A total of 3 people contributed to this release. Thank you to the following cont

<details>

- [`58e795d`](https://github.com/stdlib-js/stdlib/commit/58e795db467b7bd1d3dc6c5847f91a97fed2ccff) - **feat:** update namespace TypeScript declarations [(#3937)](https://github.com/stdlib-js/stdlib/pull/3937) _(by stdlib-bot, Philipp Burckhardt)_
- [`c106b69`](https://github.com/stdlib-js/stdlib/commit/c106b69cc141efc8c32e79d55ad8acf07f3c9c0a) - **docs:** update namespace table of contents [(#3939)](https://github.com/stdlib-js/stdlib/pull/3939) _(by stdlib-bot, Philipp Burckhardt)_
- [`58f02bf`](https://github.com/stdlib-js/stdlib/commit/58f02bf605d6879cd80152f11f913451df2ad494) - **docs:** fix comment _(by Athan Reines)_
- [`baffefb`](https://github.com/stdlib-js/stdlib/commit/baffefb25177147fa3bafa5c1d0562a7528d5054) - **docs:** fix comment _(by Athan Reines)_
- [`0546f39`](https://github.com/stdlib-js/stdlib/commit/0546f395abecb502fd703aa364e758bd733cd18e) - **docs:** disable lint rule _(by Athan Reines)_
Expand Down
15 changes: 15 additions & 0 deletions base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ var o = ns;
- <span class="signature">[`emptyLike( x )`][@stdlib/ndarray/base/empty-like]</span><span class="delimiter">: </span><span class="description">create an uninitialized ndarray having the same shape and data type as a provided ndarray.</span>
- <span class="signature">[`empty( dtype, shape, order )`][@stdlib/ndarray/base/empty]</span><span class="delimiter">: </span><span class="description">create an uninitialized ndarray having a specified shape and data type.</span>
- <span class="signature">[`expandDimensions( x, axis )`][@stdlib/ndarray/base/expand-dimensions]</span><span class="delimiter">: </span><span class="description">expand the shape of an array by inserting a new dimension of size one at a specified axis.</span>
- <span class="signature">[`fill( x, value )`][@stdlib/ndarray/base/fill]</span><span class="delimiter">: </span><span class="description">fill an input ndarray with a specified value.</span>
- <span class="signature">[`flag( x, name )`][@stdlib/ndarray/base/flag]</span><span class="delimiter">: </span><span class="description">return a specified flag for a provided ndarray.</span>
- <span class="signature">[`flags( x, copy )`][@stdlib/ndarray/base/flags]</span><span class="delimiter">: </span><span class="description">return the flags of a provided ndarray.</span>
- <span class="signature">[`fliplr( x, writable )`][@stdlib/ndarray/base/fliplr]</span><span class="delimiter">: </span><span class="description">return a view of an input ndarray in which the order of elements along the last dimension is reversed.</span>
Expand All @@ -81,10 +82,13 @@ var o = ns;
- <span class="signature">[`ind( idx, max, mode )`][@stdlib/ndarray/base/ind]</span><span class="delimiter">: </span><span class="description">return an index given an index mode.</span>
- <span class="signature">[`ind2sub( shape, strides, offset, order, idx, mode )`][@stdlib/ndarray/base/ind2sub]</span><span class="delimiter">: </span><span class="description">convert a linear index to an array of subscripts.</span>
- <span class="signature">[`iterationOrder( strides )`][@stdlib/ndarray/base/iteration-order]</span><span class="delimiter">: </span><span class="description">given a stride array, determine array iteration order.</span>
- <span class="signature">[`map( arrays, fcn[, thisArg] )`][@stdlib/ndarray/base/map]</span><span class="delimiter">: </span><span class="description">apply a callback function to elements in an input ndarray and assign results to elements in an output ndarray.</span>
- <span class="signature">[`maxViewBufferIndex( shape, strides, offset )`][@stdlib/ndarray/base/max-view-buffer-index]</span><span class="delimiter">: </span><span class="description">compute the maximum linear index in an underlying data buffer accessible to an array view.</span>
- <span class="signature">[`maybeBroadcastArray( arr, shape )`][@stdlib/ndarray/base/maybe-broadcast-array]</span><span class="delimiter">: </span><span class="description">broadcast an ndarray to a specified shape if and only if the specified shape differs from the provided ndarray's shape.</span>
- <span class="signature">[`maybeBroadcastArrays( arrays )`][@stdlib/ndarray/base/maybe-broadcast-arrays]</span><span class="delimiter">: </span><span class="description">broadcast ndarrays to a common shape.</span>
- <span class="signature">[`metaDataProps( meta, dtypes, obj )`][@stdlib/ndarray/base/meta-data-props]</span><span class="delimiter">: </span><span class="description">define non-enumerable read-only properties which expose ndarray function meta data.</span>
- <span class="signature">[`minSignedIntegerDataType( value )`][@stdlib/ndarray/base/min-signed-integer-dtype]</span><span class="delimiter">: </span><span class="description">determine the minimum ndarray data type for storing a provided signed integer value.</span>
- <span class="signature">[`minUnsignedIntegerDataType( value )`][@stdlib/ndarray/base/min-unsigned-integer-dtype]</span><span class="delimiter">: </span><span class="description">determine the minimum ndarray data type for storing a provided unsigned integer value.</span>
- <span class="signature">[`minViewBufferIndex( shape, strides, offset )`][@stdlib/ndarray/base/min-view-buffer-index]</span><span class="delimiter">: </span><span class="description">compute the minimum linear index in an underlying data buffer accessible to an array view.</span>
- <span class="signature">[`minmaxViewBufferIndex( shape, strides, offset )`][@stdlib/ndarray/base/minmax-view-buffer-index]</span><span class="delimiter">: </span><span class="description">compute the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view.</span>
- <span class="signature">[`ndarraylike2ndarray( x )`][@stdlib/ndarray/base/ndarraylike2ndarray]</span><span class="delimiter">: </span><span class="description">convert an ndarray-like object to an `ndarray`.</span>
Expand Down Expand Up @@ -125,6 +129,7 @@ var o = ns;
- <span class="signature">[`strides2order( strides )`][@stdlib/ndarray/base/strides2order]</span><span class="delimiter">: </span><span class="description">determine the order of a multidimensional array based on a provided stride array.</span>
- <span class="signature">[`sub2ind( shape, strides, offset, ...subscripts, mode )`][@stdlib/ndarray/base/sub2ind]</span><span class="delimiter">: </span><span class="description">convert subscripts to a linear index.</span>
- <span class="signature">[`ndarray2array( buffer, shape, strides, offset, order )`][@stdlib/ndarray/base/to-array]</span><span class="delimiter">: </span><span class="description">convert an ndarray buffer to a generic array.</span>
- <span class="signature">[`toReversed( x )`][@stdlib/ndarray/base/to-reversed]</span><span class="delimiter">: </span><span class="description">return a new ndarray where the order of elements of an input ndarray is reversed along each dimension.</span>
- <span class="signature">[`transpose( x )`][@stdlib/ndarray/base/transpose]</span><span class="delimiter">: </span><span class="description">transpose a matrix (or a stack of matrices).</span>
- <span class="signature">[`unaryBy( arrays, fcn, clbk[, thisArg] )`][@stdlib/ndarray/base/unary-by]</span><span class="delimiter">: </span><span class="description">apply a unary function to each element in an input ndarray according to a callback function and assign results to elements in an output ndarray.</span>
- <span class="signature">[`unaryLoopOrder( shape, stridesX, stridesY )`][@stdlib/ndarray/base/unary-loop-interchange-order]</span><span class="delimiter">: </span><span class="description">reorder ndarray dimensions and associated strides for loop interchange.</span>
Expand Down Expand Up @@ -249,6 +254,8 @@ console.log( objectKeys( ns ) );

[@stdlib/ndarray/base/expand-dimensions]: https://github.com/stdlib-js/ndarray/tree/main/base/expand-dimensions

[@stdlib/ndarray/base/fill]: https://github.com/stdlib-js/ndarray/tree/main/base/fill

[@stdlib/ndarray/base/flag]: https://github.com/stdlib-js/ndarray/tree/main/base/flag

[@stdlib/ndarray/base/flags]: https://github.com/stdlib-js/ndarray/tree/main/base/flags
Expand All @@ -267,6 +274,8 @@ console.log( objectKeys( ns ) );

[@stdlib/ndarray/base/iteration-order]: https://github.com/stdlib-js/ndarray/tree/main/base/iteration-order

[@stdlib/ndarray/base/map]: https://github.com/stdlib-js/ndarray/tree/main/base/map

[@stdlib/ndarray/base/max-view-buffer-index]: https://github.com/stdlib-js/ndarray/tree/main/base/max-view-buffer-index

[@stdlib/ndarray/base/maybe-broadcast-array]: https://github.com/stdlib-js/ndarray/tree/main/base/maybe-broadcast-array
Expand All @@ -275,6 +284,10 @@ console.log( objectKeys( ns ) );

[@stdlib/ndarray/base/meta-data-props]: https://github.com/stdlib-js/ndarray/tree/main/base/meta-data-props

[@stdlib/ndarray/base/min-signed-integer-dtype]: https://github.com/stdlib-js/ndarray/tree/main/base/min-signed-integer-dtype

[@stdlib/ndarray/base/min-unsigned-integer-dtype]: https://github.com/stdlib-js/ndarray/tree/main/base/min-unsigned-integer-dtype

[@stdlib/ndarray/base/min-view-buffer-index]: https://github.com/stdlib-js/ndarray/tree/main/base/min-view-buffer-index

[@stdlib/ndarray/base/minmax-view-buffer-index]: https://github.com/stdlib-js/ndarray/tree/main/base/minmax-view-buffer-index
Expand Down Expand Up @@ -355,6 +368,8 @@ console.log( objectKeys( ns ) );

[@stdlib/ndarray/base/to-array]: https://github.com/stdlib-js/ndarray/tree/main/base/to-array

[@stdlib/ndarray/base/to-reversed]: https://github.com/stdlib-js/ndarray/tree/main/base/to-reversed

[@stdlib/ndarray/base/transpose]: https://github.com/stdlib-js/ndarray/tree/main/base/transpose

[@stdlib/ndarray/base/unary-by]: https://github.com/stdlib-js/ndarray/tree/main/base/unary-by
Expand Down
155 changes: 155 additions & 0 deletions base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import dtypes2signatures = require( './../../../base/dtypes2signatures' );
import empty = require( './../../../base/empty' );
import emptyLike = require( './../../../base/empty-like' );
import expandDimensions = require( './../../../base/expand-dimensions' );
import fill = require( './../../../base/fill' );
import flag = require( './../../../base/flag' );
import flags = require( './../../../base/flags' );
import fliplr = require( './../../../base/fliplr' );
Expand All @@ -59,10 +60,13 @@ import scalar2ndarray = require( './../../../base/from-scalar' );
import ind = require( './../../../base/ind' );
import ind2sub = require( './../../../base/ind2sub' );
import iterationOrder = require( './../../../base/iteration-order' );
import map = require( './../../../base/map' );
import maxViewBufferIndex = require( './../../../base/max-view-buffer-index' );
import maybeBroadcastArray = require( './../../../base/maybe-broadcast-array' );
import maybeBroadcastArrays = require( './../../../base/maybe-broadcast-arrays' );
import metaDataProps = require( './../../../base/meta-data-props' );
import minSignedIntegerDataType = require( './../../../base/min-signed-integer-dtype' );
import minUnsignedIntegerDataType = require( './../../../base/min-unsigned-integer-dtype' );
import minViewBufferIndex = require( './../../../base/min-view-buffer-index' );
import minmaxViewBufferIndex = require( './../../../base/minmax-view-buffer-index' );
import ndarraylike2ndarray = require( './../../../base/ndarraylike2ndarray' );
Expand Down Expand Up @@ -103,6 +107,7 @@ import strides2offset = require( './../../../base/strides2offset' );
import strides2order = require( './../../../base/strides2order' );
import sub2ind = require( './../../../base/sub2ind' );
import ndarray2array = require( './../../../base/to-array' );
import toReversed = require( './../../../base/to-reversed' );
import transpose = require( './../../../base/transpose' );
import unary = require( './../../../base/unary' );
import unaryBy = require( './../../../base/unary-by' );
Expand Down Expand Up @@ -938,6 +943,44 @@ interface Namespace {
*/
expandDimensions: typeof expandDimensions;

/**
* Fills an input ndarray with a specified value.
*
* @param x - input ndarray
* @param value - scalar value
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* // Create a data buffer:
* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
*
* // Define the shape of the input array:
* var shape = [ 3, 1, 2 ];
*
* // Define the array strides:
* var sx = [ 2, 2, 1 ];
*
* // Define the index offset:
* var ox = 0;
*
* // Create the input ndarray-like object:
* var x = {
* 'dtype': 'float64',
* 'data': xbuf,
* 'shape': shape,
* 'strides': sx,
* 'offset': ox,
* 'order': 'row-major'
* };
*
* ns.fill( x, 10.0 );
*
* console.log( x.data );
* // => <Float64Array>[ 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 ]
*/
fill: typeof fill;

/**
* Returns a specified flag for a provided ndarray.
*
Expand Down Expand Up @@ -1291,6 +1334,50 @@ interface Namespace {
*/
iterationOrder: typeof iterationOrder;

/**
* Applies a callback function to the elements in an input ndarray and assigns results to the elements in an output ndarray.
*
* @param arrays - array-like object containing one input ndarray and one output ndarray
* @param fcn - callback function
* @param thisArg - callback function execution context
* @throws arrays must have the same number of dimensions
* @throws arrays must have the same shape
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var ndarray = require( './../../../ctor' );
*
* function scale( x ) {
* return x * 10.0;
* }
*
* // Create data buffers:
* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
* var ybuf = new Float64Array( 6 );
*
* // Define the shape of the input and output arrays:
* var shape = [ 3, 1, 2 ];
*
* // Define the array strides:
* var sx = [ 4, 4, 1 ];
* var sy = [ 2, 2, 1 ];
*
* // Define the index offsets:
* var ox = 1;
* var oy = 0;
*
* // Create the input and output ndarrays:
* var x = ndarray( 'float64', xbuf, shape, sx, ox, 'row-major' );
* var y = ndarray( 'float64', ybuf, shape, sy, oy, 'row-major' );
*
* // Apply the ns.map function:
* ns.map( [ x, y ], scale );
*
* console.log( y.data );
* // => <Float64Array>[ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]
*/
map: typeof map;

/**
* Computes the maximum linear index in an underlying data buffer accessible to an array view.
*
Expand Down Expand Up @@ -1484,6 +1571,38 @@ interface Namespace {
*/
metaDataProps: typeof metaDataProps;

/**
* Returns the minimum ndarray data type for storing a provided signed integer value.
*
* @param value - scalar value
* @returns ndarray data type
*
* @example
* var dt = ns.minSignedIntegerDataType( 1280 );
* // returns 'int16'
*
* @example
* var dt = ns.minSignedIntegerDataType( 3 );
* // returns 'int8'
*/
minSignedIntegerDataType: typeof minSignedIntegerDataType;

/**
* Returns the minimum ndarray data type for storing a provided unsigned integer value.
*
* @param value - scalar value
* @returns ndarray data type
*
* @example
* var dt = ns.minUnsignedIntegerDataType( 1280 );
* // returns 'uint16'
*
* @example
* var dt = ns.minUnsignedIntegerDataType( 3 );
* // returns 'uint8'
*/
minUnsignedIntegerDataType: typeof minUnsignedIntegerDataType;

/**
* Computes the minimum linear index in an underlying data buffer accessible to an array view.
*
Expand Down Expand Up @@ -2718,6 +2837,42 @@ interface Namespace {
*/
ndarray2array: typeof ndarray2array;

/**
* Returns a new ndarray where the order of elements of an input ndarray is reversed along each dimension.
*
* @param x - input array
* @returns output array
*
* @example
* var typedarray = require( '@stdlib/array/typed' );
* var ndarray = require( './../../../ctor' );
* var ndarray2array = require( './../../../to-array' );
*
* var buffer = typedarray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], 'float64' );
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );
* // returns <ndarray>
*
* var sh = x.shape;
* // returns [ 3, 2 ]
*
* var arr = ndarray2array( x );
* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
*
* var y = ns.toReversed( x );
* // returns <ndarray>
*
* sh = y.shape;
* // returns [ 3, 2 ]
*
* arr = ndarray2array( y );
* // returns [ [ 6.0, 5.0 ], [ 4.0, 3.0 ], [ 2.0, 1.0 ] ]
*/
toReversed: typeof toReversed;

/**
* Transposes a matrix (or a stack of matrices).
*
Expand Down

0 comments on commit 8b71ded

Please sign in to comment.