@stdlib/strided-base-binary-addon-dispatch 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -362,8 +362,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
362
362
  [npm-image]: http://img.shields.io/npm/v/@stdlib/strided-base-binary-addon-dispatch.svg
363
363
  [npm-url]: https://npmjs.org/package/@stdlib/strided-base-binary-addon-dispatch
364
364
 
365
- [test-image]: https://github.com/stdlib-js/strided-base-binary-addon-dispatch/actions/workflows/test.yml/badge.svg?branch=v0.2.1
366
- [test-url]: https://github.com/stdlib-js/strided-base-binary-addon-dispatch/actions/workflows/test.yml?query=branch:v0.2.1
365
+ [test-image]: https://github.com/stdlib-js/strided-base-binary-addon-dispatch/actions/workflows/test.yml/badge.svg?branch=v0.3.0
366
+ [test-url]: https://github.com/stdlib-js/strided-base-binary-addon-dispatch/actions/workflows/test.yml?query=branch:v0.3.0
367
367
 
368
368
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/strided-base-binary-addon-dispatch/main.svg
369
369
  [coverage-url]: https://codecov.io/github/stdlib-js/strided-base-binary-addon-dispatch?branch=main
package/dist/index.js CHANGED
@@ -1,7 +1,36 @@
1
- "use strict";var j=function(m,u){return function(){return u||m((u={exports:{}}).exports,u),u.exports}};var J=j(function(X,H){
2
- var D=require('@stdlib/assert-is-function/dist'),O=require('@stdlib/assert-is-typed-array-like/dist'),q=require('@stdlib/strided-base-dtype-resolve-enum/dist'),b=require('@stdlib/strided-base-reinterpret-complex64/dist'),p=require('@stdlib/strided-base-reinterpret-complex128/dist'),G=require('@stdlib/error-tools-fmtprodmsg/dist'),F=q("complex64"),P=q("complex128");function $(m,u){if(!D(m))throw new TypeError(G('1Md3c',m));if(!D(u))throw new TypeError(G('1Md2H',u));return L;function L(s,i,l,c,r,n,w,o,e,t){var v,g,a;if(!O(l)||!O(n)||!O(e))return u(s,i,l,c,r,n,w,o,e,t),e;if(i=q(i),r=q(r),o=q(o),i===null||r===null||o===null)throw new TypeError(h('1Md1L'));return i===F?v=b(l,0):i===P?v=p(l,0):v=l,r===F?g=b(n,0):r===P?g=p(n,0):g=n,o===F?a=b(e,0):o===P?a=p(e,0):a=e,m(s,i,v,c,r,g,w,o,a,t),e}}H.exports=$
3
- });var W=j(function(y,Q){
4
- var K=require('@stdlib/assert-is-function/dist'),x=require('@stdlib/assert-is-typed-array-like/dist'),M=require('@stdlib/assert-is-nonnegative-integer/dist').isPrimitive,E=require('@stdlib/strided-base-dtype-resolve-enum/dist'),S=require('@stdlib/strided-base-reinterpret-complex64/dist'),A=require('@stdlib/strided-base-reinterpret-complex128/dist'),I=require('@stdlib/strided-base-offset-view/dist'),U=require('@stdlib/strided-base-min-view-buffer-index/dist'),h=require('@stdlib/error-tools-fmtprodmsg/dist'),B=E("complex64"),R=E("complex128");function f(m,u){if(!K(m))throw new TypeError(h('1Md3c',m));if(!K(u))throw new TypeError(h('1Md2H',u));return L;function L(s,i,l,c,r,n,w,o,e,t,v,g,a){var T,V,C;if(!x(l)||!x(w)||!x(v))return u(s,i,l,c,r,n,w,o,e,t,v,g,a),v;if(i=E(i),n=E(n),t=E(t),i===null||n===null||t===null)throw new TypeError(h('1Md1L'));if(!M(r))throw new TypeError(h('1MdAC',r));if(!M(e))throw new TypeError(h('1MdAD',e));if(!M(a))throw new TypeError(h('1MdAE',a));return r=U(s,c,r),e=U(s,o,e),a=U(s,g,a),i===B?T=S(l,r):i===R?T=A(l,r):T=I(l,r),n===B?V=S(w,e):n===R?V=A(w,e):V=I(w,e),t===B?C=S(v,a):t===R?C=A(v,a):C=I(v,a),m(s,i,T,c,n,V,o,t,C,g),v}}Q.exports=f
5
- });var k=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),_=J(),N=W();k(_,"ndarray",N);module.exports=_;
6
- /** @license Apache-2.0 */
1
+ "use strict";var J=function(m,l){return function(){return l||m((l={exports:{}}).exports,l),l.exports}};var _=J(function(y,W){"use strict";var K=require("@stdlib/assert-is-function"),L=require("@stdlib/assert-is-typed-array-like"),q=require("@stdlib/strided-base-dtype-resolve-enum"),b=require("@stdlib/strided-base-reinterpret-complex64"),B=require("@stdlib/strided-base-reinterpret-complex128"),F=require("@stdlib/strided-base-reinterpret-boolean"),Q=require("@stdlib/string-format"),P=q("complex64"),A=q("complex128"),M=q("bool");function z(m,l){if(!K(m))throw new TypeError(Q("invalid argument. First argument must be a function. Value: `%s`.",m));if(!K(l))throw new TypeError(Q("invalid argument. Second argument must be a function. Value: `%s`.",l));return C;function C(g,i,v,c,r,n,t,o,e,s){var u,w,a;if(!L(v)||!L(n)||!L(e))return l(g,i,v,c,r,n,t,o,e,s),e;if(i=q(i),r=q(r),o=q(o),i===null||r===null||o===null)throw new TypeError("invalid arguments. Unable to resolve a strided array function supporting the provided array argument data types.");return i===P?u=b(v,0):i===A?u=B(v,0):i===M?u=F(v,0):u=v,r===P?w=b(n,0):r===A?w=B(n,0):r===M?w=F(n,0):w=n,o===P?a=b(e,0):o===A?a=B(e,0):o===M?a=F(e,0):a=e,m(g,i,u,c,r,w,t,o,a,s),e}}W.exports=z});var N=J(function(rr,f){"use strict";var $=require("@stdlib/assert-is-function"),S=require("@stdlib/assert-is-typed-array-like"),x=require("@stdlib/assert-is-nonnegative-integer").isPrimitive,h=require("@stdlib/strided-base-dtype-resolve-enum"),I=require("@stdlib/strided-base-reinterpret-complex64"),U=require("@stdlib/strided-base-reinterpret-complex128"),p=require("@stdlib/strided-base-reinterpret-boolean"),R=require("@stdlib/strided-base-offset-view"),j=require("@stdlib/strided-base-min-view-buffer-index"),V=require("@stdlib/string-format"),D=h("complex64"),G=h("complex128"),H=h("bool");function X(m,l){if(!$(m))throw new TypeError(V("invalid argument. First argument must be a function. Value: `%s`.",m));if(!$(l))throw new TypeError(V("invalid argument. Second argument must be a function. Value: `%s`.",l));return C;function C(g,i,v,c,r,n,t,o,e,s,u,w,a){var E,T,O;if(!S(v)||!S(t)||!S(u))return l(g,i,v,c,r,n,t,o,e,s,u,w,a),u;if(i=h(i),n=h(n),s=h(s),i===null||n===null||s===null)throw new TypeError("invalid arguments. Unable to resolve a strided array function supporting the provided array argument data types.");if(!x(r))throw new TypeError(V("invalid argument. First input array offset must be a nonnegative integer. Value: `%s`.",r));if(!x(e))throw new TypeError(V("invalid argument. Second input array offset must be a nonnegative integer. Value: `%s`.",e));if(!x(a))throw new TypeError(V("invalid argument. Output array offset must be a nonnegative integer. Value: `%s`.",a));return r=j(g,c,r),e=j(g,o,e),a=j(g,w,a),i===D?E=I(v,r):i===G?E=U(v,r):i===H?E=p(v,r):E=R(v,r),n===D?T=I(t,e):n===G?T=U(t,e):n===H?T=p(t,e):T=R(t,e),s===D?O=I(u,a):s===G?O=U(u,a):s===H?O=p(u,a):O=R(u,a),m(g,i,E,c,n,T,o,s,O,w),u}}f.exports=X});var Y=require("@stdlib/utils-define-nonenumerable-read-only-property"),k=_(),Z=N();Y(k,"ndarray",Z);module.exports=k;
2
+ /**
3
+ * @license Apache-2.0
4
+ *
5
+ * Copyright (c) 2024 The Stdlib Authors.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ /**
20
+ * @license Apache-2.0
21
+ *
22
+ * Copyright (c) 2021 The Stdlib Authors.
23
+ *
24
+ * Licensed under the Apache License, Version 2.0 (the "License");
25
+ * you may not use this file except in compliance with the License.
26
+ * You may obtain a copy of the License at
27
+ *
28
+ * http://www.apache.org/licenses/LICENSE-2.0
29
+ *
30
+ * Unless required by applicable law or agreed to in writing, software
31
+ * distributed under the License is distributed on an "AS IS" BASIS,
32
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33
+ * See the License for the specific language governing permissions and
34
+ * limitations under the License.
35
+ */
7
36
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../lib/main.js", "../lib/ndarray.js", "../lib/index.js"],
4
- "sourcesContent": ["/**\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/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isTypedArrayLike = require( '@stdlib/assert-is-typed-array-like' );\nvar resolve = require( '@stdlib/strided-base-dtype-resolve-enum' );\nvar reinterpretComplex64 = require( '@stdlib/strided-base-reinterpret-complex64' );\nvar reinterpretComplex128 = require( '@stdlib/strided-base-reinterpret-complex128' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar COMPLEX64 = resolve( 'complex64' );\nvar COMPLEX128 = resolve( 'complex128' );\n\n\n// MAIN //\n\n/**\n* Returns a function which dispatches to a native add-on applying a binary function to two input strided arrays.\n*\n* ## Notes\n*\n* - The returned function has the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type.\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **dtypeY**: `y` data type.\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **dtypeZ**: `z` data type.\n* - **z**: output array.\n* - **strideY**: `z` stride length.\n*\n* - The add-on function should have the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type (enumeration constant).\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **dtypeY**: `y` data type (enumeration constant).\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **dtypeZ**: `z` data type (enumeration constant).\n* - **z**: output array.\n* - **strideZ**: `z` stride length.\n*\n* - The fallback function should have the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type.\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **dtypeY**: `y` data type.\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **dtypeZ**: `z` data type.\n* - **z**: output array.\n* - **strideZ**: `z` stride length.\n*\n* @param {Function} addon - add-on interface\n* @param {Function} fallback - fallback function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} dispatch function\n*\n* @example\n* function addon( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n* // Call into native add-on...\n* }\n*\n* function fallback( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n* // Fallback JavaScript implementation...\n* }\n*\n* // Create a dispatch function:\n* var f = dispatch( addon, fallback );\n*\n* // ...\n*\n* // Invoke the dispatch function with strided array arguments:\n* f( 2, 'generic', [ 1, 2 ], 1, 'generic', [ 3, 4 ], 1, 'generic', [ 0, 0 ], 1 );\n*/\nfunction dispatch( addon, fallback ) {\n\tif ( !isFunction( addon ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', addon ) );\n\t}\n\tif ( !isFunction( fallback ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fallback ) );\n\t}\n\treturn dispatcher;\n\n\t/**\n\t* Dispatches to a native add-on.\n\t*\n\t* @private\n\t* @param {integer} N - number of indexed elements\n\t* @param {*} dtypeX - `x` data type\n\t* @param {Collection} x - input array\n\t* @param {integer} strideX - `x` stride length\n\t* @param {*} dtypeY - `y` data type\n\t* @param {Collection} y - input array\n\t* @param {integer} strideY - `y` stride length\n\t* @param {*} dtypeZ - `z` data type\n\t* @param {Collection} z - destination array\n\t* @param {integer} strideZ - `z` stride length\n\t* @throws {TypeError} unable to resolve a strided array function supporting the provided array argument data types\n\t* @returns {Collection} `z`\n\t*/\n\tfunction dispatcher( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n\t\tvar viewX;\n\t\tvar viewY;\n\t\tvar viewZ;\n\n\t\t// WARNING: we assume that, if we're provided something resembling a typed array, we're provided a typed array; however, this can lead to potential unintended errors as the native add-on may not work with non-typed array objects (e.g., generic arrays)...\n\t\tif (\n\t\t\t!isTypedArrayLike( x ) ||\n\t\t\t!isTypedArrayLike( y ) ||\n\t\t\t!isTypedArrayLike( z )\n\t\t) {\n\t\t\tfallback( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ );\n\t\t\treturn z;\n\t\t}\n\t\tdtypeX = resolve( dtypeX );\n\t\tdtypeY = resolve( dtypeY );\n\t\tdtypeZ = resolve( dtypeZ );\n\t\tif ( dtypeX === null || dtypeY === null || dtypeZ === null ) {\n\t\t\tthrow new TypeError( 'invalid arguments. Unable to resolve a strided array function supporting the provided array argument data types.' );\n\t\t}\n\t\tif ( dtypeX === COMPLEX64 ) {\n\t\t\tviewX = reinterpretComplex64( x, 0 );\n\t\t} else if ( dtypeX === COMPLEX128 ) {\n\t\t\tviewX = reinterpretComplex128( x, 0 );\n\t\t} else {\n\t\t\tviewX = x;\n\t\t}\n\t\tif ( dtypeY === COMPLEX64 ) {\n\t\t\tviewY = reinterpretComplex64( y, 0 );\n\t\t} else if ( dtypeY === COMPLEX128 ) {\n\t\t\tviewY = reinterpretComplex128( y, 0 );\n\t\t} else {\n\t\t\tviewY = y;\n\t\t}\n\t\tif ( dtypeZ === COMPLEX64 ) {\n\t\t\tviewZ = reinterpretComplex64( z, 0 );\n\t\t} else if ( dtypeZ === COMPLEX128 ) {\n\t\t\tviewZ = reinterpretComplex128( z, 0 );\n\t\t} else {\n\t\t\tviewZ = z;\n\t\t}\n\t\taddon( N, dtypeX, viewX, strideX, dtypeY, viewY, strideY, dtypeZ, viewZ, strideZ );\n\t\treturn z;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dispatch;\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/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isTypedArrayLike = require( '@stdlib/assert-is-typed-array-like' );\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar resolve = require( '@stdlib/strided-base-dtype-resolve-enum' );\nvar reinterpretComplex64 = require( '@stdlib/strided-base-reinterpret-complex64' );\nvar reinterpretComplex128 = require( '@stdlib/strided-base-reinterpret-complex128' );\nvar offsetView = require( '@stdlib/strided-base-offset-view' );\nvar minViewBufferIndex = require( '@stdlib/strided-base-min-view-buffer-index' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar COMPLEX64 = resolve( 'complex64' );\nvar COMPLEX128 = resolve( 'complex128' );\n\n\n// MAIN //\n\n/**\n* Returns a function which dispatches to a native add-on applying a binary function to two input strided arrays using alternative indexing semantics.\n*\n* ## Notes\n*\n* - The returned function has the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, dtypeZ, z, strideZ, offsetZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type.\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **offsetX**: starting `x` index.\n* - **dtypeY**: `y` data type.\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **offsetY**: starting `y` index.\n* - **dtypeZ**: `z` data type.\n* - **z**: output array.\n* - **strideZ**: `z` stride length.\n* - **offsetZ**: starting `z` index.\n*\n* - The add-on function should have the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type (enumeration constant).\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **dtypeY**: `y` data type (enumeration constant).\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **dtypeZ**: `z` data type (enumeration constant).\n* - **z**: output array.\n* - **strideZ**: `z` stride length.\n*\n* - The fallback function should have the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, dtypeZ, z, strideZ, offsetZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type.\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **offsetX**: starting `x` index.\n* - **dtypeY**: `y` data type.\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **offsetY**: starting `y` index.\n* - **dtypeZ**: `z` data type.\n* - **z**: output array.\n* - **strideZ**: `z` stride length.\n* - **offsetZ**: starting `z` index.\n*\n* @param {Function} addon - add-on interface\n* @param {Function} fallback - fallback function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} dispatch function\n*\n* @example\n* function addon( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n* // Call into native add-on...\n* }\n*\n* function fallback( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, dtypeZ, z, strideZ, offsetZ ) {\n* // Fallback JavaScript implementation...\n* }\n*\n* // Create a dispatch function:\n* var f = dispatch( addon, fallback );\n*\n* // ...\n*\n* // Invoke the dispatch function with strided array arguments:\n* f( 2, 'generic', [ 1, 2 ], 1, 0, 'generic', [ 3, 4 ], 1, 0, 'generic', [ 0, 0 ], 1, 0 );\n*/\nfunction dispatch( addon, fallback ) {\n\tif ( !isFunction( addon ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', addon ) );\n\t}\n\tif ( !isFunction( fallback ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fallback ) );\n\t}\n\treturn dispatcher;\n\n\t/**\n\t* Dispatches to a native add-on.\n\t*\n\t* @private\n\t* @param {integer} N - number of indexed elements\n\t* @param {*} dtypeX - `x` data type\n\t* @param {Collection} x - input array\n\t* @param {integer} strideX - `x` stride length\n\t* @param {NonNegativeInteger} offsetX - starting `x` index\n\t* @param {*} dtypeY - `y` data type\n\t* @param {Collection} y - input array\n\t* @param {integer} strideY - `y` stride length\n\t* @param {NonNegativeInteger} offsetY - starting `y` index\n\t* @param {*} dtypeZ - `z` data type\n\t* @param {Collection} z - destination array\n\t* @param {integer} strideZ - `z` stride length\n\t* @param {NonNegativeInteger} offsetZ - starting `z` index\n\t* @throws {TypeError} fifth argument must be a nonnegative integer\n\t* @throws {TypeError} ninth argument must be a nonnegative integer\n\t* @throws {TypeError} thirteenth argument must be a nonnegative integer\n\t* @throws {TypeError} unable to resolve a strided array function supporting the provided array argument data types\n\t* @returns {Collection} `z`\n\t*/\n\tfunction dispatcher( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, dtypeZ, z, strideZ, offsetZ ) { // eslint-disable-line max-params\n\t\tvar viewX;\n\t\tvar viewY;\n\t\tvar viewZ;\n\n\t\t// WARNING: we assume that, if we're provided something resembling a typed array, we're provided a typed array; however, this can lead to potential unintended errors as the native add-on may not work with non-typed array objects (e.g., generic arrays)...\n\t\tif (\n\t\t\t!isTypedArrayLike( x ) ||\n\t\t\t!isTypedArrayLike( y ) ||\n\t\t\t!isTypedArrayLike( z )\n\t\t) {\n\t\t\tfallback( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, dtypeZ, z, strideZ, offsetZ );\n\t\t\treturn z;\n\t\t}\n\t\tdtypeX = resolve( dtypeX );\n\t\tdtypeY = resolve( dtypeY );\n\t\tdtypeZ = resolve( dtypeZ );\n\t\tif ( dtypeX === null || dtypeY === null || dtypeZ === null ) {\n\t\t\tthrow new TypeError( 'invalid arguments. Unable to resolve a strided array function supporting the provided array argument data types.' );\n\t\t}\n\t\tif ( !isNonNegativeInteger( offsetX ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First input array offset must be a nonnegative integer. Value: `%s`.', offsetX ) );\n\t\t}\n\t\tif ( !isNonNegativeInteger( offsetY ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second input array offset must be a nonnegative integer. Value: `%s`.', offsetY ) );\n\t\t}\n\t\tif ( !isNonNegativeInteger( offsetZ ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Output array offset must be a nonnegative integer. Value: `%s`.', offsetZ ) );\n\t\t}\n\t\toffsetX = minViewBufferIndex( N, strideX, offsetX );\n\t\toffsetY = minViewBufferIndex( N, strideY, offsetY );\n\t\toffsetZ = minViewBufferIndex( N, strideZ, offsetZ );\n\t\tif ( dtypeX === COMPLEX64 ) {\n\t\t\tviewX = reinterpretComplex64( x, offsetX );\n\t\t} else if ( dtypeX === COMPLEX128 ) {\n\t\t\tviewX = reinterpretComplex128( x, offsetX );\n\t\t} else {\n\t\t\tviewX = offsetView( x, offsetX );\n\t\t}\n\t\tif ( dtypeY === COMPLEX64 ) {\n\t\t\tviewY = reinterpretComplex64( y, offsetY );\n\t\t} else if ( dtypeY === COMPLEX128 ) {\n\t\t\tviewY = reinterpretComplex128( y, offsetY );\n\t\t} else {\n\t\t\tviewY = offsetView( y, offsetY );\n\t\t}\n\t\tif ( dtypeZ === COMPLEX64 ) {\n\t\t\tviewZ = reinterpretComplex64( z, offsetZ );\n\t\t} else if ( dtypeZ === COMPLEX128 ) {\n\t\t\tviewZ = reinterpretComplex128( z, offsetZ );\n\t\t} else {\n\t\t\tviewZ = offsetView( z, offsetZ );\n\t\t}\n\n\t\taddon( N, dtypeX, viewX, strideX, dtypeY, viewY, strideY, dtypeZ, viewZ, strideZ );\n\t\treturn z;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dispatch;\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/**\n* Dispatch to a native add-on applying a binary function to two input strided arrays.\n*\n* @module @stdlib/strided-base-binary-addon-dispatch\n*\n* @example\n* var dispatch = require( '@stdlib/strided-base-binary-addon-dispatch' );\n*\n* function addon( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n* // Call into native add-on...\n* }\n*\n* function fallback( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n* // Fallback JavaScript implementation...\n* }\n*\n* // Create a dispatch function:\n* var f = dispatch( addon, fallback );\n*\n* // ...\n*\n* // Invoke the dispatch function with strided array arguments:\n* f( 2, 'generic', [ 1, 2 ], 1, 'generic', [ 3, 4 ], 1, 'generic', [ 0, 0 ], 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
- "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAwBA,IAAIC,EAAa,QAAS,4BAA6B,EACnDC,EAAmB,QAAS,oCAAqC,EACjEC,EAAU,QAAS,yCAA0C,EAC7DC,EAAuB,QAAS,4CAA6C,EAC7EC,EAAwB,QAAS,6CAA8C,EAC/EC,EAAS,QAAS,uBAAwB,EAK1CC,EAAYJ,EAAS,WAAY,EACjCK,EAAaL,EAAS,YAAa,EA0FvC,SAASM,EAAUC,EAAOC,EAAW,CACpC,GAAK,CAACV,EAAYS,CAAM,EACvB,MAAM,IAAI,UAAWJ,EAAQ,oEAAqEI,CAAM,CAAE,EAE3G,GAAK,CAACT,EAAYU,CAAS,EAC1B,MAAM,IAAI,UAAWL,EAAQ,qEAAsEK,CAAS,CAAE,EAE/G,OAAOC,EAmBP,SAASA,EAAYC,EAAGC,EAAQC,EAAGC,EAASC,EAAQC,EAAGC,EAASC,EAAQC,EAAGC,EAAU,CACpF,IAAIC,EACAC,EACAC,EAGJ,GACC,CAACvB,EAAkBa,CAAE,GACrB,CAACb,EAAkBgB,CAAE,GACrB,CAAChB,EAAkBmB,CAAE,EAErB,OAAAV,EAAUE,EAAGC,EAAQC,EAAGC,EAASC,EAAQC,EAAGC,EAASC,EAAQC,EAAGC,CAAQ,EACjED,EAKR,GAHAP,EAASX,EAASW,CAAO,EACzBG,EAASd,EAASc,CAAO,EACzBG,EAASjB,EAASiB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AAWd,EACtBoB,EAAQzB,EAAuBoB,EAAGE,CAAQ,EAE1CG,EAAQxB,EAAYmB,EAAGE,CAAQ,EAGhCf,EAAOG,EAAGC,EAAQY,EAAOV,EAASE,EAAQS,EAAOP,EAASE,EAAQM,EAAOJ,CAAQ,EAC1ED,CACR,CACD,CAKA1B,EAAO,QAAUY,ICrLjB,IAAIoB,EAAc,QAAS,uDAAwD,EAC/EC,EAAO,IACPC,EAAU,IAKdF,EAAaC,EAAM,UAAWC,CAAQ,EAKtC,OAAO,QAAUD",
6
- "names": ["require_main", "__commonJSMin", "exports", "module", "isFunction", "isTypedArrayLike", "resolve", "reinterpretComplex64", "reinterpretComplex128", "format", "COMPLEX64", "COMPLEX128", "dispatch", "addon", "fallback", "dispatcher", "N", "dtypeX", "x", "strideX", "dtypeY", "y", "strideY", "dtypeZ", "z", "strideZ", "viewX", "viewY", "viewZ", "require_ndarray", "__commonJSMin", "exports", "module", "isFunction", "isTypedArrayLike", "isNonNegativeInteger", "resolve", "reinterpretComplex64", "reinterpretComplex128", "offsetView", "minViewBufferIndex", "format", "COMPLEX64", "COMPLEX128", "dispatch", "addon", "fallback", "dispatcher", "N", "dtypeX", "x", "strideX", "offsetX", "dtypeY", "y", "strideY", "offsetY", "dtypeZ", "z", "strideZ", "offsetZ", "viewX", "viewY", "viewZ", "setReadOnly", "main", "ndarray"]
4
+ "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/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isTypedArrayLike = require( '@stdlib/assert-is-typed-array-like' );\nvar resolve = require( '@stdlib/strided-base-dtype-resolve-enum' );\nvar reinterpretComplex64 = require( '@stdlib/strided-base-reinterpret-complex64' );\nvar reinterpretComplex128 = require( '@stdlib/strided-base-reinterpret-complex128' );\nvar reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar COMPLEX64 = resolve( 'complex64' );\nvar COMPLEX128 = resolve( 'complex128' );\nvar BOOLEAN = resolve( 'bool' );\n\n\n// MAIN //\n\n/**\n* Returns a function which dispatches to a native add-on applying a binary function to two input strided arrays.\n*\n* ## Notes\n*\n* - The returned function has the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type.\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **dtypeY**: `y` data type.\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **dtypeZ**: `z` data type.\n* - **z**: output array.\n* - **strideY**: `z` stride length.\n*\n* - The add-on function should have the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type (enumeration constant).\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **dtypeY**: `y` data type (enumeration constant).\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **dtypeZ**: `z` data type (enumeration constant).\n* - **z**: output array.\n* - **strideZ**: `z` stride length.\n*\n* - The fallback function should have the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type.\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **dtypeY**: `y` data type.\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **dtypeZ**: `z` data type.\n* - **z**: output array.\n* - **strideZ**: `z` stride length.\n*\n* @param {Function} addon - add-on interface\n* @param {Function} fallback - fallback function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} dispatch function\n*\n* @example\n* function addon( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n* // Call into native add-on...\n* }\n*\n* function fallback( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n* // Fallback JavaScript implementation...\n* }\n*\n* // Create a dispatch function:\n* var f = dispatch( addon, fallback );\n*\n* // ...\n*\n* // Invoke the dispatch function with strided array arguments:\n* f( 2, 'generic', [ 1, 2 ], 1, 'generic', [ 3, 4 ], 1, 'generic', [ 0, 0 ], 1 );\n*/\nfunction dispatch( addon, fallback ) {\n\tif ( !isFunction( addon ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', addon ) );\n\t}\n\tif ( !isFunction( fallback ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fallback ) );\n\t}\n\treturn dispatcher;\n\n\t/**\n\t* Dispatches to a native add-on.\n\t*\n\t* @private\n\t* @param {integer} N - number of indexed elements\n\t* @param {*} dtypeX - `x` data type\n\t* @param {Collection} x - input array\n\t* @param {integer} strideX - `x` stride length\n\t* @param {*} dtypeY - `y` data type\n\t* @param {Collection} y - input array\n\t* @param {integer} strideY - `y` stride length\n\t* @param {*} dtypeZ - `z` data type\n\t* @param {Collection} z - destination array\n\t* @param {integer} strideZ - `z` stride length\n\t* @throws {TypeError} unable to resolve a strided array function supporting the provided array argument data types\n\t* @returns {Collection} `z`\n\t*/\n\tfunction dispatcher( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n\t\tvar viewX;\n\t\tvar viewY;\n\t\tvar viewZ;\n\n\t\t// WARNING: we assume that, if we're provided something resembling a typed array, we're provided a typed array; however, this can lead to potential unintended errors as the native add-on may not work with non-typed array objects (e.g., generic arrays)...\n\t\tif (\n\t\t\t!isTypedArrayLike( x ) ||\n\t\t\t!isTypedArrayLike( y ) ||\n\t\t\t!isTypedArrayLike( z )\n\t\t) {\n\t\t\tfallback( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ );\n\t\t\treturn z;\n\t\t}\n\t\tdtypeX = resolve( dtypeX );\n\t\tdtypeY = resolve( dtypeY );\n\t\tdtypeZ = resolve( dtypeZ );\n\t\tif ( dtypeX === null || dtypeY === null || dtypeZ === null ) {\n\t\t\tthrow new TypeError( 'invalid arguments. Unable to resolve a strided array function supporting the provided array argument data types.' );\n\t\t}\n\t\tif ( dtypeX === COMPLEX64 ) {\n\t\t\tviewX = reinterpretComplex64( x, 0 );\n\t\t} else if ( dtypeX === COMPLEX128 ) {\n\t\t\tviewX = reinterpretComplex128( x, 0 );\n\t\t} else if ( dtypeX === BOOLEAN ) {\n\t\t\tviewX = reinterpretBoolean( x, 0 );\n\t\t} else {\n\t\t\tviewX = x;\n\t\t}\n\t\tif ( dtypeY === COMPLEX64 ) {\n\t\t\tviewY = reinterpretComplex64( y, 0 );\n\t\t} else if ( dtypeY === COMPLEX128 ) {\n\t\t\tviewY = reinterpretComplex128( y, 0 );\n\t\t} else if ( dtypeY === BOOLEAN ) {\n\t\t\tviewY = reinterpretBoolean( y, 0 );\n\t\t} else {\n\t\t\tviewY = y;\n\t\t}\n\t\tif ( dtypeZ === COMPLEX64 ) {\n\t\t\tviewZ = reinterpretComplex64( z, 0 );\n\t\t} else if ( dtypeZ === COMPLEX128 ) {\n\t\t\tviewZ = reinterpretComplex128( z, 0 );\n\t\t} else if ( dtypeZ === BOOLEAN ) {\n\t\t\tviewZ = reinterpretBoolean( z, 0 );\n\t\t} else {\n\t\t\tviewZ = z;\n\t\t}\n\t\taddon( N, dtypeX, viewX, strideX, dtypeY, viewY, strideY, dtypeZ, viewZ, strideZ );\n\t\treturn z;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dispatch;\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/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isTypedArrayLike = require( '@stdlib/assert-is-typed-array-like' );\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar resolve = require( '@stdlib/strided-base-dtype-resolve-enum' );\nvar reinterpretComplex64 = require( '@stdlib/strided-base-reinterpret-complex64' );\nvar reinterpretComplex128 = require( '@stdlib/strided-base-reinterpret-complex128' );\nvar reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );\nvar offsetView = require( '@stdlib/strided-base-offset-view' );\nvar minViewBufferIndex = require( '@stdlib/strided-base-min-view-buffer-index' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar COMPLEX64 = resolve( 'complex64' );\nvar COMPLEX128 = resolve( 'complex128' );\nvar BOOLEAN = resolve( 'bool' );\n\n\n// MAIN //\n\n/**\n* Returns a function which dispatches to a native add-on applying a binary function to two input strided arrays using alternative indexing semantics.\n*\n* ## Notes\n*\n* - The returned function has the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, dtypeZ, z, strideZ, offsetZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type.\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **offsetX**: starting `x` index.\n* - **dtypeY**: `y` data type.\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **offsetY**: starting `y` index.\n* - **dtypeZ**: `z` data type.\n* - **z**: output array.\n* - **strideZ**: `z` stride length.\n* - **offsetZ**: starting `z` index.\n*\n* - The add-on function should have the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type (enumeration constant).\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **dtypeY**: `y` data type (enumeration constant).\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **dtypeZ**: `z` data type (enumeration constant).\n* - **z**: output array.\n* - **strideZ**: `z` stride length.\n*\n* - The fallback function should have the following signature:\n*\n* ```text\n* f( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, dtypeZ, z, strideZ, offsetZ )\n* ```\n*\n* where\n*\n* - **N**: number of indexed elements.\n* - **dtypeX**: `x` data type.\n* - **x**: input array.\n* - **strideX**: `x` stride length.\n* - **offsetX**: starting `x` index.\n* - **dtypeY**: `y` data type.\n* - **y**: input array.\n* - **strideY**: `y` stride length.\n* - **offsetY**: starting `y` index.\n* - **dtypeZ**: `z` data type.\n* - **z**: output array.\n* - **strideZ**: `z` stride length.\n* - **offsetZ**: starting `z` index.\n*\n* @param {Function} addon - add-on interface\n* @param {Function} fallback - fallback function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} dispatch function\n*\n* @example\n* function addon( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n* // Call into native add-on...\n* }\n*\n* function fallback( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, dtypeZ, z, strideZ, offsetZ ) {\n* // Fallback JavaScript implementation...\n* }\n*\n* // Create a dispatch function:\n* var f = dispatch( addon, fallback );\n*\n* // ...\n*\n* // Invoke the dispatch function with strided array arguments:\n* f( 2, 'generic', [ 1, 2 ], 1, 0, 'generic', [ 3, 4 ], 1, 0, 'generic', [ 0, 0 ], 1, 0 );\n*/\nfunction dispatch( addon, fallback ) {\n\tif ( !isFunction( addon ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', addon ) );\n\t}\n\tif ( !isFunction( fallback ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fallback ) );\n\t}\n\treturn dispatcher;\n\n\t/**\n\t* Dispatches to a native add-on.\n\t*\n\t* @private\n\t* @param {integer} N - number of indexed elements\n\t* @param {*} dtypeX - `x` data type\n\t* @param {Collection} x - input array\n\t* @param {integer} strideX - `x` stride length\n\t* @param {NonNegativeInteger} offsetX - starting `x` index\n\t* @param {*} dtypeY - `y` data type\n\t* @param {Collection} y - input array\n\t* @param {integer} strideY - `y` stride length\n\t* @param {NonNegativeInteger} offsetY - starting `y` index\n\t* @param {*} dtypeZ - `z` data type\n\t* @param {Collection} z - destination array\n\t* @param {integer} strideZ - `z` stride length\n\t* @param {NonNegativeInteger} offsetZ - starting `z` index\n\t* @throws {TypeError} fifth argument must be a nonnegative integer\n\t* @throws {TypeError} ninth argument must be a nonnegative integer\n\t* @throws {TypeError} thirteenth argument must be a nonnegative integer\n\t* @throws {TypeError} unable to resolve a strided array function supporting the provided array argument data types\n\t* @returns {Collection} `z`\n\t*/\n\tfunction dispatcher( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, dtypeZ, z, strideZ, offsetZ ) { // eslint-disable-line max-params\n\t\tvar viewX;\n\t\tvar viewY;\n\t\tvar viewZ;\n\n\t\t// WARNING: we assume that, if we're provided something resembling a typed array, we're provided a typed array; however, this can lead to potential unintended errors as the native add-on may not work with non-typed array objects (e.g., generic arrays)...\n\t\tif (\n\t\t\t!isTypedArrayLike( x ) ||\n\t\t\t!isTypedArrayLike( y ) ||\n\t\t\t!isTypedArrayLike( z )\n\t\t) {\n\t\t\tfallback( N, dtypeX, x, strideX, offsetX, dtypeY, y, strideY, offsetY, dtypeZ, z, strideZ, offsetZ );\n\t\t\treturn z;\n\t\t}\n\t\tdtypeX = resolve( dtypeX );\n\t\tdtypeY = resolve( dtypeY );\n\t\tdtypeZ = resolve( dtypeZ );\n\t\tif ( dtypeX === null || dtypeY === null || dtypeZ === null ) {\n\t\t\tthrow new TypeError( 'invalid arguments. Unable to resolve a strided array function supporting the provided array argument data types.' );\n\t\t}\n\t\tif ( !isNonNegativeInteger( offsetX ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First input array offset must be a nonnegative integer. Value: `%s`.', offsetX ) );\n\t\t}\n\t\tif ( !isNonNegativeInteger( offsetY ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second input array offset must be a nonnegative integer. Value: `%s`.', offsetY ) );\n\t\t}\n\t\tif ( !isNonNegativeInteger( offsetZ ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Output array offset must be a nonnegative integer. Value: `%s`.', offsetZ ) );\n\t\t}\n\t\toffsetX = minViewBufferIndex( N, strideX, offsetX );\n\t\toffsetY = minViewBufferIndex( N, strideY, offsetY );\n\t\toffsetZ = minViewBufferIndex( N, strideZ, offsetZ );\n\t\tif ( dtypeX === COMPLEX64 ) {\n\t\t\tviewX = reinterpretComplex64( x, offsetX );\n\t\t} else if ( dtypeX === COMPLEX128 ) {\n\t\t\tviewX = reinterpretComplex128( x, offsetX );\n\t\t} else if ( dtypeX === BOOLEAN ) {\n\t\t\tviewX = reinterpretBoolean( x, offsetX );\n\t\t} else {\n\t\t\tviewX = offsetView( x, offsetX );\n\t\t}\n\t\tif ( dtypeY === COMPLEX64 ) {\n\t\t\tviewY = reinterpretComplex64( y, offsetY );\n\t\t} else if ( dtypeY === COMPLEX128 ) {\n\t\t\tviewY = reinterpretComplex128( y, offsetY );\n\t\t} else if ( dtypeY === BOOLEAN ) {\n\t\t\tviewY = reinterpretBoolean( y, offsetY );\n\t\t} else {\n\t\t\tviewY = offsetView( y, offsetY );\n\t\t}\n\t\tif ( dtypeZ === COMPLEX64 ) {\n\t\t\tviewZ = reinterpretComplex64( z, offsetZ );\n\t\t} else if ( dtypeZ === COMPLEX128 ) {\n\t\t\tviewZ = reinterpretComplex128( z, offsetZ );\n\t\t} else if ( dtypeZ === BOOLEAN ) {\n\t\t\tviewZ = reinterpretBoolean( z, offsetZ );\n\t\t} else {\n\t\t\tviewZ = offsetView( z, offsetZ );\n\t\t}\n\n\t\taddon( N, dtypeX, viewX, strideX, dtypeY, viewY, strideY, dtypeZ, viewZ, strideZ );\n\t\treturn z;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dispatch;\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/**\n* Dispatch to a native add-on applying a binary function to two input strided arrays.\n*\n* @module @stdlib/strided-base-binary-addon-dispatch\n*\n* @example\n* var dispatch = require( '@stdlib/strided-base-binary-addon-dispatch' );\n*\n* function addon( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n* // Call into native add-on...\n* }\n*\n* function fallback( N, dtypeX, x, strideX, dtypeY, y, strideY, dtypeZ, z, strideZ ) {\n* // Fallback JavaScript implementation...\n* }\n*\n* // Create a dispatch function:\n* var f = dispatch( addon, fallback );\n*\n* // ...\n*\n* // Invoke the dispatch function with strided array arguments:\n* f( 2, 'generic', [ 1, 2 ], 1, 'generic', [ 3, 4 ], 1, 'generic', [ 0, 0 ], 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAwBA,IAAIC,EAAa,QAAS,4BAA6B,EACnDC,EAAmB,QAAS,oCAAqC,EACjEC,EAAU,QAAS,yCAA0C,EAC7DC,EAAuB,QAAS,4CAA6C,EAC7EC,EAAwB,QAAS,6CAA8C,EAC/EC,EAAqB,QAAS,0CAA2C,EACzEC,EAAS,QAAS,uBAAwB,EAK1CC,EAAYL,EAAS,WAAY,EACjCM,EAAaN,EAAS,YAAa,EACnCO,EAAUP,EAAS,MAAO,EA0F9B,SAASQ,EAAUC,EAAOC,EAAW,CACpC,GAAK,CAACZ,EAAYW,CAAM,EACvB,MAAM,IAAI,UAAWL,EAAQ,oEAAqEK,CAAM,CAAE,EAE3G,GAAK,CAACX,EAAYY,CAAS,EAC1B,MAAM,IAAI,UAAWN,EAAQ,qEAAsEM,CAAS,CAAE,EAE/G,OAAOC,EAmBP,SAASA,EAAYC,EAAGC,EAAQC,EAAGC,EAASC,EAAQC,EAAGC,EAASC,EAAQC,EAAGC,EAAU,CACpF,IAAIC,EACAC,EACAC,EAGJ,GACC,CAACzB,EAAkBe,CAAE,GACrB,CAACf,EAAkBkB,CAAE,GACrB,CAAClB,EAAkBqB,CAAE,EAErB,OAAAV,EAAUE,EAAGC,EAAQC,EAAGC,EAASC,EAAQC,EAAGC,EAASC,EAAQC,EAAGC,CAAQ,EACjED,EAKR,GAHAP,EAASb,EAASa,CAAO,EACzBG,EAAShB,EAASgB,CAAO,EACzBG,EAASnB,EAASmB,CAAO,EACpBN,IAAW,MAAQG,IAAW,MAAQG,IAAW,KACrD,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3BC,IAAWZ,EACfqB,EAAQ3B,EAAsBmB,EAAGE,CAAQ,EAC9BH,IAAWX,EACtBoB,EAAQ1B,EAAuBkB,EAAGE,CAAQ,EAC/BH,IAAWV,EACtBmB,EAAQzB,EAAoBiB,EAAGE,CAAQ,EAEvCM,EAAQxB,EAAYgB,EAAGE,CAAQ,EAE3BC,IAAWhB,EACfsB,EAAQ5B,EAAsBuB,EAAGE,CAAQ,EAC9BH,IAAWf,EACtBqB,EAAQ3B,EAAuBsB,EAAGE,CAAQ,EAC/BH,IAAWd,EACtBoB,EAAQ1B,EAAoBqB,EAAGE,CAAQ,EAEvCG,EAAQzB,EAAYoB,EAAGE,CAAQ,EAGhCf,EAAOG,EAAGC,EAAQY,EAAOV,EAASE,EAAQS,EAAOP,EAASE,EAAQM,EAAOJ,CAAQ,EAC1ED,CACR,CACD,CAKA5B,EAAO,QAAUc,IC7LjB,IAAIoB,EAAc,QAAS,uDAAwD,EAC/EC,EAAO,IACPC,EAAU,IAKdF,EAAaC,EAAM,UAAWC,CAAQ,EAKtC,OAAO,QAAUD",
6
+ "names": ["require_main", "__commonJSMin", "exports", "module", "isFunction", "isTypedArrayLike", "resolve", "reinterpretComplex64", "reinterpretComplex128", "reinterpretBoolean", "format", "COMPLEX64", "COMPLEX128", "BOOLEAN", "dispatch", "addon", "fallback", "dispatcher", "N", "dtypeX", "x", "strideX", "dtypeY", "y", "strideY", "dtypeZ", "z", "strideZ", "viewX", "viewY", "viewZ", "require_ndarray", "__commonJSMin", "exports", "module", "isFunction", "isTypedArrayLike", "isNonNegativeInteger", "resolve", "reinterpretComplex64", "reinterpretComplex128", "reinterpretBoolean", "offsetView", "minViewBufferIndex", "format", "COMPLEX64", "COMPLEX128", "BOOLEAN", "dispatch", "addon", "fallback", "dispatcher", "N", "dtypeX", "x", "strideX", "offsetX", "dtypeY", "y", "strideY", "offsetY", "dtypeZ", "z", "strideZ", "offsetZ", "viewX", "viewY", "viewZ", "setReadOnly", "main", "ndarray"]
7
7
  }
package/lib/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license Apache-2.0
3
3
  *
4
- * Copyright (c) 2021 The Stdlib Authors.
4
+ * Copyright (c) 2024 The Stdlib Authors.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ var isTypedArrayLike = require( '@stdlib/assert-is-typed-array-like' );
27
27
  var resolve = require( '@stdlib/strided-base-dtype-resolve-enum' );
28
28
  var reinterpretComplex64 = require( '@stdlib/strided-base-reinterpret-complex64' );
29
29
  var reinterpretComplex128 = require( '@stdlib/strided-base-reinterpret-complex128' );
30
+ var reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );
30
31
  var format = require( '@stdlib/string-format' );
31
32
 
32
33
 
@@ -34,6 +35,7 @@ var format = require( '@stdlib/string-format' );
34
35
 
35
36
  var COMPLEX64 = resolve( 'complex64' );
36
37
  var COMPLEX128 = resolve( 'complex128' );
38
+ var BOOLEAN = resolve( 'bool' );
37
39
 
38
40
 
39
41
  // MAIN //
@@ -173,6 +175,8 @@ function dispatch( addon, fallback ) {
173
175
  viewX = reinterpretComplex64( x, 0 );
174
176
  } else if ( dtypeX === COMPLEX128 ) {
175
177
  viewX = reinterpretComplex128( x, 0 );
178
+ } else if ( dtypeX === BOOLEAN ) {
179
+ viewX = reinterpretBoolean( x, 0 );
176
180
  } else {
177
181
  viewX = x;
178
182
  }
@@ -180,6 +184,8 @@ function dispatch( addon, fallback ) {
180
184
  viewY = reinterpretComplex64( y, 0 );
181
185
  } else if ( dtypeY === COMPLEX128 ) {
182
186
  viewY = reinterpretComplex128( y, 0 );
187
+ } else if ( dtypeY === BOOLEAN ) {
188
+ viewY = reinterpretBoolean( y, 0 );
183
189
  } else {
184
190
  viewY = y;
185
191
  }
@@ -187,6 +193,8 @@ function dispatch( addon, fallback ) {
187
193
  viewZ = reinterpretComplex64( z, 0 );
188
194
  } else if ( dtypeZ === COMPLEX128 ) {
189
195
  viewZ = reinterpretComplex128( z, 0 );
196
+ } else if ( dtypeZ === BOOLEAN ) {
197
+ viewZ = reinterpretBoolean( z, 0 );
190
198
  } else {
191
199
  viewZ = z;
192
200
  }
package/lib/ndarray.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license Apache-2.0
3
3
  *
4
- * Copyright (c) 2021 The Stdlib Authors.
4
+ * Copyright (c) 2024 The Stdlib Authors.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@ var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).is
28
28
  var resolve = require( '@stdlib/strided-base-dtype-resolve-enum' );
29
29
  var reinterpretComplex64 = require( '@stdlib/strided-base-reinterpret-complex64' );
30
30
  var reinterpretComplex128 = require( '@stdlib/strided-base-reinterpret-complex128' );
31
+ var reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );
31
32
  var offsetView = require( '@stdlib/strided-base-offset-view' );
32
33
  var minViewBufferIndex = require( '@stdlib/strided-base-min-view-buffer-index' );
33
34
  var format = require( '@stdlib/string-format' );
@@ -37,6 +38,7 @@ var format = require( '@stdlib/string-format' );
37
38
 
38
39
  var COMPLEX64 = resolve( 'complex64' );
39
40
  var COMPLEX128 = resolve( 'complex128' );
41
+ var BOOLEAN = resolve( 'bool' );
40
42
 
41
43
 
42
44
  // MAIN //
@@ -200,6 +202,8 @@ function dispatch( addon, fallback ) {
200
202
  viewX = reinterpretComplex64( x, offsetX );
201
203
  } else if ( dtypeX === COMPLEX128 ) {
202
204
  viewX = reinterpretComplex128( x, offsetX );
205
+ } else if ( dtypeX === BOOLEAN ) {
206
+ viewX = reinterpretBoolean( x, offsetX );
203
207
  } else {
204
208
  viewX = offsetView( x, offsetX );
205
209
  }
@@ -207,6 +211,8 @@ function dispatch( addon, fallback ) {
207
211
  viewY = reinterpretComplex64( y, offsetY );
208
212
  } else if ( dtypeY === COMPLEX128 ) {
209
213
  viewY = reinterpretComplex128( y, offsetY );
214
+ } else if ( dtypeY === BOOLEAN ) {
215
+ viewY = reinterpretBoolean( y, offsetY );
210
216
  } else {
211
217
  viewY = offsetView( y, offsetY );
212
218
  }
@@ -214,6 +220,8 @@ function dispatch( addon, fallback ) {
214
220
  viewZ = reinterpretComplex64( z, offsetZ );
215
221
  } else if ( dtypeZ === COMPLEX128 ) {
216
222
  viewZ = reinterpretComplex128( z, offsetZ );
223
+ } else if ( dtypeZ === BOOLEAN ) {
224
+ viewZ = reinterpretBoolean( z, offsetZ );
217
225
  } else {
218
226
  viewZ = offsetView( z, offsetZ );
219
227
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/strided-base-binary-addon-dispatch",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Dispatch to a native add-on applying a binary function to two input strided arrays.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -30,16 +30,18 @@
30
30
  "url": "https://github.com/stdlib-js/stdlib/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@stdlib/assert-is-function": "^0.2.1",
34
- "@stdlib/assert-is-nonnegative-integer": "^0.2.1",
35
- "@stdlib/assert-is-typed-array-like": "^0.2.1",
33
+ "@stdlib/assert-is-function": "^0.2.2",
34
+ "@stdlib/assert-is-nonnegative-integer": "^0.2.2",
35
+ "@stdlib/assert-is-typed-array-like": "^0.2.2",
36
36
  "@stdlib/strided-base-dtype-resolve-enum": "^0.2.1",
37
- "@stdlib/strided-base-min-view-buffer-index": "^0.2.1",
38
- "@stdlib/strided-base-offset-view": "^0.2.1",
39
- "@stdlib/strided-base-reinterpret-complex128": "^0.2.1",
40
- "@stdlib/strided-base-reinterpret-complex64": "^0.2.0",
41
- "@stdlib/string-format": "^0.2.1",
42
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1"
37
+ "@stdlib/strided-base-min-view-buffer-index": "^0.2.2",
38
+ "@stdlib/strided-base-offset-view": "^0.2.2",
39
+ "@stdlib/strided-base-reinterpret-boolean": "^0.0.2",
40
+ "@stdlib/strided-base-reinterpret-complex128": "^0.2.2",
41
+ "@stdlib/strided-base-reinterpret-complex64": "^0.2.1",
42
+ "@stdlib/string-format": "^0.2.2",
43
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
44
+ "@stdlib/error-tools-fmtprodmsg": "^0.2.2"
43
45
  },
44
46
  "devDependencies": {},
45
47
  "engines": {