Skip to content

Commit 6832211

Browse files
authored
feat: update blas/ext TypeScript declarations
PR-URL: #11833 Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent 52dd2b8 commit 6832211

1 file changed

Lines changed: 141 additions & 52 deletions

File tree

  • lib/node_modules/@stdlib/blas/ext/docs/types

lib/node_modules/@stdlib/blas/ext/docs/types/index.d.ts

Lines changed: 141 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ import indexOf = require( '@stdlib/blas/ext/index-of' );
2929
import join = require( '@stdlib/blas/ext/join' );
3030
import lastIndexOf = require( '@stdlib/blas/ext/last-index-of' );
3131
import linspace = require( '@stdlib/blas/ext/linspace' );
32+
import oneTo = require( '@stdlib/blas/ext/one-to' );
33+
import sort = require( '@stdlib/blas/ext/sort' );
3234
import sorthp = require( '@stdlib/blas/ext/sorthp' );
3335
import sum = require( '@stdlib/blas/ext/sum' );
36+
import toSorted = require( '@stdlib/blas/ext/to-sorted' );
3437
import toSortedhp = require( '@stdlib/blas/ext/to-sortedhp' );
38+
import unitspace = require( '@stdlib/blas/ext/unitspace' );
3539
import zeroTo = require( '@stdlib/blas/ext/zero-to' );
3640

3741
/**
@@ -125,10 +129,7 @@ interface Namespace {
125129
* var x = array( [ -1.0, 2.0, -3.0 ] );
126130
*
127131
* var y = ns.findIndex( x, clbk );
128-
* // returns <ndarray>
129-
*
130-
* var v = y.get();
131-
* // returns 1
132+
* // returns <ndarray>[ 1 ]
132133
*
133134
* @example
134135
* var array = require( '@stdlib/ndarray/array' );
@@ -142,10 +143,7 @@ interface Namespace {
142143
* var y = zeros( [] );
143144
*
144145
* var out = ns.findIndex.assign( x, y, clbk );
145-
* // returns <ndarray>
146-
*
147-
* var v = out.get();
148-
* // returns 1
146+
* // returns <ndarray>[ 1 ]
149147
*
150148
* var bool = ( out === y );
151149
* // returns true
@@ -222,10 +220,7 @@ interface Namespace {
222220
* var x = array( [ -1.0, 2.0, -3.0 ] );
223221
*
224222
* var y = ns.indexOf( x, 2.0, 0 );
225-
* // returns <ndarray>
226-
*
227-
* var idx = y.get();
228-
* // returns 1
223+
* // returns <ndarray>[ 1 ]
229224
*
230225
* @example
231226
* var zeros = require( '@stdlib/ndarray/zeros' );
@@ -237,13 +232,10 @@ interface Namespace {
237232
* } );
238233
*
239234
* var out = ns.indexOf.assign( x, 2.0, 2, y );
240-
* // returns <ndarray>
235+
* // returns <ndarray>[ 3 ]
241236
*
242237
* var bool = ( out === y );
243238
* // returns true
244-
*
245-
* var idx = out.get();
246-
* // returns 3
247239
*/
248240
indexOf: typeof indexOf;
249241

@@ -301,10 +293,7 @@ interface Namespace {
301293
* var x = array( [ -1.0, 2.0, -3.0, 2.0 ] );
302294
*
303295
* var y = ns.lastIndexOf( x, 2.0 );
304-
* // returns <ndarray>
305-
*
306-
* var idx = y.get();
307-
* // returns 3
296+
* // returns <ndarray>[ 3 ]
308297
*
309298
* @example
310299
* var zeros = require( '@stdlib/ndarray/zeros' );
@@ -316,13 +305,10 @@ interface Namespace {
316305
* } );
317306
*
318307
* var out = ns.lastIndexOf.assign( x, 2.0, y );
319-
* // returns <ndarray>
308+
* // returns <ndarray>[ 3 ]
320309
*
321310
* var bool = ( out === y );
322311
* // returns true
323-
*
324-
* var idx = out.get();
325-
* // returns 3
326312
*/
327313
lastIndexOf: typeof lastIndexOf;
328314

@@ -353,6 +339,64 @@ interface Namespace {
353339
*/
354340
linspace: typeof linspace;
355341

342+
/**
343+
* Returns a new ndarray filled with linearly spaced numeric elements which increment by 1 starting from one along one or more ndarray dimensions.
344+
*
345+
* @param shape - array shape
346+
* @param options - function options
347+
* @returns output ndarray
348+
*
349+
* @example
350+
* var out = ns.oneTo( [ 2, 3 ] );
351+
* // returns <ndarray>[ [ 1.0, 2.0, 3.0 ], [ 1.0, 2.0, 3.0 ] ]
352+
*
353+
* @example
354+
* var zeros = require( '@stdlib/ndarray/zeros' );
355+
*
356+
* var x = zeros( [ 2, 3 ] );
357+
* // returns <ndarray>[ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ]
358+
*
359+
* var out = ns.oneTo.assign( x );
360+
* // returns <ndarray>[ [ 1.0, 2.0, 3.0 ], [ 1.0, 2.0, 3.0 ] ]
361+
*
362+
* var bool = ( out === x );
363+
* // returns true
364+
*/
365+
oneTo: typeof oneTo;
366+
367+
/**
368+
* Sorts an input ndarray along one or more ndarray dimensions.
369+
*
370+
* ## Notes
371+
*
372+
* - The input ndarray is sorted **in-place** (i.e., the input ndarray is **mutated**).
373+
* - 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.
374+
* - 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`.
375+
* - 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.
376+
*
377+
* @param x - input ndarray
378+
* @param sortOrder - sort order
379+
* @param options - function options
380+
* @returns output ndarray
381+
*
382+
* @example
383+
* var array = require( '@stdlib/ndarray/array' );
384+
*
385+
* var x = array( [ -1.0, 2.0, -3.0 ] );
386+
*
387+
* var y = ns.sort( x, 1.0 );
388+
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
389+
*
390+
* @example
391+
* var array = require( '@stdlib/ndarray/array' );
392+
*
393+
* var x = array( [ -1.0, 2.0, -3.0 ] );
394+
*
395+
* var y = ns.sort( x, 1.0 );
396+
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
397+
*/
398+
sort: typeof sort;
399+
356400
/**
357401
* Sorts an input ndarray along one or more ndarray dimensions using heapsort.
358402
*
@@ -371,28 +415,20 @@ interface Namespace {
371415
* @returns output ndarray
372416
*
373417
* @example
374-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
375418
* var array = require( '@stdlib/ndarray/array' );
376419
*
377420
* var x = array( [ -1.0, 2.0, -3.0 ] );
378421
*
379422
* var y = ns.sorthp( x, 1.0 );
380-
* // returns <ndarray>
381-
*
382-
* var arr = ndarray2array( y );
383-
* // returns [ -3.0, -1.0, 2.0 ]
423+
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
384424
*
385425
* @example
386-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
387426
* var array = require( '@stdlib/ndarray/array' );
388427
*
389428
* var x = array( [ -1.0, 2.0, -3.0 ] );
390429
*
391430
* var y = ns.sorthp( x, 1.0 );
392-
* // returns <ndarray>
393-
*
394-
* var arr = ndarray2array( y );
395-
* // returns [ -3.0, -1.0, 2.0 ]
431+
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
396432
*/
397433
sorthp: typeof sorthp;
398434

@@ -409,10 +445,7 @@ interface Namespace {
409445
* var x = array( [ -1.0, 2.0, -3.0 ] );
410446
*
411447
* var y = ns.sum( x );
412-
* // returns <ndarray>
413-
*
414-
* var v = y.get();
415-
* // returns -2.0
448+
* // returns <ndarray>[ -2.0 ]
416449
*
417450
* @example
418451
* var array = require( '@stdlib/ndarray/array' );
@@ -422,16 +455,54 @@ interface Namespace {
422455
* var y = zeros( [] );
423456
*
424457
* var out = ns.sum.assign( x, y );
425-
* // returns <ndarray>
426-
*
427-
* var v = out.get();
428-
* // returns -2.0
458+
* // returns <ndarray>[ -2.0 ]
429459
*
430460
* var bool = ( out === y );
431461
* // returns true
432462
*/
433463
sum: typeof sum;
434464

465+
/**
466+
* Returns a new ndarray with the elements of an input ndarray sorted along one or more ndarray dimensions.
467+
*
468+
* ## Notes
469+
*
470+
* - 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.
471+
* - 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`.
472+
* - 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.
473+
*
474+
* @param x - input ndarray
475+
* @param sortOrder - sort order
476+
* @param options - function options
477+
* @returns output ndarray
478+
*
479+
* @example
480+
* var array = require( '@stdlib/ndarray/array' );
481+
*
482+
* var x = array( [ [ [ 1.0, 2.0 ] ], [ [ -3.0, 4.0 ] ], [ [ -5.0, 6.0 ] ] ] );
483+
* // returns <ndarray>[ [ [ 1.0, 2.0 ] ], [ [ -3.0, 4.0 ] ], [ [ -5.0, 6.0 ] ] ]
484+
*
485+
* var out = ns.toSorted( x, 1.0 );
486+
* // returns <ndarray>[ [ [ -5.0, -3.0 ] ], [ [ 1.0, 2.0 ] ], [ [ 4.0, 6.0 ] ] ]
487+
*
488+
* @example
489+
* var zeros = require( '@stdlib/ndarray/zeros' );
490+
* var array = require( '@stdlib/ndarray/array' );
491+
*
492+
* var x = array( [ [ [ 1.0, 2.0 ] ], [ [ -3.0, 4.0 ] ], [ [ -5.0, 6.0 ] ] ] );
493+
* // returns <ndarray>[ [ [ 1.0, 2.0 ] ], [ [ -3.0, 4.0 ] ], [ [ -5.0, 6.0 ] ] ]
494+
*
495+
* var y = zeros( [ 3, 1, 2 ] );
496+
* // returns <ndarray>[ [ [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ] ] ]
497+
*
498+
* var out = ns.toSorted.assign( x, y );
499+
* // returns <ndarray>[ [ [ -5.0, -3.0 ] ], [ [ 1.0, 2.0 ] ], [ [ 4.0, 6.0 ] ] ]
500+
*
501+
* var bool = ( out === y );
502+
* // returns true
503+
*/
504+
toSorted: typeof toSorted;
505+
435506
/**
436507
* Returns a new ndarray with the elements of an input ndarray sorted along one or more ndarray dimensions using heapsort.
437508
*
@@ -449,19 +520,14 @@ interface Namespace {
449520
* @returns output ndarray
450521
*
451522
* @example
452-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
453523
* var array = require( '@stdlib/ndarray/array' );
454524
*
455525
* var x = array( [ -1.0, 2.0, -3.0 ] );
456526
*
457527
* var y = ns.toSortedhp( x, 1.0 );
458-
* // returns <ndarray>
459-
*
460-
* var arr = ndarray2array( y );
461-
* // returns [ -3.0, -1.0, 2.0 ]
528+
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
462529
*
463530
* @example
464-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
465531
* var zeros = require( '@stdlib/ndarray/zeros' );
466532
* var array = require( '@stdlib/ndarray/array' );
467533
*
@@ -470,16 +536,39 @@ interface Namespace {
470536
* var y = zeros( [ 3 ] );
471537
*
472538
* var out = ns.toSortedhp.assign( x, y );
473-
* // returns <ndarray>
474-
*
475-
* var arr = ndarray2array( out );
476-
* // returns [ -3.0, -1.0, 2.0 ]
539+
* // returns <ndarray>[ -3.0, -1.0, 2.0 ]
477540
*
478541
* var bool = ( out === y );
479542
* // returns true
480543
*/
481544
toSortedhp: typeof toSortedhp;
482545

546+
/**
547+
* 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.
548+
*
549+
* @param shape - array shape
550+
* @param start - starting value
551+
* @param options - function options
552+
* @returns output ndarray
553+
*
554+
* @example
555+
* var out = ns.unitspace( [ 2, 3 ], 1.0 );
556+
* // returns <ndarray>[ [ 1.0, 2.0, 3.0 ], [ 1.0, 2.0, 3.0 ] ]
557+
*
558+
* @example
559+
* var zeros = require( '@stdlib/ndarray/zeros' );
560+
*
561+
* var x = zeros( [ 2, 3 ] );
562+
* // returns <ndarray>[ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ]
563+
*
564+
* var out = ns.unitspace.assign( x, 1.0 );
565+
* // returns <ndarray>[ [ 1.0, 2.0, 3.0 ], [ 1.0, 2.0, 3.0 ] ]
566+
*
567+
* var bool = ( out === x );
568+
* // returns true
569+
*/
570+
unitspace: typeof unitspace;
571+
483572
/**
484573
* Returns a new ndarray filled with linearly spaced numeric elements which increment by 1 starting from zero along one or more ndarray dimensions.
485574
*

0 commit comments

Comments
 (0)