diff --git a/CHANGELOG.md b/CHANGELOG.md index 0febb3c..b44a1d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@
+- [`1cc3e09`](https://github.com/stdlib-js/stdlib/commit/1cc3e095080947f8fdd61ea2217f9b3031b9f93b) - **docs:** fix annotation _(by Athan Reines)_ +- [`7efc6f3`](https://github.com/stdlib-js/stdlib/commit/7efc6f3c8f899974f7d11cb9e06f65f90d5caaa9) - **bench:** fix symbol name _(by Athan Reines)_ - [`354a147`](https://github.com/stdlib-js/stdlib/commit/354a1472bd69ab26c020aa7ba1df043c88e985b2) - **docs:** add note _(by Athan Reines)_ - [`80542fd`](https://github.com/stdlib-js/stdlib/commit/80542fd459075dc2c49f6e529a21bd661129899e) - **docs:** remove note _(by Athan Reines)_ - [`d481f26`](https://github.com/stdlib-js/stdlib/commit/d481f264f68deee3497bf73480c2c88efc3a725f) - **feat:** add `ndarray/filter` _(by Athan Reines)_ diff --git a/benchmark/benchmark.2d.js b/benchmark/benchmark.2d.js index e848b15..c70a9f1 100644 --- a/benchmark/benchmark.2d.js +++ b/benchmark/benchmark.2d.js @@ -30,7 +30,7 @@ var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); var ndarray = require( '@stdlib/ndarray-ctor' ); var pkg = require( './../package.json' ).name; -var map = require( './../lib' ); +var filter = require( './../lib' ); // VARIABLES // @@ -94,7 +94,7 @@ function createBenchmark( len, shape, xtype, ytype, order ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = map( x, opts, predicate ); + y = filter( x, opts, predicate ); if ( isnan( y.data[ i%y.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/dist/index.js.map b/dist/index.js.map index 92b21c3..d4c9544 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert-is-plain-object' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isndarrayLike = require( '@stdlib/assert-is-ndarray-like' );\nvar isOrder = require( '@stdlib/ndarray-base-assert-is-order' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar ctors = require( '@stdlib/ndarray-base-buffer-ctors' );\nvar zeros = require( '@stdlib/array-base-zeros' );\nvar getShape = require( '@stdlib/ndarray-shape' );\nvar getDType = require( '@stdlib/ndarray-dtype' );\nvar getOrder = require( '@stdlib/ndarray-order' );\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar nextCartesianIndex = require( '@stdlib/ndarray-base-next-cartesian-index' ).assign;\nvar gcopy = require( '@stdlib/blas-base-gcopy' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Returns a shallow copy of an ndarray containing only those elements which pass a test implemented by a predicate function.\n*\n* @param {ndarray} x - input ndarray\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - output array data type\n* @param {boolean} [options.order='row-major'] - index iteration order\n* @param {Callback} predicate - predicate function\n* @param {*} [thisArg] - predicate execution context\n* @throws {TypeError} first argument must be an ndarray-like object\n* @throws {TypeError} callback argument must be a function\n* @throws {TypeError} options argument must be an object\n* @returns {ndarray} output ndarray\n*\n* @example\n* var isEven = require( '@stdlib/assert-is-even' ).isPrimitive;\n* var Float64Array = require( '@stdlib/array-float64' );\n* var ndarray = require( '@stdlib/ndarray-ctor' );\n* var ndarray2array = require( '@stdlib/ndarray-to-array' );\n*\n* var buffer = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var shape = [ 2, 3 ];\n* var strides = [ 6, 1 ];\n* var offset = 1;\n*\n* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );\n* // returns \n*\n* var y = filter( x, isEven );\n* // returns \n*\n* var arr = ndarray2array( y );\n* // returns [ 2.0, 4.0, 8.0, 10.0 ]\n*/\nfunction filter( x, options, predicate, thisArg ) {\n\tvar hasOpts;\n\tvar ndims;\n\tvar cache;\n\tvar clbk;\n\tvar opts;\n\tvar ctor;\n\tvar cidx;\n\tvar ctx;\n\tvar ord;\n\tvar dim;\n\tvar idx;\n\tvar buf;\n\tvar dt;\n\tvar sh;\n\tvar N;\n\tvar y;\n\tvar v;\n\tvar i;\n\tif ( !isndarrayLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );\n\t}\n\tif ( arguments.length < 3 ) {\n\t\tclbk = options;\n\t} else if ( arguments.length === 3 ) {\n\t\tif ( isFunction( options ) ) {\n\t\t\tclbk = options;\n\t\t\tctx = predicate;\n\t\t} else {\n\t\t\thasOpts = true;\n\t\t\topts = options;\n\t\t\tclbk = predicate;\n\t\t}\n\t} else {\n\t\thasOpts = true;\n\t\topts = options;\n\t\tclbk = predicate;\n\t\tctx = thisArg;\n\t}\n\tif ( !isFunction( clbk ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );\n\t}\n\tif ( hasOpts ) {\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t} else {\n\t\t\tdt = getDType( x );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'order' ) ) {\n\t\t\tif ( !isOrder( opts.order ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a recognized order. Option: `%s`.', 'order', opts.order ) );\n\t\t\t}\n\t\t\tord = opts.order;\n\t\t}\n\t} else {\n\t\tdt = getDType( x );\n\t}\n\t// Resolve an output array buffer constructor:\n\tctor = ctors( dt );\n\tif ( ctor === null ) {\n\t\t// The only way we should get here is if the user provided an unsupported data type, as `getDType` should error if the input array has an unrecognized/unsupported data type...\n\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a recognized data type. Option: `%s`.', 'dtype', opts.dtype ) );\n\t}\n\t// Resolve the iteration order:\n\tif ( ord === void 0 ) {\n\t\tord = getOrder( x );\n\t}\n\t// Resolve the input array shape:\n\tsh = getShape( x );\n\n\t// Compute the number of array elements:\n\tN = numel( sh );\n\n\t// Retrieve the number of dimensions:\n\tndims = sh.length;\n\n\t// Resolve the dimension in which indices should iterate fastest:\n\tif ( ord === 'row-major' ) {\n\t\tdim = ndims - 1;\n\t} else { // ord === 'column-major'\n\t\tdim = 0;\n\t}\n\t// Initialize an index array workspace:\n\tidx = zeros( ndims );\n\n\t// Initialize a value cache for those elements which pass a predicate function (note: unfortunately, we use an associative array here, as no other good options. If we use a \"generic\" array, we are limited to 2^32-1 elements. If we allocate, say, a Float64Array buffer for storing indices, we risk materializing lazily-materialized input ndarray values again (e.g., lazy accessor ndarray), which could be expensive. If we allocate a workspace buffer of equal size to the input ndarray to store materialized values, we'd then need to perform another copy in order to shrink the buffer, as, otherwise, could be holding on to significantly more memory than needed for the returned ndarray. There are likely other options, but all involve complexity, so the simplest option is used here.):\n\tcache = {\n\t\t'length': 0\n\t};\n\n\t// Filter elements according to a predicate function...\n\tcidx = -1;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( i > 0 ) {\n\t\t\tidx = nextCartesianIndex( sh, ord, idx, dim, idx );\n\t\t}\n\t\tv = x.get.apply( x, idx );\n\t\tif ( clbk.call( ctx, v, idx.slice(), x ) ) {\n\t\t\tcache.length += 1;\n\t\t\tcidx += 1;\n\t\t\tcache[ cidx ] = v;\n\t\t}\n\t}\n\t// Retrieve the number of cached elements:\n\tN = cache.length;\n\n\t// Allocate an output array buffer:\n\tbuf = new ctor( N );\n\n\t// Copy cached elements to the output array buffer:\n\tgcopy( N, cache, 1, buf, 1 );\n\n\t// Create an output ndarray:\n\ty = new x.constructor( dt, buf, [ N ], [ 1 ], 0, ord );\n\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a shallow copy of an ndarray containing only those elements which pass a test implemented by a predicate function.\n*\n* @module @stdlib/ndarray-filter\n*\n* @example\n* var isEven = require( '@stdlib/assert-is-even' ).isPrimitive;\n* var Float64Array = require( '@stdlib/array-float64' );\n* var ndarray = require( '@stdlib/ndarray-ctor' );\n* var ndarray2array = require( '@stdlib/ndarray-to-array' );\n* var filter = require( '@stdlib/ndarray-filter' );\n*\n* var buffer = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var shape = [ 2, 3 ];\n* var strides = [ 6, 1 ];\n* var offset = 1;\n*\n* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );\n* // returns \n*\n* var y = filter( x, isEven );\n* // returns \n*\n* var arr = ndarray2array( y );\n* // returns [ 2.0, 4.0, 8.0, 10.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert-is-plain-object' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isndarrayLike = require( '@stdlib/assert-is-ndarray-like' );\nvar isOrder = require( '@stdlib/ndarray-base-assert-is-order' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar ctors = require( '@stdlib/ndarray-base-buffer-ctors' );\nvar zeros = require( '@stdlib/array-base-zeros' );\nvar getShape = require( '@stdlib/ndarray-shape' );\nvar getDType = require( '@stdlib/ndarray-dtype' );\nvar getOrder = require( '@stdlib/ndarray-order' );\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar nextCartesianIndex = require( '@stdlib/ndarray-base-next-cartesian-index' ).assign;\nvar gcopy = require( '@stdlib/blas-base-gcopy' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Returns a shallow copy of an ndarray containing only those elements which pass a test implemented by a predicate function.\n*\n* @param {ndarray} x - input ndarray\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - output array data type\n* @param {boolean} [options.order] - index iteration order\n* @param {Callback} predicate - predicate function\n* @param {*} [thisArg] - predicate execution context\n* @throws {TypeError} first argument must be an ndarray-like object\n* @throws {TypeError} callback argument must be a function\n* @throws {TypeError} options argument must be an object\n* @returns {ndarray} output ndarray\n*\n* @example\n* var isEven = require( '@stdlib/assert-is-even' ).isPrimitive;\n* var Float64Array = require( '@stdlib/array-float64' );\n* var ndarray = require( '@stdlib/ndarray-ctor' );\n* var ndarray2array = require( '@stdlib/ndarray-to-array' );\n*\n* var buffer = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var shape = [ 2, 3 ];\n* var strides = [ 6, 1 ];\n* var offset = 1;\n*\n* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );\n* // returns \n*\n* var y = filter( x, isEven );\n* // returns \n*\n* var arr = ndarray2array( y );\n* // returns [ 2.0, 4.0, 8.0, 10.0 ]\n*/\nfunction filter( x, options, predicate, thisArg ) {\n\tvar hasOpts;\n\tvar ndims;\n\tvar cache;\n\tvar clbk;\n\tvar opts;\n\tvar ctor;\n\tvar cidx;\n\tvar ctx;\n\tvar ord;\n\tvar dim;\n\tvar idx;\n\tvar buf;\n\tvar dt;\n\tvar sh;\n\tvar N;\n\tvar y;\n\tvar v;\n\tvar i;\n\tif ( !isndarrayLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );\n\t}\n\tif ( arguments.length < 3 ) {\n\t\tclbk = options;\n\t} else if ( arguments.length === 3 ) {\n\t\tif ( isFunction( options ) ) {\n\t\t\tclbk = options;\n\t\t\tctx = predicate;\n\t\t} else {\n\t\t\thasOpts = true;\n\t\t\topts = options;\n\t\t\tclbk = predicate;\n\t\t}\n\t} else {\n\t\thasOpts = true;\n\t\topts = options;\n\t\tclbk = predicate;\n\t\tctx = thisArg;\n\t}\n\tif ( !isFunction( clbk ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );\n\t}\n\tif ( hasOpts ) {\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t} else {\n\t\t\tdt = getDType( x );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'order' ) ) {\n\t\t\tif ( !isOrder( opts.order ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a recognized order. Option: `%s`.', 'order', opts.order ) );\n\t\t\t}\n\t\t\tord = opts.order;\n\t\t}\n\t} else {\n\t\tdt = getDType( x );\n\t}\n\t// Resolve an output array buffer constructor:\n\tctor = ctors( dt );\n\tif ( ctor === null ) {\n\t\t// The only way we should get here is if the user provided an unsupported data type, as `getDType` should error if the input array has an unrecognized/unsupported data type...\n\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a recognized data type. Option: `%s`.', 'dtype', opts.dtype ) );\n\t}\n\t// Resolve the iteration order:\n\tif ( ord === void 0 ) {\n\t\tord = getOrder( x );\n\t}\n\t// Resolve the input array shape:\n\tsh = getShape( x );\n\n\t// Compute the number of array elements:\n\tN = numel( sh );\n\n\t// Retrieve the number of dimensions:\n\tndims = sh.length;\n\n\t// Resolve the dimension in which indices should iterate fastest:\n\tif ( ord === 'row-major' ) {\n\t\tdim = ndims - 1;\n\t} else { // ord === 'column-major'\n\t\tdim = 0;\n\t}\n\t// Initialize an index array workspace:\n\tidx = zeros( ndims );\n\n\t// Initialize a value cache for those elements which pass a predicate function (note: unfortunately, we use an associative array here, as no other good options. If we use a \"generic\" array, we are limited to 2^32-1 elements. If we allocate, say, a Float64Array buffer for storing indices, we risk materializing lazily-materialized input ndarray values again (e.g., lazy accessor ndarray), which could be expensive. If we allocate a workspace buffer of equal size to the input ndarray to store materialized values, we'd then need to perform another copy in order to shrink the buffer, as, otherwise, could be holding on to significantly more memory than needed for the returned ndarray. There are likely other options, but all involve complexity, so the simplest option is used here.):\n\tcache = {\n\t\t'length': 0\n\t};\n\n\t// Filter elements according to a predicate function...\n\tcidx = -1;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( i > 0 ) {\n\t\t\tidx = nextCartesianIndex( sh, ord, idx, dim, idx );\n\t\t}\n\t\tv = x.get.apply( x, idx );\n\t\tif ( clbk.call( ctx, v, idx.slice(), x ) ) {\n\t\t\tcache.length += 1;\n\t\t\tcidx += 1;\n\t\t\tcache[ cidx ] = v;\n\t\t}\n\t}\n\t// Retrieve the number of cached elements:\n\tN = cache.length;\n\n\t// Allocate an output array buffer:\n\tbuf = new ctor( N );\n\n\t// Copy cached elements to the output array buffer:\n\tgcopy( N, cache, 1, buf, 1 );\n\n\t// Create an output ndarray:\n\ty = new x.constructor( dt, buf, [ N ], [ 1 ], 0, ord );\n\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a shallow copy of an ndarray containing only those elements which pass a test implemented by a predicate function.\n*\n* @module @stdlib/ndarray-filter\n*\n* @example\n* var isEven = require( '@stdlib/assert-is-even' ).isPrimitive;\n* var Float64Array = require( '@stdlib/array-float64' );\n* var ndarray = require( '@stdlib/ndarray-ctor' );\n* var ndarray2array = require( '@stdlib/ndarray-to-array' );\n* var filter = require( '@stdlib/ndarray-filter' );\n*\n* var buffer = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n* var shape = [ 2, 3 ];\n* var strides = [ 6, 1 ];\n* var offset = 1;\n*\n* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );\n* // returns \n*\n* var y = filter( x, isEven );\n* // returns \n*\n* var arr = ndarray2array( y );\n* // returns [ 2.0, 4.0, 8.0, 10.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAgB,QAAS,gCAAiC,EAC1DC,EAAa,QAAS,4BAA6B,EACnDC,EAAgB,QAAS,gCAAiC,EAC1DC,EAAU,QAAS,sCAAuC,EAC1DC,EAAa,QAAS,iCAAkC,EACxDC,EAAQ,QAAS,mCAAoC,EACrDC,EAAQ,QAAS,0BAA2B,EAC5CC,EAAW,QAAS,uBAAwB,EAC5CC,EAAW,QAAS,uBAAwB,EAC5CC,EAAW,QAAS,uBAAwB,EAC5CC,EAAQ,QAAS,4BAA6B,EAC9CC,EAAqB,QAAS,2CAA4C,EAAE,OAC5EC,EAAQ,QAAS,yBAA0B,EAC3CC,EAAS,QAAS,uBAAwB,EAuC9C,SAASC,EAAQC,EAAGC,EAASC,EAAWC,EAAU,CACjD,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,GAAK,CAAClC,EAAea,CAAE,EACtB,MAAM,IAAI,UAAWF,EAAQ,gFAAiFE,CAAE,CAAE,EAmBnH,GAjBK,UAAU,OAAS,EACvBO,EAAON,EACI,UAAU,SAAW,EAC3Bf,EAAYe,CAAQ,GACxBM,EAAON,EACPU,EAAMT,IAENE,EAAU,GACVI,EAAOP,EACPM,EAAOL,IAGRE,EAAU,GACVI,EAAOP,EACPM,EAAOL,EACPS,EAAMR,GAEF,CAACjB,EAAYqB,CAAK,EACtB,MAAM,IAAI,UAAWT,EAAQ,uEAAwES,CAAK,CAAE,EAE7G,GAAKH,EAAU,CACd,GAAK,CAACnB,EAAeuB,CAAK,EACzB,MAAM,IAAI,UAAWV,EAAQ,qEAAsEU,CAAK,CAAE,EAO3G,GALKnB,EAAYmB,EAAM,OAAQ,EAC9BQ,EAAKR,EAAK,MAEVQ,EAAKvB,EAAUO,CAAE,EAEbX,EAAYmB,EAAM,OAAQ,EAAI,CAClC,GAAK,CAACpB,EAASoB,EAAK,KAAM,EACzB,MAAM,IAAI,UAAWV,EAAQ,wEAAyE,QAASU,EAAK,KAAM,CAAE,EAE7HI,EAAMJ,EAAK,KACZ,CACD,MACCQ,EAAKvB,EAAUO,CAAE,EAIlB,GADAS,EAAOnB,EAAO0B,CAAG,EACZP,IAAS,KAEb,MAAM,IAAI,UAAWX,EAAQ,4EAA6E,QAASU,EAAK,KAAM,CAAE,EA+BjI,IA5BKI,IAAQ,SACZA,EAAMlB,EAAUM,CAAE,GAGnBiB,EAAKzB,EAAUQ,CAAE,EAGjBkB,EAAIvB,EAAOsB,CAAG,EAGdZ,EAAQY,EAAG,OAGNL,IAAQ,YACZC,EAAMR,EAAQ,EAEdQ,EAAM,EAGPC,EAAMvB,EAAOc,CAAM,EAGnBC,EAAQ,CACP,OAAU,CACX,EAGAI,EAAO,GACDW,EAAI,EAAGA,EAAIH,EAAGG,IACdA,EAAI,IACRP,EAAMlB,EAAoBqB,EAAIL,EAAKE,EAAKD,EAAKC,CAAI,GAElDM,EAAIpB,EAAE,IAAI,MAAOA,EAAGc,CAAI,EACnBP,EAAK,KAAMI,EAAKS,EAAGN,EAAI,MAAM,EAAGd,CAAE,IACtCM,EAAM,QAAU,EAChBI,GAAQ,EACRJ,EAAOI,CAAK,EAAIU,GAIlB,OAAAF,EAAIZ,EAAM,OAGVS,EAAM,IAAIN,EAAMS,CAAE,EAGlBrB,EAAOqB,EAAGZ,EAAO,EAAGS,EAAK,CAAE,EAG3BI,EAAI,IAAInB,EAAE,YAAagB,EAAID,EAAK,CAAEG,CAAE,EAAG,CAAE,CAAE,EAAG,EAAGN,CAAI,EAE9CO,CACR,CAKAnC,EAAO,QAAUe,ICrJjB,IAAIuB,EAAO,IAKX,OAAO,QAAUA", "names": ["require_main", "__commonJSMin", "exports", "module", "isPlainObject", "isFunction", "isndarrayLike", "isOrder", "hasOwnProp", "ctors", "zeros", "getShape", "getDType", "getOrder", "numel", "nextCartesianIndex", "gcopy", "format", "filter", "x", "options", "predicate", "thisArg", "hasOpts", "ndims", "cache", "clbk", "opts", "ctor", "cidx", "ctx", "ord", "dim", "idx", "buf", "dt", "sh", "N", "y", "v", "i", "main"] } diff --git a/lib/main.js b/lib/main.js index 121a6ce..18a75ea 100644 --- a/lib/main.js +++ b/lib/main.js @@ -44,7 +44,7 @@ var format = require( '@stdlib/string-format' ); * @param {ndarray} x - input ndarray * @param {Options} [options] - function options * @param {string} [options.dtype] - output array data type -* @param {boolean} [options.order='row-major'] - index iteration order +* @param {boolean} [options.order] - index iteration order * @param {Callback} predicate - predicate function * @param {*} [thisArg] - predicate execution context * @throws {TypeError} first argument must be an ndarray-like object