Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import dtypeStrings = require( '@stdlib/ndarray/base/dtype-strings' );
import dtype2c = require( '@stdlib/ndarray/base/dtype2c' );
import dtypes2enums = require( '@stdlib/ndarray/base/dtypes2enums' );
import dtypes2signatures = require( '@stdlib/ndarray/base/dtypes2signatures' );
import dtypes2strings = require( '@stdlib/ndarray/base/dtypes2strings' );
import empty = require( '@stdlib/ndarray/base/empty' );
import emptyLike = require( '@stdlib/ndarray/base/empty-like' );
import every = require( '@stdlib/ndarray/base/every' );
Expand Down Expand Up @@ -147,8 +148,11 @@ import strides2offset = require( '@stdlib/ndarray/base/strides2offset' );
import strides2order = require( '@stdlib/ndarray/base/strides2order' );
import sub2ind = require( '@stdlib/ndarray/base/sub2ind' );
import ndarray2array = require( '@stdlib/ndarray/base/to-array' );
import toFlippedlr = require( '@stdlib/ndarray/base/to-flippedlr' );
import toFlippedud = require( '@stdlib/ndarray/base/to-flippedud' );
import toNormalizedIndices = require( '@stdlib/ndarray/base/to-normalized-indices' );
import toReversed = require( '@stdlib/ndarray/base/to-reversed' );
import toReversedDimension = require( '@stdlib/ndarray/base/to-reversed-dimension' );
import toUniqueNormalizedIndices = require( '@stdlib/ndarray/base/to-unique-normalized-indices' );
import transpose = require( '@stdlib/ndarray/base/transpose' );
import unary = require( '@stdlib/ndarray/base/unary' );
Expand Down Expand Up @@ -1434,6 +1438,26 @@ interface Namespace {
*/
dtypes2signatures: typeof dtypes2signatures;

/**
* Resolves a list of data type strings.
*
* ## Notes
*
* - If the function is unable to resolve a data type string for a provided data type, the corresponding element in the returned array will be `null`.
*
* @param dtypes - list of data types
* @returns results
*
* @example
* var out = ns.dtypes2strings( [ 'float32', 'float64' ] );
* // returns [...]
*
* @example
* var out = ns.dtypes2strings( [ 'foo', 'bar' ] );
* // returns [ null, null ]
*/
dtypes2strings: typeof dtypes2strings;

/**
* Creates an uninitialized array having a specified shape and data type.
*
Expand Down Expand Up @@ -4105,6 +4129,78 @@ interface Namespace {
*/
ndarray2array: typeof ndarray2array;

/**
* Returns a new ndarray where the order of elements along the last dimension of an input ndarray is reversed.
*
* @param x - input array
* @returns output array
*
* @example
* var typedarray = require( '@stdlib/array/typed' );
* var ndarray = require( '@stdlib/ndarray/ctor' );
* var ndarray2array = require( '@stdlib/ndarray/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.toFlippedlr( x );
* // returns <ndarray>
*
* sh = y.shape;
* // returns [ 3, 2 ]
*
* arr = ndarray2array( y );
* // returns [ [ 2.0, 1.0 ], [ 4.0, 3.0 ], [ 6.0, 5.0 ] ]
*/
toFlippedlr: typeof toFlippedlr;

/**
* Returns a new ndarray where the order of elements along the second-to-last dimension of an input ndarray is reversed.
*
* @param x - input array
* @returns output array
*
* @example
* var typedarray = require( '@stdlib/array/typed' );
* var ndarray = require( '@stdlib/ndarray/ctor' );
* var ndarray2array = require( '@stdlib/ndarray/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.toFlippedud( x );
* // returns <ndarray>
*
* sh = y.shape;
* // returns [ 3, 2 ]
*
* arr = ndarray2array( y );
* // returns [ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
*/
toFlippedud: typeof toFlippedud;

/**
* Normalizes a list of indices to the interval `[0,max]`.
*
Expand Down Expand Up @@ -4161,6 +4257,43 @@ interface Namespace {
*/
toReversed: typeof toReversed;

/**
* Returns a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed.
*
* @param x - input array
* @param dim - index of dimension to reverse
* @returns output array
*
* @example
* var typedarray = require( '@stdlib/array/typed' );
* var ndarray = require( '@stdlib/ndarray/ctor' );
* var ndarray2array = require( '@stdlib/ndarray/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.toReversedDimension( x, 0 );
* // returns <ndarray>
*
* sh = y.shape;
* // returns [ 3, 2 ]
*
* arr = ndarray2array( y );
* // returns [ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
*/
toReversedDimension: typeof toReversedDimension;

/**
* Returns a list of unique indices after normalizing to the interval `[0,max]`.
*
Expand Down