@stdlib/array-base-broadcasted-binary3d 0.2.1 → 0.2.3
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/NOTICE +1 -1
- package/README.md +7 -7
- package/dist/index.js.map +1 -1
- package/docs/types/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/main.js +1 -1
- package/package.json +2 -3
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ Applies a binary callback to elements in two [broadcasted][@stdlib/array/base/br
|
|
|
65
65
|
|
|
66
66
|
```javascript
|
|
67
67
|
var zeros3d = require( '@stdlib/array-base-zeros3d' );
|
|
68
|
-
var add = require( '@stdlib/
|
|
68
|
+
var add = require( '@stdlib/number-float64-base-add' );
|
|
69
69
|
|
|
70
70
|
var x = [ [ 1.0, 2.0 ] ];
|
|
71
71
|
var y = [ [ 3.0 ], [ 4.0 ] ];
|
|
@@ -111,7 +111,7 @@ The function accepts the following arguments:
|
|
|
111
111
|
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' ).factory;
|
|
112
112
|
var filled3dBy = require( '@stdlib/array-base-filled3d-by' );
|
|
113
113
|
var zeros3d = require( '@stdlib/array-base-zeros3d' );
|
|
114
|
-
var add = require( '@stdlib/
|
|
114
|
+
var add = require( '@stdlib/number-float64-base-add' );
|
|
115
115
|
var bbinary3d = require( '@stdlib/array-base-broadcasted-binary3d' );
|
|
116
116
|
|
|
117
117
|
var shapes = [
|
|
@@ -171,7 +171,7 @@ See [LICENSE][stdlib-license].
|
|
|
171
171
|
|
|
172
172
|
## Copyright
|
|
173
173
|
|
|
174
|
-
Copyright © 2016-
|
|
174
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
175
175
|
|
|
176
176
|
</section>
|
|
177
177
|
|
|
@@ -184,8 +184,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
184
184
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/array-base-broadcasted-binary3d.svg
|
|
185
185
|
[npm-url]: https://npmjs.org/package/@stdlib/array-base-broadcasted-binary3d
|
|
186
186
|
|
|
187
|
-
[test-image]: https://github.com/stdlib-js/array-base-broadcasted-binary3d/actions/workflows/test.yml/badge.svg?branch=v0.2.
|
|
188
|
-
[test-url]: https://github.com/stdlib-js/array-base-broadcasted-binary3d/actions/workflows/test.yml?query=branch:v0.2.
|
|
187
|
+
[test-image]: https://github.com/stdlib-js/array-base-broadcasted-binary3d/actions/workflows/test.yml/badge.svg?branch=v0.2.3
|
|
188
|
+
[test-url]: https://github.com/stdlib-js/array-base-broadcasted-binary3d/actions/workflows/test.yml?query=branch:v0.2.3
|
|
189
189
|
|
|
190
190
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-broadcasted-binary3d/main.svg
|
|
191
191
|
[coverage-url]: https://codecov.io/github/stdlib-js/array-base-broadcasted-binary3d?branch=main
|
|
@@ -197,8 +197,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
197
197
|
|
|
198
198
|
-->
|
|
199
199
|
|
|
200
|
-
[chat-image]: https://img.shields.io/
|
|
201
|
-
[chat-url]: https://
|
|
200
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
201
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
202
202
|
|
|
203
203
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
204
204
|
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../lib/main.js", "../lib/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\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\nvar broadcastArray = require( '@stdlib/array-base-broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a three-dimensional nested output array.\n*\n* @param {ArrayLikeObject<Array>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {ArrayLikeObject<NonNegativeIntegerArray>} shapes - array shapes\n* @param {Callback} fcn - binary 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/
|
|
4
|
+
"sourcesContent": ["/**\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\nvar broadcastArray = require( '@stdlib/array-base-broadcast-array' );\n\n\n// MAIN //\n\n/**\n* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a three-dimensional nested output array.\n*\n* @param {ArrayLikeObject<Array>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {ArrayLikeObject<NonNegativeIntegerArray>} shapes - array shapes\n* @param {Callback} fcn - binary 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-add' );\n*\n* var shapes = [\n* [ 1, 1, 2 ],\n* [ 2, 1, 1 ],\n* [ 2, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = ones3d( shapes[ 1 ] );\n* var z = zeros3d( shapes[ 2 ] );\n*\n* bbinary3d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]\n*/\nfunction bbinary3d( arrays, shapes, fcn ) {\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dy0;\n\tvar dy1;\n\tvar dy2;\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 x0;\n\tvar x1;\n\tvar y0;\n\tvar y1;\n\tvar z0;\n\tvar z1;\n\tvar sh;\n\tvar st;\n\tvar o;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tsh = shapes[ 2 ];\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\tz = arrays[ 2 ];\n\n\tj2 = 0;\n\tk2 = 0;\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tj1 = 0;\n\t\tk1 = 0;\n\t\tx1 = x[ j2 ];\n\t\ty1 = y[ k2 ];\n\t\tz1 = z[ i2 ];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tj0 = 0;\n\t\t\tk0 = 0;\n\t\t\tx0 = x1[ j1 ];\n\t\t\ty0 = y1[ k1 ];\n\t\t\tz0 = z1[ i1 ];\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tz0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ] );\n\t\t\t\tj0 += dx0;\n\t\t\t\tk0 += dy0;\n\t\t\t}\n\t\t\tj1 += dx1;\n\t\t\tk1 += dy1;\n\t\t}\n\t\tj2 += dx2;\n\t\tk2 += dy2;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = bbinary3d;\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/**\n* Apply a binary callback to elements in two broadcasted input arrays and assign results to elements in a three-dimensional nested output array.\n*\n* @module @stdlib/array-base-broadcasted-binary3d\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-add' );\n* var bbinary3d = require( '@stdlib/array-base-broadcasted-binary3d' );\n*\n* var shapes = [\n* [ 1, 1, 2 ],\n* [ 2, 1, 1 ],\n* [ 2, 2, 2 ]\n* ];\n*\n* var x = ones3d( shapes[ 0 ] );\n* var y = ones3d( shapes[ 1 ] );\n* var z = zeros3d( shapes[ 2 ] );\n*\n* bbinary3d( [ x, y, z ], shapes, add );\n*\n* console.log( z );\n* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
5
|
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAiB,QAAS,oCAAqC,EAiCnE,SAASC,EAAWC,EAAQC,EAAQC,EAAM,CACzC,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,EAMJ,GAJAL,EAAK1B,EAAQ,CAAE,EACfQ,EAAKkB,EAAI,CAAE,EACXjB,EAAKiB,EAAI,CAAE,EACXhB,EAAKgB,EAAI,CAAE,EACN,EAAAlB,GAAM,GAAKC,GAAM,GAAKC,GAAM,GAqBjC,IAlBAkB,EAAI/B,EAAgBE,EAAQ,CAAE,EAAGC,EAAQ,CAAE,EAAG0B,CAAG,EACjDG,EAAID,EAAE,KACND,EAAKC,EAAE,QACP1B,EAAMyB,EAAI,CAAE,EACZxB,EAAMwB,EAAI,CAAE,EACZvB,EAAMuB,EAAI,CAAE,EAEZC,EAAI/B,EAAgBE,EAAQ,CAAE,EAAGC,EAAQ,CAAE,EAAG0B,CAAG,EACjDI,EAAIF,EAAE,KACND,EAAKC,EAAE,QACPvB,EAAMsB,EAAI,CAAE,EACZrB,EAAMqB,EAAI,CAAE,EACZpB,EAAMoB,EAAI,CAAE,EAEZI,EAAIhC,EAAQ,CAAE,EAEdiB,EAAK,EACLG,EAAK,EACCN,EAAK,EAAGA,EAAKH,EAAIG,IAAO,CAM7B,IALAE,EAAK,EACLG,EAAK,EACLG,EAAKQ,EAAGb,CAAG,EACXO,EAAKO,EAAGX,CAAG,EACXM,EAAKM,EAAGlB,CAAG,EACLD,EAAK,EAAGA,EAAKH,EAAIG,IAAO,CAM7B,IALAE,EAAK,EACLG,EAAK,EACLG,EAAKC,EAAIN,CAAG,EACZO,EAAKC,EAAIL,CAAG,EACZM,EAAKC,EAAIb,CAAG,EACND,EAAK,EAAGA,EAAKH,EAAIG,IACtBa,EAAIb,CAAG,EAAIV,EAAKmB,EAAIN,CAAG,EAAGQ,EAAIL,CAAG,CAAE,EACnCH,GAAMZ,EACNe,GAAMZ,EAEPU,GAAMZ,EACNe,GAAMZ,CACP,CACAU,GAAMZ,EACNe,GAAMZ,CACP,CACD,CAKAX,EAAO,QAAUE,IC3FjB,IAAIkC,EAAO,IAKX,OAAO,QAAUA",
|
|
6
6
|
"names": ["require_main", "__commonJSMin", "exports", "module", "broadcastArray", "bbinary3d", "arrays", "shapes", "fcn", "dx0", "dx1", "dx2", "dy0", "dy1", "dy2", "S0", "S1", "S2", "i0", "i1", "i2", "j0", "j1", "j2", "k0", "k1", "k2", "x0", "x1", "y0", "y1", "z0", "z1", "sh", "st", "o", "x", "y", "z", "main"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ type InOutShapes = [
|
|
|
84
84
|
* @example
|
|
85
85
|
* var ones3d = require( '@stdlib/array-base-ones3d' );
|
|
86
86
|
* var zeros3d = require( '@stdlib/array-base-zeros3d' );
|
|
87
|
-
* var add = require( '@stdlib/
|
|
87
|
+
* var add = require( '@stdlib/number-float64-base-add' );
|
|
88
88
|
*
|
|
89
89
|
* var shapes = [
|
|
90
90
|
* [ 1, 1, 2 ],
|
package/lib/index.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* @example
|
|
27
27
|
* var ones3d = require( '@stdlib/array-base-ones3d' );
|
|
28
28
|
* var zeros3d = require( '@stdlib/array-base-zeros3d' );
|
|
29
|
-
* var add = require( '@stdlib/
|
|
29
|
+
* var add = require( '@stdlib/number-float64-base-add' );
|
|
30
30
|
* var bbinary3d = require( '@stdlib/array-base-broadcasted-binary3d' );
|
|
31
31
|
*
|
|
32
32
|
* var shapes = [
|
package/lib/main.js
CHANGED
|
@@ -36,7 +36,7 @@ var broadcastArray = require( '@stdlib/array-base-broadcast-array' );
|
|
|
36
36
|
* @example
|
|
37
37
|
* var ones3d = require( '@stdlib/array-base-ones3d' );
|
|
38
38
|
* var zeros3d = require( '@stdlib/array-base-zeros3d' );
|
|
39
|
-
* var add = require( '@stdlib/
|
|
39
|
+
* var add = require( '@stdlib/number-float64-base-add' );
|
|
40
40
|
*
|
|
41
41
|
* var shapes = [
|
|
42
42
|
* [ 1, 1, 2 ],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/array-base-broadcasted-binary3d",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Apply a binary callback to elements in two broadcasted input arrays and assign results to elements in a three-dimensional nested output array.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@stdlib/array-base-broadcast-array": "^0.2.
|
|
33
|
+
"@stdlib/array-base-broadcast-array": "^0.2.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {},
|
|
36
36
|
"engines": {
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
"transform",
|
|
64
64
|
"broadcast"
|
|
65
65
|
],
|
|
66
|
-
"__stdlib__": {},
|
|
67
66
|
"funding": {
|
|
68
67
|
"type": "opencollective",
|
|
69
68
|
"url": "https://opencollective.com/stdlib"
|