=0;f--)if(!((d=c-o+f)<0)){if(p=i[d],0!==(t=a[f])&&t 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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\nimport formatInteger from './format_integer.js';\nimport isString from './is_string.js';\nimport formatDouble from './format_double.js';\nimport spacePad from './space_pad.js';\nimport zeroPad from './zero_pad.js';\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\ttokens.push( parse( match ) );\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nexport default formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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\nimport interpolate from '@stdlib/string-base-format-interpolate';\nimport tokenize from '@stdlib/string-base-format-tokenize';\nimport isString from './is_string.js';\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport copy from '@stdlib/array-base-copy-indexed';\nimport zeros from '@stdlib/array-base-zeros';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Broadcasts an array to a specified shape.\n*\n* @param {Collection} x - input array\n* @param {NonNegativeIntegerArray} inShape - input array shape\n* @param {NonNegativeIntegerArray} outShape - output array shape\n* @throws {Error} input array cannot have more dimensions than the desired shape\n* @throws {Error} input array dimension sizes must be `1` or equal to the corresponding dimension in the provided output shape\n* @throws {Error} input array and desired shape must be broadcast compatible\n* @returns {Object} broadcast object\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = broadcastArray( x, [ 2 ], [ 2, 2 ] );\n* // returns {...}\n*\n* var shape = out.shape;\n* // returns [ 2, 2 ]\n*\n* var strides = out.strides;\n* // returns [ 0, 1 ]\n*\n* var ref = out.ref;\n* // returns [ 1, 2 ]\n*\n* var bool = ( x === ref );\n* // returns true\n*\n* var data = out.data;\n* // returns [ [ 1, 2 ] ]\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = broadcastArray( x, [ 2 ], [ 2, 1, 2 ] );\n* // returns {...}\n*\n* var data = out.data;\n* // returns [ [ [ 1, 2 ] ] ]\n*\n* var strides = out.strides;\n* // returns [ 0, 0, 1 ]\n*\n* @example\n* var x = [ [ 1 ], [ 2 ] ];\n*\n* var out = broadcastArray( x, [ 2, 1 ], [ 3, 2, 2 ] );\n* // returns {...}\n*\n* var data = out.data;\n* // returns [ [ [ 1 ], [ 2 ] ] ]\n*\n* var strides = out.strides;\n* // returns [ 0, 1, 0 ]\n*/\nfunction broadcastArray( x, inShape, outShape ) {\n\tvar data;\n\tvar dim;\n\tvar st;\n\tvar N;\n\tvar M;\n\tvar d;\n\tvar i;\n\tvar j;\n\n\tN = outShape.length;\n\tM = inShape.length;\n\tif ( N < M ) {\n\t\tthrow new Error( 'invalid argument. Cannot broadcast an array to a shape having fewer dimensions. Arrays can only be broadcasted to shapes having the same or more dimensions.' );\n\t}\n\t// Prepend additional dimensions...\n\tdata = x;\n\tfor ( i = M; i < N; i++ ) {\n\t\tdata = [ data ];\n\t}\n\n\t// Initialize a strides array:\n\tst = zeros( N );\n\n\t// Determine the output array strides...\n\tfor ( i = N-1; i >= 0; i-- ) {\n\t\tj = M - N + i;\n\t\tif ( j < 0 ) {\n\t\t\t// Prepended singleton dimension; stride is zero...\n\t\t\tcontinue;\n\t\t}\n\t\td = inShape[ j ];\n\t\tdim = outShape[ i ];\n\t\tif ( dim !== 0 && dim < d ) {\n\t\t\tthrow new Error( format( 'invalid argument. Input array cannot be broadcast to the specified shape, as the specified shape has a dimension whose size is less than the size of the corresponding dimension in the input array. Array shape: (%s). Desired shape: (%s). Dimension: %u.', copy( inShape ).join( ', ' ), copy( outShape ).join( ', ' ), i ) );\n\t\t}\n\t\tif ( d === dim ) {\n\t\t\t// As the dimension sizes are equal, the stride is one, meaning that each element in the array should be iterated over as normal...\n\t\t\tst[ i ] = 1;\n\t\t} else if ( d === 1 ) {\n\t\t\t// In order to broadcast a dimension, we set the stride for that dimension to zero...\n\t\t\tst[ i ] = 0;\n\t\t} else {\n\t\t\t// At this point, we know that `dim > d` and that `d` does not equal `1` (e.g., `dim=3` and `d=2`); in which case, the shapes are considered incompatible (even for desired shapes which are multiples of array dimensions, as might be desired when \"tiling\" an array; e.g., `dim=4` and `d=2`)...\n\t\t\tthrow new Error( format( 'invalid argument. Input array and the specified shape are broadcast incompatible. Array shape: (%s). Desired shape: (%s). Dimension: %u.', copy( inShape ).join( ', ' ), copy( outShape ).join( ', ' ), i ) );\n\t\t}\n\t}\n\t// Return broadcast results:\n\treturn {\n\t\t'ref': x, // reference to the original input array\n\t\t'data': data, // broadcasted array\n\t\t'shape': copy( outShape ), // copy in order to prevent mutation\n\t\t'strides': st\n\t};\n}\n\n\n// EXPORTS //\n\nexport default broadcastArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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// MAIN //\n\n/**\n* Returns a filled \"generic\" array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} filled array\n*\n* @example\n* var out = filled( 0.0, 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = filled( 'beep', 3 );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\nfunction filled( value, len ) {\n\tvar arr;\n\tvar i;\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tarr.push( value );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nexport default filled;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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\nimport filled from '@stdlib/array-base-filled';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled \"generic\" array.\n*\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} output array\n*\n* @example\n* var out = zeros( 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\nfunction zeros( len ) {\n\treturn filled( 0.0, len );\n}\n\n\n// EXPORTS //\n\nexport default zeros;\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// MODULES //\n\nimport broadcastArray from '@stdlib/array-base-broadcast-array';\n\n\n// MAIN //\n\n/**\n* Applies a ternary callback to elements in three broadcasted input arrays and assigns results to elements in a three-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing three input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - ternary callback\n* @returns {void}\n*\n* @example\n* import ones3d from '@stdlib/array-base-ones3d';\n* import zeros3d from '@stdlib/array-base-zeros3d';\n* import add from '@stdlib/number-float64-base-add3';\n*\n* var shapes = [\n* [ 1, 2, 1 ],\n* [ 2, 1, 1 ],\n* [ 1, 1, 2 ],\n* [ 2, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = ones3d( shapes[ 1 ] );\n* var z = ones3d( shapes[ 2 ] );\n* var out = zeros3d( shapes[ 3 ] );\n*\n* bternary3d( [ x, y, z, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] , [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] ]\n*/\nfunction bternary3d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dz0;\n\tvar dz1;\n\tvar dz2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar k0;\n\tvar k1;\n\tvar k2;\n\tvar m0;\n\tvar m1;\n\tvar m2;\n\tvar x0;\n\tvar x1;\n\tvar y0;\n\tvar y1;\n\tvar z0;\n\tvar z1;\n\tvar sh;\n\tvar st;\n\tvar w0;\n\tvar w1;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\tvar w;\n\n\tsh = shapes[ 3 ];\n\tS0 = sh[ 2 ];\n\tS1 = sh[ 1 ];\n\tS2 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 2 ];\n\tdx1 = st[ 1 ];\n\tdx2 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 2 ];\n\tdy1 = st[ 1 ];\n\tdy2 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );\n\tz = o.data;\n\tst = o.strides;\n\tdz0 = st[ 2 ];\n\tdz1 = st[ 1 ];\n\tdz2 = st[ 0 ];\n\n\tw = arrays[ 3 ];\n\tj2 = 0;\n\tk2 = 0;\n\tm2 = 0;\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tj1 = 0;\n\t\tk1 = 0;\n\t\tm1 = 0;\n\t\tx1 = x[ j2 ];\n\t\ty1 = y[ k2 ];\n\t\tz1 = z[ m2 ];\n\t\tw1 = w[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tj0 = 0;\n\t\t\tk0 = 0;\n\t\t\tm0 = 0;\n\t\t\tx0 = x1[ j1 ];\n\t\t\ty0 = y1[ k1 ];\n\t\t\tz0 = z1[ m1 ];\n\t\t\tw0 = w1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tw0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ] );\n\t\t\t\tj0 += dx0;\n\t\t\t\tk0 += dy0;\n\t\t\t\tm0 += dz0;\n\t\t\t}\n\t\t\tj1 += dx1;\n\t\t\tk1 += dy1;\n\t\t\tm1 += dz1;\n\t\t}\n\t\tj2 += dx2;\n\t\tk2 += dy2;\n\t\tm2 += dz2;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default bternary3d;\n"],"names":["copy","x","out","len","i","length","push","isNumber","value","zeros","n","zeroPad","str","width","right","negative","pad","startsWithMinus","substr","lowercase","String","prototype","toLowerCase","uppercase","toUpperCase","formatInteger","token","base","specifier","arg","parseInt","isFinite","Error","toString","precision","padRight","sign","alternate","call","charAt","abs","Math","replace","RE_EXP_POS_DIGITS","RE_EXP_NEG_DIGITS","RE_ONLY_DIGITS","RE_DIGITS_BEFORE_EXP","RE_TRAILING_PERIOD_ZERO","RE_PERIOD_ZERO_EXP","RE_ZERO_BEFORE_EXP","formatDouble","digits","f","parseFloat","toExponential","toFixed","toPrecision","spaces","fromCharCode","isArray","Array","isnan","initialize","flags","mapping","formatInterpolate","tokens","hasPeriod","flag","num","pos","j","TypeError","padZeros","indexOf","arguments","maxWidth","substring","RE","parse","match","formatTokenize","content","prev","exec","slice","lastIndex","format","args","tokenize","interpolate","apply","broadcastArray","inShape","outShape","data","dim","st","N","M","d","arr","filled","join","ref","shape","strides","arrays","shapes","fcn","dx0","dx1","dx2","dy0","dy1","dy2","dz0","dz1","dz2","S0","S1","S2","i0","i1","i2","j0","j1","j2","k0","k1","k2","m0","m1","m2","x0","x1","y0","y1","z0","z1","sh","w0","w1","o","y","z","w"],"mappings":";yCAgCA,SAASA,EAAMC,GACd,IAAIC,EACAC,EACAC,EAIJ,IAFAD,EAAMF,EAAEI,OACRH,EAAM,GACAE,EAAI,EAAGA,EAAID,EAAKC,IACrBF,EAAII,KAAML,EAAGG,IAEd,OAAOF,CACR,CCLA,SAASK,EAAUC,GAClB,MAA0B,iBAAVA,CACjB,CCAA,SAASC,EAAOC,GACf,IACIN,EADAF,EAAM,GAEV,IAAME,EAAI,EAAGA,EAAIM,EAAGN,IACnBF,GAAO,IAER,OAAOA,CACR,CAcA,SAASS,EAASC,EAAKC,EAAOC,GAC7B,IAAIC,GAAW,EACXC,EAAMH,EAAQD,EAAIP,OACtB,OAAKW,EAAM,IAnCZ,SAA0BJ,GACzB,MAAoB,MAAbA,EAAK,EACb,CAoCMK,CAAiBL,KACrBG,GAAW,EACXH,EAAMA,EAAIM,OAAQ,IAEnBN,EAAM,EACLA,EAAMH,EAAOO,GACbP,EAAOO,GAAQJ,EACXG,IACJH,EAAM,IAAMA,IAVLA,CAaT,CCpDA,IAAIO,EAAYC,OAAOC,UAAUC,YAC7BC,EAAYH,OAAOC,UAAUG,YAajC,SAASC,EAAeC,GACvB,IAAIC,EACAzB,EACAE,EAEJ,OAASsB,EAAME,WACf,IAAK,IAEJD,EAAO,EACP,MACD,IAAK,IAEJA,EAAO,EACP,MACD,IAAK,IACL,IAAK,IAEJA,EAAO,GACP,MAID,QAECA,EAAO,GAKR,GAFAzB,EAAMwB,EAAMG,IACZzB,EAAI0B,SAAU5B,EAAK,KACb6B,SAAU3B,GAAM,CACrB,IAAMG,EAAUL,GACf,MAAM,IAAI8B,MAAO,2BAA6B9B,GAE/CE,EAAI,CACJ,CAkCD,OAjCKA,EAAI,IAA2B,MAApBsB,EAAME,WAA8B,KAATD,KAC1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H,GADA8I,EAAInD,EAAgBe,EAAQ,GAAKC,EAAQ,GAAKgC,IACxC7C,KAENe,GADAb,EAAK8C,EAAErC,SACG,GACVK,EAAMd,EAAI,GACVe,EAAMf,EAAI,GAGV+C,GADAD,EAAInD,EAAgBe,EAAQ,GAAKC,EAAQ,GAAKgC,IACxC7C,KAENkB,GADAhB,EAAK8C,EAAErC,SACG,GACVQ,EAAMjB,EAAI,GACVkB,EAAMlB,EAAI,GAGVgD,GADAF,EAAInD,EAAgBe,EAAQ,GAAKC,EAAQ,GAAKgC,IACxC7C,KAENqB,GADAnB,EAAK8C,EAAErC,SACG,GACVW,EAAMpB,EAAI,GACVqB,EAAMrB,EAAI,GAEViD,EAAIvC,EAAQ,GACZoB,EAAK,EACLG,EAAK,EACLG,EAAK,EACCT,EAAK,EAAGA,EAAKH,EAAIG,IAAO,CAQ7B,IAPAE,EAAK,EACLG,EAAK,EACLG,EAAK,EACLG,EAAKtI,EAAG8H,GACRU,EAAKO,EAAGd,GACRS,EAAKM,EAAGZ,GACRS,EAAKI,EAAGtB,GACFD,EAAK,EAAGA,EAAKH,EAAIG,IAAO,CAQ7B,IAPAE,EAAK,EACLG,EAAK,EACLG,EAAK,EACLG,EAAKC,EAAIT,GACTU,EAAKC,EAAIR,GACTS,EAAKC,EAAIP,GACTS,EAAKC,EAAInB,GACHD,EAAK,EAAGA,EAAKH,EAAIG,IACtBmB,EAAInB,GAAOb,EAAKyB,EAAIT,GAAMW,EAAIR,GAAMU,EAAIP,IACxCN,GAAMf,EACNkB,GAAMf,EACNkB,GAAMf,EAEPU,GAAMf,EACNkB,GAAMf,EACNkB,GAAMf,CACN,CACDU,GAAMf,EACNkB,GAAMf,EACNkB,GAAMf,CACN,CACF","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13]}
\ No newline at end of file
diff --git a/dist/index.d.ts b/dist/index.d.ts
deleted file mode 100644
index e24dd7c..0000000
--- a/dist/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-///
-import bternary3d from '../docs/types/index';
-export = bternary3d;
\ No newline at end of file
diff --git a/dist/index.js b/dist/index.js
deleted file mode 100644
index 8116330..0000000
--- a/dist/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";var V=function(t,a){return function(){return a||t((a={exports:{}}).exports,a),a.exports}};var T=V(function(Z,R){
-var S=require('@stdlib/array-base-broadcast-array/dist');function W(t,a,U){var b,q,A,g,l,B,C,D,E,x,s,u,i,e,o,z,f,n,y,c,m,j,k,w,F,G,H,I,J,K,d,r,L,M,v,N,O,P,Q;if(d=a[3],x=d[2],s=d[1],u=d[0],!(x<=0||s<=0||u<=0))for(v=S(t[0],a[0],d),N=v.data,r=v.strides,b=r[2],q=r[1],A=r[0],v=S(t[1],a[1],d),O=v.data,r=v.strides,g=r[2],l=r[1],B=r[0],v=S(t[2],a[2],d),P=v.data,r=v.strides,C=r[2],D=r[1],E=r[0],Q=t[3],n=0,m=0,w=0,o=0;o>} arrays - array-like object containing three input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - ternary callback\n* @returns {void}\n*\n* @example\n* var ones3d = require( '@stdlib/array-base-ones3d' );\n* var zeros3d = require( '@stdlib/array-base-zeros3d' );\n* var add = require( '@stdlib/number-float64-base-add3' );\n*\n* var shapes = [\n* [ 1, 2, 1 ],\n* [ 2, 1, 1 ],\n* [ 1, 1, 2 ],\n* [ 2, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = ones3d( shapes[ 1 ] );\n* var z = ones3d( shapes[ 2 ] );\n* var out = zeros3d( shapes[ 3 ] );\n*\n* bternary3d( [ x, y, z, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] , [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] ]\n*/\nfunction bternary3d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dz0;\n\tvar dz1;\n\tvar dz2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar k0;\n\tvar k1;\n\tvar k2;\n\tvar m0;\n\tvar m1;\n\tvar m2;\n\tvar x0;\n\tvar x1;\n\tvar y0;\n\tvar y1;\n\tvar z0;\n\tvar z1;\n\tvar sh;\n\tvar st;\n\tvar w0;\n\tvar w1;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\tvar w;\n\n\tsh = shapes[ 3 ];\n\tS0 = sh[ 2 ];\n\tS1 = sh[ 1 ];\n\tS2 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 2 ];\n\tdx1 = st[ 1 ];\n\tdx2 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 2 ];\n\tdy1 = st[ 1 ];\n\tdy2 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );\n\tz = o.data;\n\tst = o.strides;\n\tdz0 = st[ 2 ];\n\tdz1 = st[ 1 ];\n\tdz2 = st[ 0 ];\n\n\tw = arrays[ 3 ];\n\tj2 = 0;\n\tk2 = 0;\n\tm2 = 0;\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tj1 = 0;\n\t\tk1 = 0;\n\t\tm1 = 0;\n\t\tx1 = x[ j2 ];\n\t\ty1 = y[ k2 ];\n\t\tz1 = z[ m2 ];\n\t\tw1 = w[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tj0 = 0;\n\t\t\tk0 = 0;\n\t\t\tm0 = 0;\n\t\t\tx0 = x1[ j1 ];\n\t\t\ty0 = y1[ k1 ];\n\t\t\tz0 = z1[ m1 ];\n\t\t\tw0 = w1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tw0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ] );\n\t\t\t\tj0 += dx0;\n\t\t\t\tk0 += dy0;\n\t\t\t\tm0 += dz0;\n\t\t\t}\n\t\t\tj1 += dx1;\n\t\t\tk1 += dy1;\n\t\t\tm1 += dz1;\n\t\t}\n\t\tj2 += dx2;\n\t\tk2 += dy2;\n\t\tm2 += dz2;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bternary3d;\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* Apply a ternary callback to elements in three broadcasted input arrays and assign results to elements in a three-dimensional nested output array.\n*\n* @module @stdlib/array-base-broadcasted-ternary3d\n*\n* @example\n* var ones3d = require( '@stdlib/array-base-ones3d' );\n* var zeros3d = require( '@stdlib/array-base-zeros3d' );\n* var add = require( '@stdlib/number-float64-base-add3' );\n* var bternary3d = require( '@stdlib/array-base-broadcasted-ternary3d' );\n*\n* var shapes = [\n* [ 1, 2, 1 ],\n* [ 2, 1, 1 ],\n* [ 1, 1, 2 ],\n* [ 2, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = ones3d( shapes[ 1 ] );\n* var z = ones3d( shapes[ 2 ] );\n* var out = zeros3d( shapes[ 3 ] );\n*\n* bternary3d( [ x, y, z, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] , [ [ 3.0, 3.0 ], [ 3.0, 3.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,EAAiB,QAAS,oCAAqC,EAmCnE,SAASC,EAAYC,EAAQC,EAAQC,EAAM,CAC1C,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAMJ,GAJAR,EAAKhC,EAAQ,CAAE,EACfW,EAAKqB,EAAI,CAAE,EACXpB,EAAKoB,EAAI,CAAE,EACXnB,EAAKmB,EAAI,CAAE,EACN,EAAArB,GAAM,GAAKC,GAAM,GAAKC,GAAM,GA4BjC,IAzBAuB,EAAIvC,EAAgBE,EAAQ,CAAE,EAAGC,EAAQ,CAAE,EAAGgC,CAAG,EACjDK,EAAID,EAAE,KACNH,EAAKG,EAAE,QACPlC,EAAM+B,EAAI,CAAE,EACZ9B,EAAM8B,EAAI,CAAE,EACZ7B,EAAM6B,EAAI,CAAE,EAEZG,EAAIvC,EAAgBE,EAAQ,CAAE,EAAGC,EAAQ,CAAE,EAAGgC,CAAG,EACjDM,EAAIF,EAAE,KACNH,EAAKG,EAAE,QACP/B,EAAM4B,EAAI,CAAE,EACZ3B,EAAM2B,EAAI,CAAE,EACZ1B,EAAM0B,EAAI,CAAE,EAEZG,EAAIvC,EAAgBE,EAAQ,CAAE,EAAGC,EAAQ,CAAE,EAAGgC,CAAG,EACjDO,EAAIH,EAAE,KACNH,EAAKG,EAAE,QACP5B,EAAMyB,EAAI,CAAE,EACZxB,EAAMwB,EAAI,CAAE,EACZvB,EAAMuB,EAAI,CAAE,EAEZO,EAAIzC,EAAQ,CAAE,EACdoB,EAAK,EACLG,EAAK,EACLG,EAAK,EACCT,EAAK,EAAGA,EAAKH,EAAIG,IAAO,CAQ7B,IAPAE,EAAK,EACLG,EAAK,EACLG,EAAK,EACLG,EAAKU,EAAGlB,CAAG,EACXU,EAAKS,EAAGhB,CAAG,EACXS,EAAKQ,EAAGd,CAAG,EACXU,EAAKK,EAAGxB,CAAG,EACLD,EAAK,EAAGA,EAAKH,EAAIG,IAAO,CAQ7B,IAPAE,EAAK,EACLG,EAAK,EACLG,EAAK,EACLG,EAAKC,EAAIT,CAAG,EACZU,EAAKC,EAAIR,CAAG,EACZS,EAAKC,EAAIP,CAAG,EACZU,EAAKC,EAAIpB,CAAG,EACND,EAAK,EAAGA,EAAKH,EAAIG,IACtBoB,EAAIpB,CAAG,EAAIb,EAAKyB,EAAIT,CAAG,EAAGW,EAAIR,CAAG,EAAGU,EAAIP,CAAG,CAAE,EAC7CN,GAAMf,EACNkB,GAAMf,EACNkB,GAAMf,EAEPU,GAAMf,EACNkB,GAAMf,EACNkB,GAAMf,CACP,CACAU,GAAMf,EACNkB,GAAMf,EACNkB,GAAMf,CACP,CACD,CAKAd,EAAO,QAAUE,IClHjB,IAAI2C,EAAO,IAKX,OAAO,QAAUA",
- "names": ["require_main", "__commonJSMin", "exports", "module", "broadcastArray", "bternary3d", "arrays", "shapes", "fcn", "dx0", "dx1", "dx2", "dy0", "dy1", "dy2", "dz0", "dz1", "dz2", "S0", "S1", "S2", "i0", "i1", "i2", "j0", "j1", "j2", "k0", "k1", "k2", "m0", "m1", "m2", "x0", "x1", "y0", "y1", "z0", "z1", "sh", "st", "w0", "w1", "o", "x", "y", "z", "w", "main"]
-}
diff --git a/docs/repl.txt b/docs/repl.txt
deleted file mode 100644
index f7183ee..0000000
--- a/docs/repl.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-
-{{alias}}( arrays, shapes, fcn )
- Applies a ternary callback to elements in three broadcasted input arrays and
- assigns results to elements in a three-dimensional nested output array.
-
- Parameters
- ----------
- arrays: ArrayLikeObject
- Array-like object containing three input nested arrays and one output
- nested array.
-
- shapes: Array>
- Array shapes.
-
- fcn: Function
- Ternary callback.
-
- Examples
- --------
- > function fcn( x, y, z ) { return x + y + z };
- > var x = [ 1.0 ];
- > var y = [ [ 2.0 ], [ 3.0 ] ];
- > var z = [ [ [ 4.0 ], [ 6.0 ] ] ];
- > var out = [ [ [ 0.0 ], [ 0.0 ] ], [ [ 0.0 ], [ 0.0 ] ] ];
- > var shapes = [ [ 1 ], [ 2, 1 ], [ 1, 2, 1 ], [ 2, 2, 1 ] ];
- > {{alias}}( [ x, y, z, out ], shapes, fcn );
- > out
- [ [ [ 7.0 ], [ 10.0 ] ], [ [ 7.0 ], [ 10.0 ] ] ]
-
- See Also
- --------
-
diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts
deleted file mode 100644
index 4168aa3..0000000
--- a/docs/types/index.d.ts
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-* @license Apache-2.0
-*
-* Copyright (c) 2024 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-// TypeScript Version: 4.1
-
-///
-
-import { Array1D, Array2D, Array3D } from '@stdlib/types/array';
-import { Shape1D, Shape2D, Shape3D } from '@stdlib/types/ndarray';
-
-/**
-* Ternary callback.
-*
-* @param v1 - element from first input array
-* @param v2 - element from second input array
-* @param v3 - element from third input array
-* @returns result
-*/
-type Ternary = ( v1: T, v2: U, v3: V ) => W;
-
-/**
-* Input array.
-*/
-type InputArray = Array1D | Array2D | Array3D;
-
-/**
-* Input array shape.
-*/
-type InputArrayShape = Shape1D | Shape2D | Shape3D;
-
-/**
-* Output array.
-*/
-type OutputArray = Array3D;
-
-/**
-* Output array shape.
-*/
-type OutputArrayShape = Shape3D;
-
-/**
-* Input and output arrays.
-*/
-type InOutArrays = [
- InputArray,
- InputArray,
- InputArray,
- OutputArray
-];
-
-/**
-* Input and output array shapes.
-*/
-type InOutShapes = [
- InputArrayShape,
- InputArrayShape,
- InputArrayShape,
- OutputArrayShape
-];
-
-/**
-* Applies a ternary callback to elements in three broadcasted input arrays and assigns results to elements in a three-dimensional nested output array.
-*
-* ## Notes
-*
-* - The input array shapes must be broadcast compatible with the output array shape.
-*
-* @param arrays - array containing three input nested arrays and one output nested array
-* @param shapes - array shapes
-* @param fcn - ternary callback
-*
-* @example
-* var ones3d = require( '@stdlib/array-base-ones3d' );
-* var zeros3d = require( '@stdlib/array-base-zeros3d' );
-* var add = require( '@stdlib/number-float64-base-add3' );
-*
-* var shapes = [
-* [ 1, 2, 1 ],
-* [ 2, 1, 1 ],
-* [ 1, 1, 2 ],
-* [ 2, 2, 2 ]
-* ];
-*
-* var x = ones3d( shapes[ 0 ] );
-* var y = ones3d( shapes[ 1 ] );
-* var z = ones3d( shapes[ 2 ] );
-* var out = zeros3d( shapes[ 3 ] );
-*
-* bternary3d( [ x, y, z, out ], shapes, add );
-*
-* console.log( out );
-* // => [ [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ], [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] ]
-*/
-declare function bternary3d( arrays: InOutArrays, shapes: InOutShapes, fcn: Ternary ): void;
-
-
-// EXPORTS //
-
-export = bternary3d;
diff --git a/docs/types/test.ts b/docs/types/test.ts
deleted file mode 100644
index b1177e0..0000000
--- a/docs/types/test.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-* @license Apache-2.0
-*
-* Copyright (c) 2024 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-import bternary3d = require( './index' );
-
-/**
-* Ternary function.
-*
-* @param x - input value
-* @param y - input value
-* @param z - input value
-* @returns result
-*/
-function fcn( x: number, y: number, z: number ): number {
- return x + y + z;
-}
-
-
-// TESTS //
-
-// The function returns undefined...
-{
- const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
-
- const shapes: [ Array, Array, Array, Array ] = [ [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ] ];
-
- bternary3d( [ x, y, z, out ], shapes, fcn ); // $ExpectType void
- bternary3d( [ x[ 0 ][ 0 ], y, z, out ], [ [ shapes[ 0 ][ 2 ] ], shapes[ 1 ], shapes[ 2 ] , shapes[ 3 ] ], fcn ); // $ExpectType void
-}
-
-// The compiler throws an error if the function is provided a first argument which is not an array of nested arrays...
-{
- const shapes: [ Array, Array, Array, Array ] = [ [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ] ];
-
- bternary3d( 'abc', shapes, fcn ); // $ExpectError
- bternary3d( 3.14, shapes, fcn ); // $ExpectError
- bternary3d( true, shapes, fcn ); // $ExpectError
- bternary3d( false, shapes, fcn ); // $ExpectError
- bternary3d( null, shapes, fcn ); // $ExpectError
- bternary3d( [ '1' ], shapes, fcn ); // $ExpectError
- bternary3d( {}, shapes, fcn ); // $ExpectError
- bternary3d( ( x: number ): number => x, shapes, fcn ); // $ExpectError
-}
-
-// The compiler throws an error if the function is provided a second argument which is not an array of arrays...
-{
- const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
-
- bternary3d( [ x, y, z, out ], 'abc', fcn ); // $ExpectError
- bternary3d( [ x, y, z, out ], 3.14, fcn ); // $ExpectError
- bternary3d( [ x, y, z, out ], true, fcn ); // $ExpectError
- bternary3d( [ x, y, z, out ], false, fcn ); // $ExpectError
- bternary3d( [ x, y, z, out ], null, fcn ); // $ExpectError
- bternary3d( [ x, y, z, out ], [ '1' ], fcn ); // $ExpectError
- bternary3d( [ x, y, z, out ], {}, fcn ); // $ExpectError
- bternary3d( [ x, y, z, out ], ( x: number ): number => x, fcn ); // $ExpectError
-}
-
-// The compiler throws an error if the function is provided a third argument which is not a valid callback...
-{
- const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
-
- const shapes: [ Array, Array, Array, Array ] = [ [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ] ];
-
- bternary3d( [ x, y, z, out ], shapes, 'abc' ); // $ExpectError
- bternary3d( [ x, y, z, out ], shapes, 3.14 ); // $ExpectError
- bternary3d( [ x, y, z, out ], shapes, true ); // $ExpectError
- bternary3d( [ x, y, z, out ], shapes, false ); // $ExpectError
- bternary3d( [ x, y, z, out ], shapes, null ); // $ExpectError
- bternary3d( [ x, y, z, out ], shapes, [ '1' ] ); // $ExpectError
- bternary3d( [ x, y, z, out ], shapes, {} ); // $ExpectError
-}
-
-// The compiler throws an error if the function is provided an unsupported number of arguments...
-{
- const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
- const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
-
- const shapes: [ Array, Array, Array, Array ] = [ [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ] ];
-
- bternary3d(); // $ExpectError
- bternary3d( [ x, y, z, out ] ); // $ExpectError
- bternary3d( [ x, y, z, out ], shapes, fcn, {} ); // $ExpectError
-}
diff --git a/examples/index.js b/examples/index.js
deleted file mode 100644
index bad7e8d..0000000
--- a/examples/index.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2024 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-var discreteUniform = require( '@stdlib/random-base-discrete-uniform' ).factory;
-var filled3dBy = require( '@stdlib/array-base-filled3d-by' );
-var zeros3d = require( '@stdlib/array-base-zeros3d' );
-var add = require( '@stdlib/number-float64-base-add3' );
-var bternary3d = require( './../lib' );
-
-var shapes = [
- [ 1, 3, 1 ],
- [ 3, 1, 1 ],
- [ 1, 1, 3 ],
- [ 3, 3, 3 ]
-];
-
-var x = filled3dBy( shapes[ 0 ], discreteUniform( -100, 100 ) );
-console.log( x );
-
-var y = filled3dBy( shapes[ 1 ], discreteUniform( -100, 100 ) );
-console.log( y );
-
-var z = filled3dBy( shapes[ 2 ], discreteUniform( -100, 100 ) );
-console.log( z );
-
-var out = zeros3d( shapes[ 3 ] );
-console.log( out );
-
-bternary3d( [ x, y, z, out ], shapes, add );
-console.log( out );
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..c3d8f07
--- /dev/null
+++ b/index.js
@@ -0,0 +1,3 @@
+// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
+var e,r;e=this,r=function(){"use strict";function e(e){var r,i,a;for(i=e.length,r=[],a=0;a0&&(i-=1),a=n.toExponential(i)):a=n.toPrecision(e.precision),e.alternate||(a=f.call(a,m,"$1e"),a=f.call(a,w,"e"),a=f.call(a,u,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return a=f.call(a,d,"e+0$1"),a=f.call(a,l,"e-0$1"),e.alternate&&(a=f.call(a,h,"$1."),a=f.call(a,g,"$1.e")),n>=0&&e.sign&&(a=e.sign+a),a=e.specifier===p.call(e.specifier)?p.call(a):c.call(a)}function v(e){var r,i="";for(r=0;r127)throw new Error("invalid character code. Value: "+n.arg);n.arg=E(o)?String(n.arg):y(o)}break;case"e":case"E":case"f":case"F":case"g":case"G":r||(n.precision=6),n.arg=b(n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=a(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(l=n.arg,h=n.width,g=n.padRight,u=void 0,(u=h-l.length)<0?l:l=g?l+v(u):v(u)+l)),c+=n.arg||"",p+=1}return c}var S=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function $(e){var r={mapping:e[1]?parseInt(e[1],10):void 0,flags:e[2],width:e[3],precision:e[5],specifier:e[6]};return"."===e[4]&&void 0===e[5]&&(r.precision="1"),r}function V(e){var r,i,a,n;for(i=[],n=0,a=S.exec(e);a;)(r=e.slice(n,S.lastIndex-a[0].length)).length&&i.push(r),i.push($(a)),n=S.lastIndex,a=S.exec(e);return(r=e.slice(n)).length&&i.push(r),i}function A(e){var r,i;if("string"!=typeof e)throw new TypeError(A("invalid argument. First argument must be a string. Value: `%s`.",e));for(r=[V(e)],i=1;i=0;f--)if(!((d=c-o+f)<0)){if(p=i[d],0!==(t=a[f])&&t 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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\nimport formatInteger from './format_integer.js';\nimport isString from './is_string.js';\nimport formatDouble from './format_double.js';\nimport spacePad from './space_pad.js';\nimport zeroPad from './zero_pad.js';\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\ttokens.push( parse( match ) );\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nexport default formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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\nimport interpolate from '@stdlib/string-base-format-interpolate';\nimport tokenize from '@stdlib/string-base-format-tokenize';\nimport isString from './is_string.js';\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport copy from '@stdlib/array-base-copy-indexed';\nimport zeros from '@stdlib/array-base-zeros';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Broadcasts an array to a specified shape.\n*\n* @param {Collection} x - input array\n* @param {NonNegativeIntegerArray} inShape - input array shape\n* @param {NonNegativeIntegerArray} outShape - output array shape\n* @throws {Error} input array cannot have more dimensions than the desired shape\n* @throws {Error} input array dimension sizes must be `1` or equal to the corresponding dimension in the provided output shape\n* @throws {Error} input array and desired shape must be broadcast compatible\n* @returns {Object} broadcast object\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = broadcastArray( x, [ 2 ], [ 2, 2 ] );\n* // returns {...}\n*\n* var shape = out.shape;\n* // returns [ 2, 2 ]\n*\n* var strides = out.strides;\n* // returns [ 0, 1 ]\n*\n* var ref = out.ref;\n* // returns [ 1, 2 ]\n*\n* var bool = ( x === ref );\n* // returns true\n*\n* var data = out.data;\n* // returns [ [ 1, 2 ] ]\n*\n* @example\n* var x = [ 1, 2 ];\n*\n* var out = broadcastArray( x, [ 2 ], [ 2, 1, 2 ] );\n* // returns {...}\n*\n* var data = out.data;\n* // returns [ [ [ 1, 2 ] ] ]\n*\n* var strides = out.strides;\n* // returns [ 0, 0, 1 ]\n*\n* @example\n* var x = [ [ 1 ], [ 2 ] ];\n*\n* var out = broadcastArray( x, [ 2, 1 ], [ 3, 2, 2 ] );\n* // returns {...}\n*\n* var data = out.data;\n* // returns [ [ [ 1 ], [ 2 ] ] ]\n*\n* var strides = out.strides;\n* // returns [ 0, 1, 0 ]\n*/\nfunction broadcastArray( x, inShape, outShape ) {\n\tvar data;\n\tvar dim;\n\tvar st;\n\tvar N;\n\tvar M;\n\tvar d;\n\tvar i;\n\tvar j;\n\n\tN = outShape.length;\n\tM = inShape.length;\n\tif ( N < M ) {\n\t\tthrow new Error( 'invalid argument. Cannot broadcast an array to a shape having fewer dimensions. Arrays can only be broadcasted to shapes having the same or more dimensions.' );\n\t}\n\t// Prepend additional dimensions...\n\tdata = x;\n\tfor ( i = M; i < N; i++ ) {\n\t\tdata = [ data ];\n\t}\n\n\t// Initialize a strides array:\n\tst = zeros( N );\n\n\t// Determine the output array strides...\n\tfor ( i = N-1; i >= 0; i-- ) {\n\t\tj = M - N + i;\n\t\tif ( j < 0 ) {\n\t\t\t// Prepended singleton dimension; stride is zero...\n\t\t\tcontinue;\n\t\t}\n\t\td = inShape[ j ];\n\t\tdim = outShape[ i ];\n\t\tif ( dim !== 0 && dim < d ) {\n\t\t\tthrow new Error( format( 'invalid argument. Input array cannot be broadcast to the specified shape, as the specified shape has a dimension whose size is less than the size of the corresponding dimension in the input array. Array shape: (%s). Desired shape: (%s). Dimension: %u.', copy( inShape ).join( ', ' ), copy( outShape ).join( ', ' ), i ) );\n\t\t}\n\t\tif ( d === dim ) {\n\t\t\t// As the dimension sizes are equal, the stride is one, meaning that each element in the array should be iterated over as normal...\n\t\t\tst[ i ] = 1;\n\t\t} else if ( d === 1 ) {\n\t\t\t// In order to broadcast a dimension, we set the stride for that dimension to zero...\n\t\t\tst[ i ] = 0;\n\t\t} else {\n\t\t\t// At this point, we know that `dim > d` and that `d` does not equal `1` (e.g., `dim=3` and `d=2`); in which case, the shapes are considered incompatible (even for desired shapes which are multiples of array dimensions, as might be desired when \"tiling\" an array; e.g., `dim=4` and `d=2`)...\n\t\t\tthrow new Error( format( 'invalid argument. Input array and the specified shape are broadcast incompatible. Array shape: (%s). Desired shape: (%s). Dimension: %u.', copy( inShape ).join( ', ' ), copy( outShape ).join( ', ' ), i ) );\n\t\t}\n\t}\n\t// Return broadcast results:\n\treturn {\n\t\t'ref': x, // reference to the original input array\n\t\t'data': data, // broadcasted array\n\t\t'shape': copy( outShape ), // copy in order to prevent mutation\n\t\t'strides': st\n\t};\n}\n\n\n// EXPORTS //\n\nexport default broadcastArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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// MAIN //\n\n/**\n* Returns a filled \"generic\" array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} filled array\n*\n* @example\n* var out = filled( 0.0, 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = filled( 'beep', 3 );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\nfunction filled( value, len ) {\n\tvar arr;\n\tvar i;\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tarr.push( value );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nexport default filled;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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\nimport filled from '@stdlib/array-base-filled';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled \"generic\" array.\n*\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} output array\n*\n* @example\n* var out = zeros( 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\nfunction zeros( len ) {\n\treturn filled( 0.0, len );\n}\n\n\n// EXPORTS //\n\nexport default zeros;\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// MODULES //\n\nimport broadcastArray from '@stdlib/array-base-broadcast-array';\n\n\n// MAIN //\n\n/**\n* Applies a ternary callback to elements in three broadcasted input arrays and assigns results to elements in a three-dimensional nested output array.\n*\n* @param {ArrayLikeObject>} arrays - array-like object containing three input nested arrays and one output nested array\n* @param {ArrayLikeObject} shapes - array shapes\n* @param {Callback} fcn - ternary callback\n* @returns {void}\n*\n* @example\n* import ones3d from '@stdlib/array-base-ones3d';\n* import zeros3d from '@stdlib/array-base-zeros3d';\n* import add from '@stdlib/number-float64-base-add3';\n*\n* var shapes = [\n* [ 1, 2, 1 ],\n* [ 2, 1, 1 ],\n* [ 1, 1, 2 ],\n* [ 2, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = ones3d( shapes[ 1 ] );\n* var z = ones3d( shapes[ 2 ] );\n* var out = zeros3d( shapes[ 3 ] );\n*\n* bternary3d( [ x, y, z, out ], shapes, add );\n*\n* console.log( out );\n* // => [ [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] , [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] ]\n*/\nfunction bternary3d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\n\tvar dz0;\n\tvar dz1;\n\tvar dz2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar k0;\n\tvar k1;\n\tvar k2;\n\tvar m0;\n\tvar m1;\n\tvar m2;\n\tvar x0;\n\tvar x1;\n\tvar y0;\n\tvar y1;\n\tvar z0;\n\tvar z1;\n\tvar sh;\n\tvar st;\n\tvar w0;\n\tvar w1;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\tvar w;\n\n\tsh = shapes[ 3 ];\n\tS0 = sh[ 2 ];\n\tS1 = sh[ 1 ];\n\tS2 = sh[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {\n\t\treturn;\n\t}\n\to = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );\n\tx = o.data;\n\tst = o.strides;\n\tdx0 = st[ 2 ];\n\tdx1 = st[ 1 ];\n\tdx2 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );\n\ty = o.data;\n\tst = o.strides;\n\tdy0 = st[ 2 ];\n\tdy1 = st[ 1 ];\n\tdy2 = st[ 0 ];\n\n\to = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );\n\tz = o.data;\n\tst = o.strides;\n\tdz0 = st[ 2 ];\n\tdz1 = st[ 1 ];\n\tdz2 = st[ 0 ];\n\n\tw = arrays[ 3 ];\n\tj2 = 0;\n\tk2 = 0;\n\tm2 = 0;\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tj1 = 0;\n\t\tk1 = 0;\n\t\tm1 = 0;\n\t\tx1 = x[ j2 ];\n\t\ty1 = y[ k2 ];\n\t\tz1 = z[ m2 ];\n\t\tw1 = w[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tj0 = 0;\n\t\t\tk0 = 0;\n\t\t\tm0 = 0;\n\t\t\tx0 = x1[ j1 ];\n\t\t\ty0 = y1[ k1 ];\n\t\t\tz0 = z1[ m1 ];\n\t\t\tw0 = w1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tw0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ] );\n\t\t\t\tj0 += dx0;\n\t\t\t\tk0 += dy0;\n\t\t\t\tm0 += dz0;\n\t\t\t}\n\t\t\tj1 += dx1;\n\t\t\tk1 += dy1;\n\t\t\tm1 += dz1;\n\t\t}\n\t\tj2 += dx2;\n\t\tk2 += dy2;\n\t\tm2 += dz2;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default bternary3d;\n"],"names":["copy","x","out","len","i","length","push","isNumber","value","zeros","n","zeroPad","str","width","right","negative","pad","startsWithMinus","substr","lowercase","String","prototype","toLowerCase","uppercase","toUpperCase","formatInteger","token","base","specifier","arg","parseInt","isFinite","Error","toString","precision","padRight","sign","alternate","call","charAt","abs","Math","replace","RE_EXP_POS_DIGITS","RE_EXP_NEG_DIGITS","RE_ONLY_DIGITS","RE_DIGITS_BEFORE_EXP","RE_TRAILING_PERIOD_ZERO","RE_PERIOD_ZERO_EXP","RE_ZERO_BEFORE_EXP","formatDouble","digits","f","parseFloat","toExponential","toFixed","toPrecision","spaces","fromCharCode","isArray","Array","isnan","initialize","flags","mapping","formatInterpolate","tokens","hasPeriod","flag","num","pos","j","TypeError","padZeros","indexOf","arguments","maxWidth","substring","RE","parse","match","formatTokenize","content","prev","exec","slice","lastIndex","format","args","tokenize","interpolate","apply","broadcastArray","inShape","outShape","data","dim","st","N","M","d","arr","filled","join","ref","shape","strides","arrays","shapes","fcn","dx0","dx1","dx2","dy0","dy1","dy2","dz0","dz1","dz2","S0","S1","S2","i0","i1","i2","j0","j1","j2","k0","k1","k2","m0","m1","m2","x0","x1","y0","y1","z0","z1","sh","w0","w1","o","y","z","w"],"mappings":";yCAgCA,SAASA,EAAMC,GACd,IAAIC,EACAC,EACAC,EAIJ,IAFAD,EAAMF,EAAEI,OACRH,EAAM,GACAE,EAAI,EAAGA,EAAID,EAAKC,IACrBF,EAAII,KAAML,EAAGG,IAEd,OA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,EAAInD,EAAgBe,EAAQ,GAAKC,EAAQ,GAAKgC,IACxC7C,KAENqB,GADAnB,EAAK8C,EAAErC,SACG,GACVW,EAAMpB,EAAI,GACVqB,EAAMrB,EAAI,GAEViD,EAAIvC,EAAQ,GACZoB,EAAK,EACLG,EAAK,EACLG,EAAK,EACCT,EAAK,EAAGA,EAAKH,EAAIG,IAAO,CAQ7B,IAPAE,EAAK,EACLG,EAAK,EACLG,EAAK,EACLG,EAAKtI,EAAG8H,GACRU,EAAKO,EAAGd,GACRS,EAAKM,EAAGZ,GACRS,EAAKI,EAAGtB,GACFD,EAAK,EAAGA,EAAKH,EAAIG,IAAO,CAQ7B,IAPAE,EAAK,EACLG,EAAK,EACLG,EAAK,EACLG,EAAKC,EAAIT,GACTU,EAAKC,EAAIR,GACTS,EAAKC,EAAIP,GACTS,EAAKC,EAAInB,GACHD,EAAK,EAAGA,EAAKH,EAAIG,IACtBmB,EAAInB,GAAOb,EAAKyB,EAAIT,GAAMW,EAAIR,GAAMU,EAAIP,IACxCN,GAAMf,EACNkB,GAAMf,EACNkB,GAAMf,EAEPU,GAAMf,EACNkB,GAAMf,EACNkB,GAAMf,CACN,CACDU,GAAMf,EACNkB,GAAMf,EACNkB,GAAMf,CACN,CACF","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13]}
\ No newline at end of file
diff --git a/lib/index.js b/lib/index.js
deleted file mode 100644
index 27e22a2..0000000
--- a/lib/index.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2024 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-/**
-* Apply a ternary callback to elements in three broadcasted input arrays and assign results to elements in a three-dimensional nested output array.
-*
-* @module @stdlib/array-base-broadcasted-ternary3d
-*
-* @example
-* var ones3d = require( '@stdlib/array-base-ones3d' );
-* var zeros3d = require( '@stdlib/array-base-zeros3d' );
-* var add = require( '@stdlib/number-float64-base-add3' );
-* var bternary3d = require( '@stdlib/array-base-broadcasted-ternary3d' );
-*
-* var shapes = [
-* [ 1, 2, 1 ],
-* [ 2, 1, 1 ],
-* [ 1, 1, 2 ],
-* [ 2, 2, 2 ]
-* ];
-*
-* var x = ones3d( shapes[ 0 ] );
-* var y = ones3d( shapes[ 1 ] );
-* var z = ones3d( shapes[ 2 ] );
-* var out = zeros3d( shapes[ 3 ] );
-*
-* bternary3d( [ x, y, z, out ], shapes, add );
-*
-* console.log( out );
-* // => [ [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] , [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] ]
-*/
-
-// MODULES //
-
-var main = require( './main.js' );
-
-
-// EXPORTS //
-
-module.exports = main;
diff --git a/lib/main.js b/lib/main.js
deleted file mode 100644
index 0f6de21..0000000
--- a/lib/main.js
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2024 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var broadcastArray = require( '@stdlib/array-base-broadcast-array' );
-
-
-// MAIN //
-
-/**
-* Applies a ternary callback to elements in three broadcasted input arrays and assigns results to elements in a three-dimensional nested output array.
-*
-* @param {ArrayLikeObject>} arrays - array-like object containing three input nested arrays and one output nested array
-* @param {ArrayLikeObject} shapes - array shapes
-* @param {Callback} fcn - ternary callback
-* @returns {void}
-*
-* @example
-* var ones3d = require( '@stdlib/array-base-ones3d' );
-* var zeros3d = require( '@stdlib/array-base-zeros3d' );
-* var add = require( '@stdlib/number-float64-base-add3' );
-*
-* var shapes = [
-* [ 1, 2, 1 ],
-* [ 2, 1, 1 ],
-* [ 1, 1, 2 ],
-* [ 2, 2, 2 ]
-* ];
-*
-* var x = ones3d( shapes[ 0 ] );
-* var y = ones3d( shapes[ 1 ] );
-* var z = ones3d( shapes[ 2 ] );
-* var out = zeros3d( shapes[ 3 ] );
-*
-* bternary3d( [ x, y, z, out ], shapes, add );
-*
-* console.log( out );
-* // => [ [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] , [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] ]
-*/
-function bternary3d( arrays, shapes, fcn ) {
- var dx0;
- var dx1;
- var dx2;
- var dy0;
- var dy1;
- var dy2;
- var dz0;
- var dz1;
- var dz2;
- var S0;
- var S1;
- var S2;
- var i0;
- var i1;
- var i2;
- var j0;
- var j1;
- var j2;
- var k0;
- var k1;
- var k2;
- var m0;
- var m1;
- var m2;
- var x0;
- var x1;
- var y0;
- var y1;
- var z0;
- var z1;
- var sh;
- var st;
- var w0;
- var w1;
- var o;
- var x;
- var y;
- var z;
- var w;
-
- sh = shapes[ 3 ];
- S0 = sh[ 2 ];
- S1 = sh[ 1 ];
- S2 = sh[ 0 ];
- if ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {
- return;
- }
- o = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );
- x = o.data;
- st = o.strides;
- dx0 = st[ 2 ];
- dx1 = st[ 1 ];
- dx2 = st[ 0 ];
-
- o = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );
- y = o.data;
- st = o.strides;
- dy0 = st[ 2 ];
- dy1 = st[ 1 ];
- dy2 = st[ 0 ];
-
- o = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );
- z = o.data;
- st = o.strides;
- dz0 = st[ 2 ];
- dz1 = st[ 1 ];
- dz2 = st[ 0 ];
-
- w = arrays[ 3 ];
- j2 = 0;
- k2 = 0;
- m2 = 0;
- for ( i2 = 0; i2 < S2; i2++ ) {
- j1 = 0;
- k1 = 0;
- m1 = 0;
- x1 = x[ j2 ];
- y1 = y[ k2 ];
- z1 = z[ m2 ];
- w1 = w[ i2 ];
- for ( i1 = 0; i1 < S1; i1++ ) {
- j0 = 0;
- k0 = 0;
- m0 = 0;
- x0 = x1[ j1 ];
- y0 = y1[ k1 ];
- z0 = z1[ m1 ];
- w0 = w1[ i1 ];
- for ( i0 = 0; i0 < S0; i0++ ) {
- w0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ] );
- j0 += dx0;
- k0 += dy0;
- m0 += dz0;
- }
- j1 += dx1;
- k1 += dy1;
- m1 += dz1;
- }
- j2 += dx2;
- k2 += dy2;
- m2 += dz2;
- }
-}
-
-
-// EXPORTS //
-
-module.exports = bternary3d;
diff --git a/package.json b/package.json
index 421f370..5ff6fe9 100644
--- a/package.json
+++ b/package.json
@@ -3,31 +3,7 @@
"version": "0.0.0",
"description": "Apply a ternary callback to elements in three broadcasted input arrays and assign results to elements in a three-dimensional nested output array.",
"license": "Apache-2.0",
- "author": {
- "name": "The Stdlib Authors",
- "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
- },
- "contributors": [
- {
- "name": "The Stdlib Authors",
- "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
- }
- ],
- "main": "./lib",
- "directories": {
- "benchmark": "./benchmark",
- "doc": "./docs",
- "example": "./examples",
- "lib": "./lib",
- "test": "./test"
- },
- "types": "./docs/types",
- "scripts": {
- "test": "make test",
- "test-cov": "make test-cov",
- "examples": "make examples",
- "benchmark": "make benchmark"
- },
+ "main": "./index.js",
"homepage": "https://stdlib.io",
"repository": {
"type": "git",
@@ -36,40 +12,6 @@
"bugs": {
"url": "https://github.com/stdlib-js/stdlib/issues"
},
- "dependencies": {
- "@stdlib/array-base-broadcast-array": "^0.2.2",
- "@stdlib/types": "^0.4.3"
- },
- "devDependencies": {
- "@stdlib/array-base-filled3d-by": "^0.2.2",
- "@stdlib/array-base-zeros3d": "^0.2.2",
- "@stdlib/math-base-assert-is-nan": "^0.2.2",
- "@stdlib/math-base-special-floor": "^0.2.3",
- "@stdlib/math-base-special-pow": "^0.3.0",
- "@stdlib/ndarray-base-numel": "^0.2.2",
- "@stdlib/number-float64-base-add3": "github:stdlib-js/number-float64-base-add3#main",
- "@stdlib/random-base-discrete-uniform": "^0.2.1",
- "@stdlib/random-base-uniform": "^0.2.1",
- "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
- "istanbul": "^0.4.1",
- "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
- "@stdlib/bench-harness": "^0.2.2"
- },
- "engines": {
- "node": ">=0.10.0",
- "npm": ">2.7.0"
- },
- "os": [
- "aix",
- "darwin",
- "freebsd",
- "linux",
- "macos",
- "openbsd",
- "sunos",
- "win32",
- "windows"
- ],
"keywords": [
"stdlib",
"base",
@@ -85,7 +27,6 @@
"transform",
"broadcast"
],
- "__stdlib__": {},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/stdlib"
diff --git a/stats_browser.html b/stats_browser.html
new file mode 100644
index 0000000..41d16e3
--- /dev/null
+++ b/stats_browser.html
@@ -0,0 +1,4842 @@
+
+
+
+
+
+
+
+ Rollup Visualizer
+
+
+
+
+
+
+
+
+
diff --git a/stats_node.html b/stats_node.html
new file mode 100644
index 0000000..29373ea
--- /dev/null
+++ b/stats_node.html
@@ -0,0 +1,4842 @@
+
+
+
+
+
+
+
+ Rollup Visualizer
+
+
+
+
+
+
+
+
+
diff --git a/test/dist/test.js b/test/dist/test.js
deleted file mode 100644
index a8a9c60..0000000
--- a/test/dist/test.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2023 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var tape = require( 'tape' );
-var main = require( './../../dist' );
-
-
-// TESTS //
-
-tape( 'main export is defined', function test( t ) {
- t.ok( true, __filename );
- t.strictEqual( main !== void 0, true, 'main export is defined' );
- t.end();
-});
diff --git a/test/test.js b/test/test.js
deleted file mode 100644
index 9c5593e..0000000
--- a/test/test.js
+++ /dev/null
@@ -1,266 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2024 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-'use strict';
-
-// MODULES //
-
-var tape = require( 'tape' );
-var add = require( '@stdlib/number-float64-base-add3' );
-var zeros3d = require( '@stdlib/array-base-zeros3d' );
-var bternary3d = require( './../lib' );
-
-
-// TESTS //
-
-tape( 'main export is a function', function test( t ) {
- t.ok( true, __filename );
- t.strictEqual( typeof bternary3d, 'function', 'main export is a function' );
- t.end();
-});
-
-tape( 'the function applies a provided callback to broadcasted input arrays and assigns results to a nested output array', function test( t ) {
- var expected;
- var shapes;
- var x;
- var y;
- var z;
- var w;
-
- shapes = [
- [ 2 ],
- [ 2, 1 ],
- [ 2, 1, 2 ],
- [ 2, 2, 2 ]
- ];
- x = [ 1.0, 2.0 ];
- y = [
- [ 3.0 ],
- [ 4.0 ]
- ];
- z = [
- [
- [ 2.0, 3.0 ]
- ],
- [
- [ 4.0, 4.0 ]
- ]
- ];
- w = zeros3d( shapes[ 3 ] );
-
- expected = [
- [
- [ 6.0, 8.0 ],
- [ 7.0, 9.0 ]
- ],
- [
- [ 8.0, 9.0 ],
- [ 9.0, 10.0 ]
- ]
- ];
- bternary3d( [ x, y, z, w ], shapes, add );
- t.deepEqual( w, expected, 'returns expected value' );
-
- shapes = [
- [ 1, 2 ],
- [ 2 ],
- [ 1, 1, 1 ],
- [ 2, 2, 2 ]
- ];
- x = [
- [ 1.0, 2.0 ]
- ];
- y = [ 3.0, 4.0 ];
- z = [
- [
- [ 5.0 ]
- ]
- ];
- w = zeros3d( shapes[ 3 ] );
-
- expected = [
- [
- [ 9.0, 11.0 ],
- [ 9.0, 11.0 ]
- ],
- [
- [ 9.0, 11.0 ],
- [ 9.0, 11.0 ]
- ]
- ];
- bternary3d( [ x, y, z, w ], shapes, add );
- t.deepEqual( w, expected, 'returns expected value' );
-
- // Same shapes:
- shapes = [
- [ 2, 2, 2 ],
- [ 2, 2, 2 ],
- [ 2, 2, 2 ],
- [ 2, 2, 2 ]
- ];
- x = [
- [
- [ 1.0, 2.0 ],
- [ 3.0, 4.0 ]
- ],
- [
- [ 1.0, 2.0 ],
- [ 3.0, 4.0 ]
- ]
- ];
- y = [
- [
- [ 1.0, 2.0 ],
- [ 3.0, 4.0 ]
- ],
- [
- [ 1.0, 2.0 ],
- [ 3.0, 4.0 ]
- ]
- ];
- z = [
- [
- [ 1.0, 2.0 ],
- [ 3.0, 4.0 ]
- ],
- [
- [ 1.0, 2.0 ],
- [ 3.0, 4.0 ]
- ]
- ];
- w = zeros3d( shapes[ 3 ] );
-
- expected = [
- [
- [ 3.0, 6.0 ],
- [ 9.0, 12.0 ]
- ],
- [
- [ 3.0, 6.0 ],
- [ 9.0, 12.0 ]
- ]
- ];
- bternary3d( [ x, y, z, w ], shapes, add );
- t.deepEqual( w, expected, 'returns expected value' );
-
- t.end();
-});
-
-tape( 'the function does not invoke a provided callback if provided an output shape having a first element equal to zero', function test( t ) {
- var expected;
- var shapes;
- var x;
- var y;
- var z;
- var w;
-
- shapes = [
- [ 1, 2, 2 ],
- [ 1, 2, 2 ],
- [ 1, 2, 2 ],
- [ 0, 2, 2 ]
- ];
- x = [
- [
- [ 1.0, 2.0 ],
- [ 3.0, 4.0 ]
- ]
- ];
- y = x;
- z = x;
- w = zeros3d( [ 2, 2, 2 ] );
-
- expected = zeros3d( [ 2, 2, 2 ] );
- bternary3d( [ x, y, z, w ], shapes, clbk );
- t.deepEqual( w, expected, 'returns expected value' );
-
- t.end();
-
- function clbk() {
- t.ok( false, 'should not invoke callback' );
- }
-});
-
-tape( 'the function does not invoke a provided callback if provided an output shape having a second element equal to zero', function test( t ) {
- var expected;
- var shapes;
- var x;
- var y;
- var z;
- var w;
-
- shapes = [
- [ 1, 2, 2 ],
- [ 1, 2, 2 ],
- [ 1, 2, 2 ],
- [ 2, 0, 2 ]
- ];
- x = [
- [
- [ 1.0, 2.0 ],
- [ 3.0, 4.0 ]
- ]
- ];
- y = x;
- z = x;
- w = zeros3d( [ 2, 2, 2 ] );
-
- expected = zeros3d( [ 2, 2, 2 ] );
- bternary3d( [ x, y, z, w ], shapes, clbk );
- t.deepEqual( w, expected, 'returns expected value' );
-
- t.end();
-
- function clbk() {
- t.ok( false, 'should not invoke callback' );
- }
-});
-
-tape( 'the function does not invoke a provided callback if provided an output shape having a third element equal to zero', function test( t ) {
- var expected;
- var shapes;
- var x;
- var y;
- var z;
- var w;
-
- shapes = [
- [ 1, 2, 2 ],
- [ 1, 2, 2 ],
- [ 1, 2, 2 ],
- [ 2, 2, 0 ]
- ];
- x = [
- [
- [ 1.0, 2.0 ],
- [ 3.0, 4.0 ]
- ]
- ];
- y = x;
- z = x;
- w = zeros3d( [ 2, 2, 2 ] );
-
- expected = zeros3d( [ 2, 2, 2 ] );
- bternary3d( [ x, y, z, w ], shapes, clbk );
- t.deepEqual( w, expected, 'returns expected value' );
-
- t.end();
-
- function clbk() {
- t.ok( false, 'should not invoke callback' );
- }
-});