2121/* eslint-disable max-lines */
2222
2323import base = require( '@stdlib/blas/ext/base' ) ;
24+ import circshift = require( '@stdlib/blas/ext/circshift' ) ;
2425import cusum = require( '@stdlib/blas/ext/cusum' ) ;
2526import findIndex = require( '@stdlib/blas/ext/find-index' ) ;
2627import findLastIndex = require( '@stdlib/blas/ext/find-last-index' ) ;
2728import indexOf = require( '@stdlib/blas/ext/index-of' ) ;
29+ import join = require( '@stdlib/blas/ext/join' ) ;
2830import lastIndexOf = require( '@stdlib/blas/ext/last-index-of' ) ;
2931import linspace = require( '@stdlib/blas/ext/linspace' ) ;
3032import sorthp = require( '@stdlib/blas/ext/sorthp' ) ;
3133import sum = require( '@stdlib/blas/ext/sum' ) ;
3234import toSortedhp = require( '@stdlib/blas/ext/to-sortedhp' ) ;
35+ import zeroTo = require( '@stdlib/blas/ext/zero-to' ) ;
3336
3437/**
3538* Interface describing the `ext` namespace.
@@ -40,6 +43,35 @@ interface Namespace {
4043 */
4144 base : typeof base ;
4245
46+ /**
47+ * Circularly shifts the elements of an input ndarray by a specified number of positions along one or more ndarray dimensions.
48+ *
49+ * ## Notes
50+ *
51+ * - The input ndarray is shifted **in-place** (i.e., the input ndarray is **mutated**).
52+ * - When shifting elements along a single dimension, a positive `k` shifts elements to the right (toward higher indices), and a negative `k` shifts elements to the left (toward lower indices). If `k` is zero, the input ndarray is left unchanged.
53+ *
54+ * @param x - input ndarray
55+ * @param k - number of positions to shift
56+ * @param options - function options
57+ * @returns input ndarray
58+ *
59+ * @example
60+ * var array = require( '@stdlib/ndarray/array' );
61+ *
62+ * var x = array( [ 1.0, 2.0, 3.0, 4.0 ], {
63+ * 'shape': [ 2, 2 ],
64+ * 'order': 'row-major'
65+ * });
66+ * // returns <ndarray>[ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]
67+ *
68+ * var y = ns.circshift( x, 1, {
69+ * 'dims': [ 0 ]
70+ * });
71+ * // returns <ndarray>[ [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
72+ */
73+ circshift : typeof circshift ;
74+
4375 /**
4476 * Computes the cumulative sum along one or more ndarray dimensions.
4577 *
@@ -215,6 +247,40 @@ interface Namespace {
215247 */
216248 indexOf : typeof indexOf ;
217249
250+ /**
251+ * Returns an ndarray created by joining elements using a separator along one or more ndarray dimensions.
252+ *
253+ * @param x - input ndarray
254+ * @param options - function options
255+ * @returns output ndarray
256+ *
257+ * @example
258+ * var array = require( '@stdlib/ndarray/array' );
259+ *
260+ * var x = array( [ 1.0, 2.0, 3.0 ] );
261+ *
262+ * var y = ns.join( x );
263+ * // returns <ndarray>[ '1,2,3' ]
264+ *
265+ * @example
266+ * var empty = require( '@stdlib/ndarray/empty' );
267+ * var array = require( '@stdlib/ndarray/array' );
268+ *
269+ * var x = array( [ 1.0, 2.0, 3.0 ], {
270+ * 'dtype': 'generic'
271+ * });
272+ * var y = empty( [], {
273+ * 'dtype': 'generic'
274+ * });
275+ *
276+ * var out = ns.join.assign( x, y );
277+ * // returns <ndarray>[ '1,2,3' ]
278+ *
279+ * var bool = ( out === y );
280+ * // returns true
281+ */
282+ join : typeof join ;
283+
218284 /**
219285 * Returns the last index of a specified search element along an ndarray dimension.
220286 *
@@ -270,29 +336,20 @@ interface Namespace {
270336 * @param options - function options
271337 *
272338 * @example
273- * var ndarray2array = require( '@stdlib/ndarray/to-array' );
274- *
275339 * var out = ns.linspace( [ 2, 4 ], 0.0, 3.0 );
276- * // returns <ndarray>
277- *
278- * var arr = ndarray2array( out );
279- * // returns [ [ 0.0, 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0, 3.0 ] ]
340+ * // returns <ndarray>[ [ 0.0, 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0, 3.0 ] ]
280341 *
281342 * @example
282343 * var zeros = require( '@stdlib/ndarray/zeros' );
283- * var ndarray2array = require( '@stdlib/ndarray/to-array' );
284344 *
285345 * var x = zeros( [ 2, 4 ] );
286346 * // returns <ndarray>
287347 *
288348 * var out = ns.linspace.assign( x, 0.0, 3.0 );
289- * // returns <ndarray>
349+ * // returns <ndarray>[ [ 0.0, 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0, 3.0 ] ]
290350 *
291351 * var bool = ( out === x );
292352 * // returns true
293- *
294- * var arr = ndarray2array( out );
295- * // returns [ [ 0.0, 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0, 3.0 ] ]
296353 */
297354 linspace : typeof linspace ;
298355
@@ -422,6 +479,31 @@ interface Namespace {
422479 * // returns true
423480 */
424481 toSortedhp : typeof toSortedhp ;
482+
483+ /**
484+ * Returns a new ndarray filled with linearly spaced numeric elements which increment by 1 starting from zero along one or more ndarray dimensions.
485+ *
486+ * @param shape - array shape
487+ * @param options - function options
488+ * @returns output ndarray
489+ *
490+ * @example
491+ * var out = ns.zeroTo( [ 2, 3 ] );
492+ * // returns <ndarray>[ [ 0.0, 1.0, 2.0 ], [ 0.0, 1.0, 2.0 ] ]
493+ *
494+ * @example
495+ * var zeros = require( '@stdlib/ndarray/zeros' );
496+ *
497+ * var x = zeros( [ 2, 3 ] );
498+ * // returns <ndarray>[ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ]
499+ *
500+ * var out = ns.zeroTo.assign( x );
501+ * // returns <ndarray>[ [ 0.0, 1.0, 2.0 ], [ 0.0, 1.0, 2.0 ] ]
502+ *
503+ * var bool = ( out === x );
504+ * // returns true
505+ */
506+ zeroTo : typeof zeroTo ;
425507}
426508
427509/**
0 commit comments