@stdlib/array-base-binary4d 0.1.0 → 0.2.1
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 +6 -3
- package/SECURITY.md +5 -0
- package/dist/index.js.map +1 -1
- package/docs/types/index.d.ts +5 -4
- package/lib/main.js +1 -1
- package/package.json +5 -28
- package/CITATION.cff +0 -30
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2024 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -162,7 +162,7 @@ See [LICENSE][stdlib-license].
|
|
|
162
162
|
|
|
163
163
|
## Copyright
|
|
164
164
|
|
|
165
|
-
Copyright © 2016-
|
|
165
|
+
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
166
166
|
|
|
167
167
|
</section>
|
|
168
168
|
|
|
@@ -175,8 +175,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
175
175
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/array-base-binary4d.svg
|
|
176
176
|
[npm-url]: https://npmjs.org/package/@stdlib/array-base-binary4d
|
|
177
177
|
|
|
178
|
-
[test-image]: https://github.com/stdlib-js/array-base-binary4d/actions/workflows/test.yml/badge.svg?branch=v0.1
|
|
179
|
-
[test-url]: https://github.com/stdlib-js/array-base-binary4d/actions/workflows/test.yml?query=branch:v0.1
|
|
178
|
+
[test-image]: https://github.com/stdlib-js/array-base-binary4d/actions/workflows/test.yml/badge.svg?branch=v0.2.1
|
|
179
|
+
[test-url]: https://github.com/stdlib-js/array-base-binary4d/actions/workflows/test.yml?query=branch:v0.2.1
|
|
180
180
|
|
|
181
181
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-binary4d/main.svg
|
|
182
182
|
[coverage-url]: https://codecov.io/github/stdlib-js/array-base-binary4d?branch=main
|
|
@@ -199,8 +199,11 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
199
199
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
200
200
|
|
|
201
201
|
[deno-url]: https://github.com/stdlib-js/array-base-binary4d/tree/deno
|
|
202
|
+
[deno-readme]: https://github.com/stdlib-js/array-base-binary4d/blob/deno/README.md
|
|
202
203
|
[umd-url]: https://github.com/stdlib-js/array-base-binary4d/tree/umd
|
|
204
|
+
[umd-readme]: https://github.com/stdlib-js/array-base-binary4d/blob/umd/README.md
|
|
203
205
|
[esm-url]: https://github.com/stdlib-js/array-base-binary4d/tree/esm
|
|
206
|
+
[esm-readme]: https://github.com/stdlib-js/array-base-binary4d/blob/esm/README.md
|
|
204
207
|
[branches-url]: https://github.com/stdlib-js/array-base-binary4d/blob/main/branches.md
|
|
205
208
|
|
|
206
209
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-base-binary4d/main/LICENSE
|
package/SECURITY.md
ADDED
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// MAIN //\n\n/**\n* Applies a binary callback to elements in two four-dimensional nested input arrays and assigns results to elements in a four-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject<Array<Collection>>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn -
|
|
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// MAIN //\n\n/**\n* Applies a binary callback to elements in two four-dimensional nested input arrays and assigns results to elements in a four-dimensional nested output array.\n*\n* ## Notes\n*\n* - The function assumes that the input and output arrays have the same shape.\n*\n* @param {ArrayLikeObject<Array<Collection>>} arrays - array-like object containing two input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - binary callback\n* @returns {void}\n*\n* @example\n* var ones4d = require( '@stdlib/array-base-ones4d' );\n* var zeros4d = require( '@stdlib/array-base-zeros4d' );\n* var add = require( '@stdlib/math-base-ops-add' );\n*\n* var shape = [ 1, 2, 2, 2 ];\n*\n* var x = ones4d( shape );\n* var y = ones4d( shape );\n* var z = zeros4d( shape );\n*\n* binary4d( [ x, y, z ], shape, 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 binary4d( arrays, shape, fcn ) {\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar x0;\n\tvar x1;\n\tvar x2;\n\tvar y0;\n\tvar y1;\n\tvar y2;\n\tvar z0;\n\tvar z1;\n\tvar z2;\n\tvar x;\n\tvar y;\n\tvar z;\n\n\tS0 = shape[ 3 ];\n\tS1 = shape[ 2 ];\n\tS2 = shape[ 1 ];\n\tS3 = shape[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 ) {\n\t\treturn;\n\t}\n\tx = arrays[ 0 ];\n\ty = arrays[ 1 ];\n\tz = arrays[ 2 ];\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tx2 = x[ i3 ];\n\t\ty2 = y[ i3 ];\n\t\tz2 = z[ i3 ];\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tx1 = x2[ i2 ];\n\t\t\ty1 = y2[ i2 ];\n\t\t\tz1 = z2[ i2 ];\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tx0 = x1[ i1 ];\n\t\t\t\ty0 = y1[ i1 ];\n\t\t\t\tz0 = z1[ i1 ];\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tz0[ i0 ] = fcn( x0[ i0 ], y0[ i0 ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = binary4d;\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 four-dimensional nested input arrays and assign results to elements in a four-dimensional nested output array.\n*\n* @module @stdlib/array-base-binary4d\n*\n* @example\n* var ones4d = require( '@stdlib/array-base-ones4d' );\n* var zeros4d = require( '@stdlib/array-base-zeros4d' );\n* var add = require( '@stdlib/math-base-ops-add' );\n* var binary4d = require( '@stdlib/array-base-binary4d' );\n*\n* var shape = [ 1, 2, 2, 2 ];\n*\n* var x = ones4d( shape );\n* var y = ones4d( shape );\n* var z = zeros4d( shape );\n*\n* binary4d( [ x, y, z ], shape, 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,cAkDA,SAASC,EAAUC,EAAQC,EAAOC,EAAM,CACvC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAMJ,GAJAnB,EAAKF,EAAO,CAAE,EACdG,EAAKH,EAAO,CAAE,EACdI,EAAKJ,EAAO,CAAE,EACdK,EAAKL,EAAO,CAAE,EACT,EAAAE,GAAM,GAAKC,GAAM,GAAKC,GAAM,GAAKC,GAAM,GAM5C,IAHAc,EAAIpB,EAAQ,CAAE,EACdqB,EAAIrB,EAAQ,CAAE,EACdsB,EAAItB,EAAQ,CAAE,EACRU,EAAK,EAAGA,EAAKJ,EAAII,IAItB,IAHAG,EAAKO,EAAGV,CAAG,EACXM,EAAKK,EAAGX,CAAG,EACXS,EAAKG,EAAGZ,CAAG,EACLD,EAAK,EAAGA,EAAKJ,EAAII,IAItB,IAHAG,EAAKC,EAAIJ,CAAG,EACZM,EAAKC,EAAIP,CAAG,EACZS,EAAKC,EAAIV,CAAG,EACND,EAAK,EAAGA,EAAKJ,EAAII,IAItB,IAHAG,EAAKC,EAAIJ,CAAG,EACZM,EAAKC,EAAIP,CAAG,EACZS,EAAKC,EAAIV,CAAG,EACND,EAAK,EAAGA,EAAKJ,EAAII,IACtBU,EAAIV,CAAG,EAAIL,EAAKS,EAAIJ,CAAG,EAAGO,EAAIP,CAAG,CAAE,CAKxC,CAKAT,EAAO,QAAUC,IC5DjB,IAAIwB,EAAO,IAKX,OAAO,QAAUA",
|
|
6
6
|
"names": ["require_main", "__commonJSMin", "exports", "module", "binary4d", "arrays", "shape", "fcn", "S0", "S1", "S2", "S3", "i0", "i1", "i2", "i3", "x0", "x1", "x2", "y0", "y1", "y2", "z0", "z1", "z2", "x", "y", "z", "main"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -26,7 +26,8 @@ import { Shape4D } from '@stdlib/types/ndarray';
|
|
|
26
26
|
/**
|
|
27
27
|
* Binary callback.
|
|
28
28
|
*
|
|
29
|
-
* @param
|
|
29
|
+
* @param v1 - element from first input array
|
|
30
|
+
* @param v2 - element from second input array
|
|
30
31
|
* @returns result
|
|
31
32
|
*/
|
|
32
33
|
type Binary<T, U, V> = ( v1: T, v2: U ) => V;
|
|
@@ -43,9 +44,9 @@ type Binary<T, U, V> = ( v1: T, v2: U ) => V;
|
|
|
43
44
|
* @param fcn - binary callback
|
|
44
45
|
*
|
|
45
46
|
* @example
|
|
46
|
-
* var ones4d = require(
|
|
47
|
-
* var zeros4d = require(
|
|
48
|
-
* var add = require(
|
|
47
|
+
* var ones4d = require( '@stdlib/array-base-ones4d' );
|
|
48
|
+
* var zeros4d = require( '@stdlib/array-base-zeros4d' );
|
|
49
|
+
* var add = require( '@stdlib/math-base-ops-add' );
|
|
49
50
|
*
|
|
50
51
|
* var shape = [ 1, 2, 2, 2 ];
|
|
51
52
|
*
|
package/lib/main.js
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
*
|
|
30
30
|
* @param {ArrayLikeObject<Array<Collection>>} arrays - array-like object containing two input nested arrays and one output nested array
|
|
31
31
|
* @param {NonNegativeIntegerArray} shape - array shape
|
|
32
|
-
* @param {Callback} fcn -
|
|
32
|
+
* @param {Callback} fcn - binary callback
|
|
33
33
|
* @returns {void}
|
|
34
34
|
*
|
|
35
35
|
* @example
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/array-base-binary4d",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Apply a binary callback to elements in two four-dimensional nested input arrays and assign results to elements in a four-dimensional nested output array.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -15,19 +15,12 @@
|
|
|
15
15
|
],
|
|
16
16
|
"main": "./lib",
|
|
17
17
|
"directories": {
|
|
18
|
-
"benchmark": "./benchmark",
|
|
19
18
|
"doc": "./docs",
|
|
20
|
-
"example": "./examples",
|
|
21
19
|
"lib": "./lib",
|
|
22
|
-
"
|
|
20
|
+
"dist": "./dist"
|
|
23
21
|
},
|
|
24
22
|
"types": "./docs/types",
|
|
25
|
-
"scripts": {
|
|
26
|
-
"test": "make test",
|
|
27
|
-
"test-cov": "make test-cov",
|
|
28
|
-
"examples": "make examples",
|
|
29
|
-
"benchmark": "make benchmark"
|
|
30
|
-
},
|
|
23
|
+
"scripts": {},
|
|
31
24
|
"homepage": "https://stdlib.io",
|
|
32
25
|
"repository": {
|
|
33
26
|
"type": "git",
|
|
@@ -36,24 +29,8 @@
|
|
|
36
29
|
"bugs": {
|
|
37
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
31
|
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"@stdlib/array-base-filled4d-by": "^0.1.0",
|
|
44
|
-
"@stdlib/array-base-zeros4d": "^0.1.0",
|
|
45
|
-
"@stdlib/bench": "^0.1.0",
|
|
46
|
-
"@stdlib/math-base-assert-is-nan": "^0.1.0",
|
|
47
|
-
"@stdlib/math-base-ops-add": "^0.1.0",
|
|
48
|
-
"@stdlib/math-base-special-floor": "^0.1.0",
|
|
49
|
-
"@stdlib/math-base-special-pow": "^0.1.0",
|
|
50
|
-
"@stdlib/ndarray-base-numel": "^0.1.0",
|
|
51
|
-
"@stdlib/random-base-discrete-uniform": "^0.0.6",
|
|
52
|
-
"@stdlib/random-base-uniform": "^0.0.6",
|
|
53
|
-
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
54
|
-
"istanbul": "^0.4.1",
|
|
55
|
-
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
|
|
56
|
-
},
|
|
32
|
+
"dependencies": {},
|
|
33
|
+
"devDependencies": {},
|
|
57
34
|
"engines": {
|
|
58
35
|
"node": ">=0.10.0",
|
|
59
36
|
"npm": ">2.7.0"
|
package/CITATION.cff
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
cff-version: 1.2.0
|
|
2
|
-
title: stdlib
|
|
3
|
-
message: >-
|
|
4
|
-
If you use this software, please cite it using the
|
|
5
|
-
metadata from this file.
|
|
6
|
-
|
|
7
|
-
type: software
|
|
8
|
-
|
|
9
|
-
authors:
|
|
10
|
-
- name: The Stdlib Authors
|
|
11
|
-
url: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
12
|
-
|
|
13
|
-
repository-code: https://github.com/stdlib-js/stdlib
|
|
14
|
-
url: https://stdlib.io
|
|
15
|
-
|
|
16
|
-
abstract: |
|
|
17
|
-
Standard library for JavaScript and Node.js.
|
|
18
|
-
|
|
19
|
-
keywords:
|
|
20
|
-
- JavaScript
|
|
21
|
-
- Node.js
|
|
22
|
-
- TypeScript
|
|
23
|
-
- standard library
|
|
24
|
-
- scientific computing
|
|
25
|
-
- numerical computing
|
|
26
|
-
- statistical computing
|
|
27
|
-
|
|
28
|
-
license: Apache-2.0 AND BSL-1.0
|
|
29
|
-
|
|
30
|
-
date-released: 2016
|