From 09a6d4883b336c14d6f9c3bcfafe4732bdc8e2aa Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Wed, 29 Apr 2026 03:16:50 +0000 Subject: [PATCH] feat: update `blas/ext` TypeScript declarations Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> --- .../@stdlib/blas/ext/docs/types/index.d.ts | 193 +++++++++++++----- 1 file changed, 141 insertions(+), 52 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/docs/types/index.d.ts index 8b96e61c9970..e9870943edfa 100644 --- a/lib/node_modules/@stdlib/blas/ext/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/docs/types/index.d.ts @@ -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' ); /** @@ -125,10 +129,7 @@ interface Namespace { * var x = array( [ -1.0, 2.0, -3.0 ] ); * * var y = ns.findIndex( x, clbk ); - * // returns - * - * var v = y.get(); - * // returns 1 + * // returns [ 1 ] * * @example * var array = require( '@stdlib/ndarray/array' ); @@ -142,10 +143,7 @@ interface Namespace { * var y = zeros( [] ); * * var out = ns.findIndex.assign( x, y, clbk ); - * // returns - * - * var v = out.get(); - * // returns 1 + * // returns [ 1 ] * * var bool = ( out === y ); * // returns true @@ -222,10 +220,7 @@ interface Namespace { * var x = array( [ -1.0, 2.0, -3.0 ] ); * * var y = ns.indexOf( x, 2.0, 0 ); - * // returns - * - * var idx = y.get(); - * // returns 1 + * // returns [ 1 ] * * @example * var zeros = require( '@stdlib/ndarray/zeros' ); @@ -237,13 +232,10 @@ interface Namespace { * } ); * * var out = ns.indexOf.assign( x, 2.0, 2, y ); - * // returns + * // returns [ 3 ] * * var bool = ( out === y ); * // returns true - * - * var idx = out.get(); - * // returns 3 */ indexOf: typeof indexOf; @@ -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 - * - * var idx = y.get(); - * // returns 3 + * // returns [ 3 ] * * @example * var zeros = require( '@stdlib/ndarray/zeros' ); @@ -316,13 +305,10 @@ interface Namespace { * } ); * * var out = ns.lastIndexOf.assign( x, 2.0, y ); - * // returns + * // returns [ 3 ] * * var bool = ( out === y ); * // returns true - * - * var idx = out.get(); - * // returns 3 */ lastIndexOf: typeof lastIndexOf; @@ -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 [ [ 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 [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] + * + * var out = ns.oneTo.assign( x ); + * // returns [ [ 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 [ -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 [ -3.0, -1.0, 2.0 ] + */ + sort: typeof sort; + /** * Sorts an input ndarray along one or more ndarray dimensions using heapsort. * @@ -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 - * - * var arr = ndarray2array( y ); - * // returns [ -3.0, -1.0, 2.0 ] + * // returns [ -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 - * - * var arr = ndarray2array( y ); - * // returns [ -3.0, -1.0, 2.0 ] + * // returns [ -3.0, -1.0, 2.0 ] */ sorthp: typeof sorthp; @@ -409,10 +445,7 @@ interface Namespace { * var x = array( [ -1.0, 2.0, -3.0 ] ); * * var y = ns.sum( x ); - * // returns - * - * var v = y.get(); - * // returns -2.0 + * // returns [ -2.0 ] * * @example * var array = require( '@stdlib/ndarray/array' ); @@ -422,16 +455,54 @@ interface Namespace { * var y = zeros( [] ); * * var out = ns.sum.assign( x, y ); - * // returns - * - * var v = out.get(); - * // returns -2.0 + * // returns [ -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 [ [ [ 1.0, 2.0 ] ], [ [ -3.0, 4.0 ] ], [ [ -5.0, 6.0 ] ] ] + * + * var out = ns.toSorted( x, 1.0 ); + * // returns [ [ [ -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 [ [ [ 1.0, 2.0 ] ], [ [ -3.0, 4.0 ] ], [ [ -5.0, 6.0 ] ] ] + * + * var y = zeros( [ 3, 1, 2 ] ); + * // returns [ [ [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ] ] ] + * + * var out = ns.toSorted.assign( x, y ); + * // returns [ [ [ -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. * @@ -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 - * - * var arr = ndarray2array( y ); - * // returns [ -3.0, -1.0, 2.0 ] + * // returns [ -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' ); * @@ -470,16 +536,39 @@ interface Namespace { * var y = zeros( [ 3 ] ); * * var out = ns.toSortedhp.assign( x, y ); - * // returns - * - * var arr = ndarray2array( out ); - * // returns [ -3.0, -1.0, 2.0 ] + * // returns [ -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 [ [ 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 [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] + * + * var out = ns.unitspace.assign( x, 1.0 ); + * // returns [ [ 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. *