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
193 changes: 141 additions & 52 deletions lib/node_modules/@stdlib/blas/ext/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ import indexOf = require( '@stdlib/blas/ext/index-of' );
import join = require( '@stdlib/blas/ext/join' );
import lastIndexOf = require( '@stdlib/blas/ext/last-index-of' );
import linspace = require( '@stdlib/blas/ext/linspace' );
import oneTo = require( '@stdlib/blas/ext/one-to' );
import sort = require( '@stdlib/blas/ext/sort' );
import sorthp = require( '@stdlib/blas/ext/sorthp' );
import sum = require( '@stdlib/blas/ext/sum' );
import toSorted = require( '@stdlib/blas/ext/to-sorted' );
import toSortedhp = require( '@stdlib/blas/ext/to-sortedhp' );
import unitspace = require( '@stdlib/blas/ext/unitspace' );
import zeroTo = require( '@stdlib/blas/ext/zero-to' );

/**
Expand Down Expand Up @@ -125,10 +129,7 @@ interface Namespace {
* var x = array( [ -1.0, 2.0, -3.0 ] );
*
* var y = ns.findIndex( x, clbk );
* // returns <ndarray>
*
* var v = y.get();
* // returns 1
* // returns <ndarray>[ 1 ]
*
* @example
* var array = require( '@stdlib/ndarray/array' );
Expand All @@ -142,10 +143,7 @@ interface Namespace {
* var y = zeros( [] );
*
* var out = ns.findIndex.assign( x, y, clbk );
* // returns <ndarray>
*
* var v = out.get();
* // returns 1
* // returns <ndarray>[ 1 ]
*
* var bool = ( out === y );
* // returns true
Expand Down Expand Up @@ -222,10 +220,7 @@ interface Namespace {
* var x = array( [ -1.0, 2.0, -3.0 ] );
*
* var y = ns.indexOf( x, 2.0, 0 );
* // returns <ndarray>
*
* var idx = y.get();
* // returns 1
* // returns <ndarray>[ 1 ]
*
* @example
* var zeros = require( '@stdlib/ndarray/zeros' );
Expand All @@ -237,13 +232,10 @@ interface Namespace {
* } );
*
* var out = ns.indexOf.assign( x, 2.0, 2, y );
* // returns <ndarray>
* // returns <ndarray>[ 3 ]
*
* var bool = ( out === y );
* // returns true
*
* var idx = out.get();
* // returns 3
*/
indexOf: typeof indexOf;

Expand Down Expand Up @@ -301,10 +293,7 @@ interface Namespace {
* var x = array( [ -1.0, 2.0, -3.0, 2.0 ] );
*
* var y = ns.lastIndexOf( x, 2.0 );
* // returns <ndarray>
*
* var idx = y.get();
* // returns 3
* // returns <ndarray>[ 3 ]
*
* @example
* var zeros = require( '@stdlib/ndarray/zeros' );
Expand All @@ -316,13 +305,10 @@ interface Namespace {
* } );
*
* var out = ns.lastIndexOf.assign( x, 2.0, y );
* // returns <ndarray>
* // returns <ndarray>[ 3 ]
*
* var bool = ( out === y );
* // returns true
*
* var idx = out.get();
* // returns 3
*/
lastIndexOf: typeof lastIndexOf;

Expand Down Expand Up @@ -353,6 +339,64 @@ interface Namespace {
*/
linspace: typeof linspace;

/**
* Returns a new ndarray filled with linearly spaced numeric elements which increment by 1 starting from one along one or more ndarray dimensions.
*
* @param shape - array shape
* @param options - function options
* @returns output ndarray
*
* @example
* var out = ns.oneTo( [ 2, 3 ] );
* // returns <ndarray>[ [ 1.0, 2.0, 3.0 ], [ 1.0, 2.0, 3.0 ] ]
*
* @example
* var zeros = require( '@stdlib/ndarray/zeros' );
*
* var x = zeros( [ 2, 3 ] );
* // returns <ndarray>[ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ]
*
* var out = ns.oneTo.assign( x );
* // returns <ndarray>[ [ 1.0, 2.0, 3.0 ], [ 1.0, 2.0, 3.0 ] ]
*
* var bool = ( out === x );
* // returns true
*/
oneTo: typeof oneTo;

/**
* Sorts an input ndarray along one or more ndarray dimensions.
*
* ## Notes
*
* - The input ndarray is sorted **in-place** (i.e., the input ndarray is **mutated**).
* - If `sortOrder < 0.0` or is either `'desc'` or `'descending'`, the input ndarray is sorted in **decreasing** order. If `sortOrder > 0.0` or is either `'asc'` or `'ascending'`, the input ndarray is sorted in **increasing** order. If `sortOrder == 0.0`, the input ndarray is left unchanged.
* - The algorithm distinguishes between `-0` and `+0`. When sorted in increasing order, `-0` is sorted before `+0`. When sorted in decreasing order, `-0` is sorted after `+0`.
* - The algorithm sorts `NaN` values to the end. When sorted in increasing order, `NaN` values are sorted last. When sorted in decreasing order, `NaN` values are sorted first.
*
* @param x - input ndarray
* @param sortOrder - sort order
* @param options - function options
* @returns output ndarray
*
* @example
* var array = require( '@stdlib/ndarray/array' );
*
* var x = array( [ -1.0, 2.0, -3.0 ] );
*
* var y = ns.sort( x, 1.0 );
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
*
* @example
* var array = require( '@stdlib/ndarray/array' );
*
* var x = array( [ -1.0, 2.0, -3.0 ] );
*
* var y = ns.sort( x, 1.0 );
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
*/
sort: typeof sort;

/**
* Sorts an input ndarray along one or more ndarray dimensions using heapsort.
*
Expand All @@ -371,28 +415,20 @@ interface Namespace {
* @returns output ndarray
*
* @example
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
* var array = require( '@stdlib/ndarray/array' );
*
* var x = array( [ -1.0, 2.0, -3.0 ] );
*
* var y = ns.sorthp( x, 1.0 );
* // returns <ndarray>
*
* var arr = ndarray2array( y );
* // returns [ -3.0, -1.0, 2.0 ]
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
*
* @example
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
* var array = require( '@stdlib/ndarray/array' );
*
* var x = array( [ -1.0, 2.0, -3.0 ] );
*
* var y = ns.sorthp( x, 1.0 );
* // returns <ndarray>
*
* var arr = ndarray2array( y );
* // returns [ -3.0, -1.0, 2.0 ]
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
*/
sorthp: typeof sorthp;

Expand All @@ -409,10 +445,7 @@ interface Namespace {
* var x = array( [ -1.0, 2.0, -3.0 ] );
*
* var y = ns.sum( x );
* // returns <ndarray>
*
* var v = y.get();
* // returns -2.0
* // returns <ndarray>[ -2.0 ]
*
* @example
* var array = require( '@stdlib/ndarray/array' );
Expand All @@ -422,16 +455,54 @@ interface Namespace {
* var y = zeros( [] );
*
* var out = ns.sum.assign( x, y );
* // returns <ndarray>
*
* var v = out.get();
* // returns -2.0
* // returns <ndarray>[ -2.0 ]
*
* var bool = ( out === y );
* // returns true
*/
sum: typeof sum;

/**
* Returns a new ndarray with the elements of an input ndarray sorted along one or more ndarray dimensions.
*
* ## Notes
*
* - If `sortOrder < 0.0` or is either `'desc'` or `'descending'`, the input ndarray is sorted in **decreasing** order. If `sortOrder > 0.0` or is either `'asc'` or `'ascending'`, the input ndarray is sorted in **increasing** order. If `sortOrder == 0.0`, the input ndarray is left unchanged.
* - The algorithm distinguishes between `-0` and `+0`. When sorted in increasing order, `-0` is sorted before `+0`. When sorted in decreasing order, `-0` is sorted after `+0`.
* - The algorithm sorts `NaN` values to the end. When sorted in increasing order, `NaN` values are sorted last. When sorted in decreasing order, `NaN` values are sorted first.
*
* @param x - input ndarray
* @param sortOrder - sort order
* @param options - function options
* @returns output ndarray
*
* @example
* var array = require( '@stdlib/ndarray/array' );
*
* var x = array( [ [ [ 1.0, 2.0 ] ], [ [ -3.0, 4.0 ] ], [ [ -5.0, 6.0 ] ] ] );
* // returns <ndarray>[ [ [ 1.0, 2.0 ] ], [ [ -3.0, 4.0 ] ], [ [ -5.0, 6.0 ] ] ]
*
* var out = ns.toSorted( x, 1.0 );
* // returns <ndarray>[ [ [ -5.0, -3.0 ] ], [ [ 1.0, 2.0 ] ], [ [ 4.0, 6.0 ] ] ]
*
* @example
* var zeros = require( '@stdlib/ndarray/zeros' );
* var array = require( '@stdlib/ndarray/array' );
*
* var x = array( [ [ [ 1.0, 2.0 ] ], [ [ -3.0, 4.0 ] ], [ [ -5.0, 6.0 ] ] ] );
* // returns <ndarray>[ [ [ 1.0, 2.0 ] ], [ [ -3.0, 4.0 ] ], [ [ -5.0, 6.0 ] ] ]
*
* var y = zeros( [ 3, 1, 2 ] );
* // returns <ndarray>[ [ [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ] ] ]
*
* var out = ns.toSorted.assign( x, y );
* // returns <ndarray>[ [ [ -5.0, -3.0 ] ], [ [ 1.0, 2.0 ] ], [ [ 4.0, 6.0 ] ] ]
*
* var bool = ( out === y );
* // returns true
*/
toSorted: typeof toSorted;

/**
* Returns a new ndarray with the elements of an input ndarray sorted along one or more ndarray dimensions using heapsort.
*
Expand All @@ -449,19 +520,14 @@ interface Namespace {
* @returns output ndarray
*
* @example
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
* var array = require( '@stdlib/ndarray/array' );
*
* var x = array( [ -1.0, 2.0, -3.0 ] );
*
* var y = ns.toSortedhp( x, 1.0 );
* // returns <ndarray>
*
* var arr = ndarray2array( y );
* // returns [ -3.0, -1.0, 2.0 ]
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
*
* @example
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
* var zeros = require( '@stdlib/ndarray/zeros' );
* var array = require( '@stdlib/ndarray/array' );
*
Expand All @@ -470,16 +536,39 @@ interface Namespace {
* var y = zeros( [ 3 ] );
*
* var out = ns.toSortedhp.assign( x, y );
* // returns <ndarray>
*
* var arr = ndarray2array( out );
* // returns [ -3.0, -1.0, 2.0 ]
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
*
* var bool = ( out === y );
* // returns true
*/
toSortedhp: typeof toSortedhp;

/**
* Returns a new ndarray filled with linearly spaced numeric elements which increment by 1 starting from a specified value along one or more ndarray dimensions.
*
* @param shape - array shape
* @param start - starting value
* @param options - function options
* @returns output ndarray
*
* @example
* var out = ns.unitspace( [ 2, 3 ], 1.0 );
* // returns <ndarray>[ [ 1.0, 2.0, 3.0 ], [ 1.0, 2.0, 3.0 ] ]
*
* @example
* var zeros = require( '@stdlib/ndarray/zeros' );
*
* var x = zeros( [ 2, 3 ] );
* // returns <ndarray>[ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ]
*
* var out = ns.unitspace.assign( x, 1.0 );
* // returns <ndarray>[ [ 1.0, 2.0, 3.0 ], [ 1.0, 2.0, 3.0 ] ]
*
* var bool = ( out === x );
* // returns true
*/
unitspace: typeof unitspace;

/**
* Returns a new ndarray filled with linearly spaced numeric elements which increment by 1 starting from zero along one or more ndarray dimensions.
*
Expand Down