Skip to content

Commit 4ae62bf

Browse files
authored
Merge branch 'develop' into blas/nd-joinbetween
2 parents d5280f3 + a04c190 commit 4ae62bf

File tree

216 files changed

+1955
-1471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+1955
-1471
lines changed

.github/workflows/lint_changed_files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ jobs:
274274
# Pin action to full length commit SHA
275275
uses: r-lib/actions/setup-r@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4
276276
with:
277-
r-version: '3.5.3'
277+
r-version: '4.2.0'
278278

279279
# Lint R files:
280280
- name: 'Lint R files'

.github/workflows/lint_random_files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ jobs:
374374
# Pin action to full length commit SHA
375375
uses: r-lib/actions/setup-r@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4
376376
with:
377-
r-version: '4.3.3'
377+
r-version: '4.2.0'
378378

379379
# Lint R files:
380380
- name: 'Lint R files'

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ interface Routine {
105105
* @param K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)`
106106
* @param alpha - scalar constant
107107
* @param A - first matrix
108-
* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
108+
* @param LDA - stride between successive contiguous vectors of the matrix `A` (a.k.a., leading dimension of the matrix `A`)
109109
* @param B - second matrix
110-
* @param LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`)
110+
* @param LDB - stride between successive contiguous vectors of the matrix `B` (a.k.a., leading dimension of the matrix `B`)
111111
* @param beta - scalar constant
112112
* @param C - third matrix
113-
* @param LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`)
113+
* @param LDC - stride between successive contiguous vectors of the matrix `C` (a.k.a., leading dimension of the matrix `C`)
114114
* @returns `C`
115115
*
116116
* @example

lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function dgemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C,
9595
throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', M ) );
9696
}
9797
if ( N < 0 ) {
98-
throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', M ) );
98+
throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ) );
9999
}
100100
if ( K < 0 ) {
101101
throw new RangeError( format( 'invalid argument. Sixth argument must be a nonnegative integer. Value: `%d`.', K ) );

lib/node_modules/@stdlib/blas/ext/base/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var o = ns;
4545

4646
- <span class="signature">[`cfill( N, alpha, x, strideX )`][@stdlib/blas/ext/base/cfill]</span><span class="delimiter">: </span><span class="description">fill a single-precision complex floating-point strided array with a specified scalar constant.</span>
4747
- <span class="signature">[`cindexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW )`][@stdlib/blas/ext/base/cindex-of-row]</span><span class="delimiter">: </span><span class="description">return the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector.</span>
48+
- <span class="signature">[`coneTo( N, x, strideX )`][@stdlib/blas/ext/base/cone-to]</span><span class="delimiter">: </span><span class="description">fill a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one.</span>
4849
- <span class="signature">[`csum( N, x, strideX )`][@stdlib/blas/ext/base/csum]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision complex floating-point strided array elements.</span>
4950
- <span class="signature">[`csumkbn( N, x, strideX )`][@stdlib/blas/ext/base/csumkbn]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision complex floating-point strided array elements using an improved Kahan–Babuška algorithm.</span>
5051
- <span class="signature">[`czeroTo( N, x, strideX )`][@stdlib/blas/ext/base/czero-to]</span><span class="delimiter">: </span><span class="description">fill a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from zero.</span>
@@ -259,6 +260,8 @@ console.log( objectKeys( ns ) );
259260

260261
[@stdlib/blas/ext/base/cindex-of-row]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/cindex-of-row
261262

263+
[@stdlib/blas/ext/base/cone-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/cone-to
264+
262265
[@stdlib/blas/ext/base/csum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/csum
263266

264267
[@stdlib/blas/ext/base/csumkbn]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/csumkbn

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

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
/* eslint-disable max-lines */
2222

2323
import cfill = require( '@stdlib/blas/ext/base/cfill' );
24+
import cindexOfRow = require( '@stdlib/blas/ext/base/cindex-of-row' );
25+
import coneTo = require( '@stdlib/blas/ext/base/cone-to' );
2426
import csum = require( '@stdlib/blas/ext/base/csum' );
2527
import csumkbn = require( '@stdlib/blas/ext/base/csumkbn' );
2628
import czeroTo = require( '@stdlib/blas/ext/base/czero-to' );
@@ -115,6 +117,7 @@ import gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' );
115117
import gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' );
116118
import gnansumors = require( '@stdlib/blas/ext/base/gnansumors' );
117119
import gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' );
120+
import goneTo = require( '@stdlib/blas/ext/base/gone-to' );
118121
import grev = require( '@stdlib/blas/ext/base/grev' );
119122
import gsort = require( '@stdlib/blas/ext/base/gsort' );
120123
import gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' );
@@ -176,6 +179,7 @@ import szeroTo = require( '@stdlib/blas/ext/base/szero-to' );
176179
import wasm = require( '@stdlib/blas/ext/base/wasm' );
177180
import zfill = require( '@stdlib/blas/ext/base/zfill' );
178181
import zindexOfRow = require( '@stdlib/blas/ext/base/zindex-of-row' );
182+
import zoneTo = require( '@stdlib/blas/ext/base/zone-to' );
179183
import zsum = require( '@stdlib/blas/ext/base/zsum' );
180184
import zsumkbn = require( '@stdlib/blas/ext/base/zsumkbn' );
181185
import zzeroTo = require( '@stdlib/blas/ext/base/zzero-to' );
@@ -217,6 +221,75 @@ interface Namespace {
217221
*/
218222
cfill: typeof cfill;
219223

224+
/**
225+
* Returns the index of the first row in a single-precision complex floating-point input matrix which has the same elements as a provided search vector.
226+
*
227+
* ## Notes
228+
*
229+
* - If the function is provided an empty matrix or if the function is unable to find a search vector, the function returns `-1` (i.e., an invalid index).
230+
* - The `workspace` array is only applicable when an input matrix is stored in column-major order. When the matrix is stored in row-major order, the workspace array is ignored.
231+
*
232+
* @param order - storage layout
233+
* @param M - number of rows in `A`
234+
* @param N - number of columns in `A`
235+
* @param A - input matrix
236+
* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
237+
* @param x - search vector
238+
* @param strideX - stride length for `x`
239+
* @param workspace - workspace array for tracking row match candidates
240+
* @param strideW - stride length for `workspace`
241+
* @returns row index
242+
*
243+
* @example
244+
* var Complex64Array = require( `@stdlib/array/complex64` );
245+
* var Uint8Array = require( `@stdlib/array/uint8` );
246+
*
247+
* var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] );
248+
* var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] );
249+
* var workspace = new Uint8Array( 3 );
250+
*
251+
* var out = ns.cindexOfRow( 'column-major', 3, 2, A, 3, x, 1, workspace, 1 );
252+
* // returns 1
253+
*
254+
* @example
255+
* var Complex64Array = require( `@stdlib/array/complex64` );
256+
* var Uint8Array = require( `@stdlib/array/uint8` );
257+
*
258+
* var A = new Complex64Array( [ 1.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0, 0.0, 4.0, 0.0, 0.0, 0.0 ] );
259+
* var x = new Complex64Array( [ 2.0, 0.0, 4.0, 0.0 ] );
260+
* var workspace = new Uint8Array( 3 );
261+
*
262+
* var out = ns.cindexOfRow.ndarray( 3, 2, A, 1, 3, 0, x, 1, 0, workspace, 1, 0 );
263+
* // returns 1
264+
*/
265+
cindexOfRow: typeof cindexOfRow;
266+
267+
/**
268+
* Fills a single-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one.
269+
*
270+
* @param N - number of indexed elements
271+
* @param x - input array
272+
* @param strideX - stride length
273+
* @returns input array
274+
*
275+
* @example
276+
* var Complex64Array = require( '@stdlib/array/complex64' );
277+
*
278+
* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
279+
*
280+
* ns.coneTo( x.length, x, 1 );
281+
* // x => <Complex64Array>[ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ]
282+
*
283+
* @example
284+
* var Complex64Array = require( '@stdlib/array/complex64' );
285+
*
286+
* var x = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
287+
*
288+
* ns.coneTo.ndarray( x.length, x, 1, 0 );
289+
* // x => <Complex64Array>[ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ]
290+
*/
291+
coneTo: typeof coneTo;
292+
220293
/**
221294
* Computes the sum of single-precision complex floating-point strided array elements.
222295
*
@@ -2870,6 +2943,28 @@ interface Namespace {
28702943
*/
28712944
gnansumpw: typeof gnansumpw;
28722945

2946+
/**
2947+
* Fills a strided array with linearly spaced numeric elements which increment by `1` starting from one.
2948+
*
2949+
* @param N - number of indexed elements
2950+
* @param x - input array
2951+
* @param strideX - stride length
2952+
* @returns input array
2953+
*
2954+
* @example
2955+
* var x = [ 0.0, 0.0, 0.0, 0.0 ];
2956+
*
2957+
* ns.goneTo( x.length, x, 1 );
2958+
* // x => [ 1.0, 2.0, 3.0, 4.0 ]
2959+
*
2960+
* @example
2961+
* var x = [ 0.0, 0.0, 0.0, 0.0 ];
2962+
*
2963+
* ns.goneTo.ndarray( x.length, x, 1, 0 );
2964+
* // x => [ 1.0, 2.0, 3.0, 4.0 ]
2965+
*/
2966+
goneTo: typeof goneTo;
2967+
28732968
/**
28742969
* Reverses a strided array in-place.
28752970
*
@@ -4553,6 +4648,32 @@ interface Namespace {
45534648
*/
45544649
zindexOfRow: typeof zindexOfRow;
45554650

4651+
/**
4652+
* Fills a double-precision complex floating-point strided array with linearly spaced numeric elements which increment by `1` starting from one.
4653+
*
4654+
* @param N - number of indexed elements
4655+
* @param x - input array
4656+
* @param strideX - stride length
4657+
* @returns input array
4658+
*
4659+
* @example
4660+
* var Complex128Array = require( '@stdlib/array/complex128' );
4661+
*
4662+
* var x = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
4663+
*
4664+
* ns.zoneTo( x.length, x, 1 );
4665+
* // x => <Complex128Array>[ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ]
4666+
*
4667+
* @example
4668+
* var Complex128Array = require( '@stdlib/array/complex128' );
4669+
*
4670+
* var x = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
4671+
*
4672+
* ns.zoneTo.ndarray( x.length, x, 1, 0 );
4673+
* // x => <Complex128Array>[ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0, 0.0 ]
4674+
*/
4675+
zoneTo: typeof zoneTo;
4676+
45564677
/**
45574678
* Computes the sum of double-precision complex floating-point strided array elements.
45584679
*

lib/node_modules/@stdlib/blas/ext/base/ndarray/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ The namespace exposes the following APIs:
9090
- <span class="signature">[`gnansumkbn2( arrays )`][@stdlib/blas/ext/base/ndarray/gnansumkbn2]</span><span class="delimiter">: </span><span class="description">compute the sum of a one-dimensional ndarray, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm.</span>
9191
- <span class="signature">[`gnansumors( arrays )`][@stdlib/blas/ext/base/ndarray/gnansumors]</span><span class="delimiter">: </span><span class="description">compute the sum of a one-dimensional ndarray, ignoring `NaN` values and using ordinary recursive summation.</span>
9292
- <span class="signature">[`gnansumpw( arrays )`][@stdlib/blas/ext/base/ndarray/gnansumpw]</span><span class="delimiter">: </span><span class="description">compute the sum of a one-dimensional ndarray, ignoring `NaN` values and using pairwise summation.</span>
93+
- <span class="signature">[`goneTo( arrays )`][@stdlib/blas/ext/base/ndarray/gone-to]</span><span class="delimiter">: </span><span class="description">fill a one-dimensional ndarray with linearly spaced numeric elements which increment by `1` starting from one.</span>
9394
- <span class="signature">[`gsort( arrays )`][@stdlib/blas/ext/base/ndarray/gsort]</span><span class="delimiter">: </span><span class="description">sort a one-dimensional ndarray.</span>
9495
- <span class="signature">[`gsorthp( arrays )`][@stdlib/blas/ext/base/ndarray/gsorthp]</span><span class="delimiter">: </span><span class="description">sort a one-dimensional ndarray using heapsort.</span>
9596
- <span class="signature">[`gsum( arrays )`][@stdlib/blas/ext/base/ndarray/gsum]</span><span class="delimiter">: </span><span class="description">compute the sum of all elements in a one-dimensional ndarray.</span>
@@ -254,6 +255,8 @@ console.log( objectKeys( ns ) );
254255

255256
[@stdlib/blas/ext/base/ndarray/gnansumpw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/ndarray/gnansumpw
256257

258+
[@stdlib/blas/ext/base/ndarray/gone-to]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/ndarray/gone-to
259+
257260
[@stdlib/blas/ext/base/ndarray/gsort]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/ndarray/gsort
258261

259262
[@stdlib/blas/ext/base/ndarray/gsorthp]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/ndarray/gsorthp

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import gnansumkbn = require( '@stdlib/blas/ext/base/ndarray/gnansumkbn' );
6565
import gnansumkbn2 = require( '@stdlib/blas/ext/base/ndarray/gnansumkbn2' );
6666
import gnansumors = require( '@stdlib/blas/ext/base/ndarray/gnansumors' );
6767
import gnansumpw = require( '@stdlib/blas/ext/base/ndarray/gnansumpw' );
68+
import goneTo = require( '@stdlib/blas/ext/base/ndarray/gone-to' );
6869
import gsort = require( '@stdlib/blas/ext/base/ndarray/gsort' );
6970
import gsorthp = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
7071
import gsum = require( '@stdlib/blas/ext/base/ndarray/gsum' );
@@ -1176,6 +1177,24 @@ interface Namespace {
11761177
*/
11771178
gnansumpw: typeof gnansumpw;
11781179

1180+
/**
1181+
* Fills a one-dimensional ndarray with linearly spaced numeric elements which increment by `1` starting from one.
1182+
*
1183+
* @param arrays - array-like object containing a one-dimensional input ndarray
1184+
* @returns input ndarray
1185+
*
1186+
* @example
1187+
* var ndarray = require( '@stdlib/ndarray/base/ctor' );
1188+
*
1189+
* var xbuf = [ 0.0, 0.0, 0.0, 0.0 ];
1190+
* var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
1191+
* // returns <ndarray>[ 0.0, 0.0, 0.0, 0.0 ]
1192+
*
1193+
* var out = ns.goneTo( [ x ] );
1194+
* // returns <ndarray>[ 1.0, 2.0, 3.0, 4.0 ]
1195+
*/
1196+
goneTo: typeof goneTo;
1197+
11791198
/**
11801199
* Sorts a one-dimensional ndarray.
11811200
*

lib/node_modules/@stdlib/blas/ext/cusum/lib/assign.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var nonCoreShape = require( '@stdlib/ndarray/base/complement-shape' );
3030
var getDType = require( '@stdlib/ndarray/dtype' );
3131
var getShape = require( '@stdlib/ndarray/shape' );
3232
var getOrder = require( '@stdlib/ndarray/order' );
33+
var ndims = require( '@stdlib/ndarray/base/ndims' );
3334
var format = require( '@stdlib/string/format' );
3435
var base = require( './base.js' ).assign;
3536

@@ -43,7 +44,7 @@ var base = require( './base.js' ).assign;
4344
* @param {(ndarrayLike|number|ComplexLike)} [initial] - initial value
4445
* @param {ndarrayLike} out - output ndarray
4546
* @param {Options} [options] - function options
46-
* @param {integer} [options.dims] - list of dimensions over which to perform operation
47+
* @param {IntegerArray} [options.dims] - list of dimensions over which to perform operation
4748
* @throws {TypeError} first argument must be an ndarray-like object
4849
* @throws {TypeError} initial value argument must be either an ndarray-like object or a numeric value
4950
* @throws {TypeError} output argument must be an ndarray-like object
@@ -112,6 +113,9 @@ function assign( x ) {
112113
// Case: assign( x, initial_ndarray, out )
113114
if ( isndarrayLike( v ) ) {
114115
// As the operation is performed across all dimensions, `v` is assumed to be a zero-dimensional ndarray...
116+
if ( ndims( v ) !== 0 ) {
117+
throw new TypeError( format( 'invalid argument. Second argument must be a zero-dimensional ndarray.' ) );
118+
}
115119
return base( x, v, out );
116120
}
117121
// When computing the sum, initial values must be numeric...
@@ -134,9 +138,11 @@ function assign( x ) {
134138
}
135139
// Case: assign( x, initial_ndarray, out, opts )
136140
if ( isndarrayLike( v ) ) {
137-
// When not provided `dims`, the operation is performed across all dimensions and `v` is assumed to be a zero-dimensional ndarray; when `dims` is provided, we need to broadcast `v` to match the shape of the non-core dimensions...
141+
// When not provided `dims`, the operation is performed across all dimensions and `v` must be a zero-dimensional ndarray; when `dims` is provided, we need to broadcast `v` to match the shape of the non-core dimensions...
138142
if ( hasOwnProp( opts, 'dims' ) ) {
139143
v = maybeBroadcastArray( v, nonCoreShape( getShape( x ), opts.dims ) ); // eslint-disable-line max-len
144+
} else if ( ndims( v ) !== 0 ) {
145+
throw new TypeError( format( 'invalid argument. Second argument must be a zero-dimensional ndarray.' ) );
140146
}
141147
}
142148
// Case: assign( x, initial_scalar, out, opts )

lib/node_modules/@stdlib/blas/ext/cusum/lib/main.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var nonCoreShape = require( '@stdlib/ndarray/base/complement-shape' );
3030
var getDType = require( '@stdlib/ndarray/dtype' );
3131
var getShape = require( '@stdlib/ndarray/shape' );
3232
var getOrder = require( '@stdlib/ndarray/order' );
33+
var ndims = require( '@stdlib/ndarray/base/ndims' );
3334
var format = require( '@stdlib/string/format' );
3435
var base = require( './base.js' );
3536

@@ -99,7 +100,10 @@ function cusum( x ) {
99100
if ( nargs === 2 ) {
100101
// Case: cusum( x, initial_ndarray )
101102
if ( isndarrayLike( v ) ) {
102-
// As the operation is performed across all dimensions, `v` is assumed to be a zero-dimensional ndarray...
103+
// As the operation is performed across all dimensions, `v` must be a zero-dimensional ndarray...
104+
if ( ndims( v ) !== 0 ) {
105+
throw new TypeError( format( 'invalid argument. Second argument must be a zero-dimensional ndarray.' ) );
106+
}
103107
return base( x, v );
104108
}
105109
// Case: cusum( x, initial_scalar )
@@ -118,9 +122,11 @@ function cusum( x ) {
118122
}
119123
// Case: cusum( x, initial_ndarray, opts )
120124
if ( isndarrayLike( v ) ) {
121-
// When not provided `dims`, the operation is performed across all dimensions and `v` is assumed to be a zero-dimensional ndarray; when `dims` is provided, we need to broadcast `v` to match the shape of the non-core dimensions...
125+
// When not provided `dims`, the operation is performed across all dimensions and `v` must be a zero-dimensional ndarray; when `dims` is provided, we need to broadcast `v` to match the shape of the non-core dimensions...
122126
if ( hasOwnProp( opts, 'dims' ) ) {
123127
v = maybeBroadcastArray( v, nonCoreShape( getShape( x ), opts.dims ) ); // eslint-disable-line max-len
128+
} else if ( ndims( v ) !== 0 ) {
129+
throw new TypeError( format( 'invalid argument. Second argument must be a zero-dimensional ndarray.' ) );
124130
}
125131
}
126132
// Case: cusum( x, initial_scalar, opts )

0 commit comments

Comments
 (0)