@stdlib/array-base-ternary2d 0.2.2 → 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 +1 -2
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ var ternary2d = require( '@stdlib/array-base-ternary2d' );
|
|
|
64
64
|
Applies a ternary callback to elements in three two-dimensional nested input arrays and assigns results to elements in a two-dimensional nested output array.
|
|
65
65
|
|
|
66
66
|
```javascript
|
|
67
|
-
var add = require( '@stdlib/
|
|
67
|
+
var add = require( '@stdlib/number-float64-base-add3' );
|
|
68
68
|
var zeros2d = require( '@stdlib/array-base-zeros2d' );
|
|
69
69
|
|
|
70
70
|
var x = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ];
|
|
@@ -106,7 +106,7 @@ The function accepts the following arguments:
|
|
|
106
106
|
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' ).factory;
|
|
107
107
|
var filled2dBy = require( '@stdlib/array-base-filled2d-by' );
|
|
108
108
|
var zeros2d = require( '@stdlib/array-base-zeros2d' );
|
|
109
|
-
var add = require( '@stdlib/
|
|
109
|
+
var add = require( '@stdlib/number-float64-base-add3' );
|
|
110
110
|
var ternary2d = require( '@stdlib/array-base-ternary2d' );
|
|
111
111
|
|
|
112
112
|
var shape = [ 3, 3 ];
|
|
@@ -165,7 +165,7 @@ See [LICENSE][stdlib-license].
|
|
|
165
165
|
|
|
166
166
|
## Copyright
|
|
167
167
|
|
|
168
|
-
Copyright © 2016-
|
|
168
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
169
169
|
|
|
170
170
|
</section>
|
|
171
171
|
|
|
@@ -178,8 +178,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
178
178
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/array-base-ternary2d.svg
|
|
179
179
|
[npm-url]: https://npmjs.org/package/@stdlib/array-base-ternary2d
|
|
180
180
|
|
|
181
|
-
[test-image]: https://github.com/stdlib-js/array-base-ternary2d/actions/workflows/test.yml/badge.svg?branch=v0.2.
|
|
182
|
-
[test-url]: https://github.com/stdlib-js/array-base-ternary2d/actions/workflows/test.yml?query=branch:v0.2.
|
|
181
|
+
[test-image]: https://github.com/stdlib-js/array-base-ternary2d/actions/workflows/test.yml/badge.svg?branch=v0.2.3
|
|
182
|
+
[test-url]: https://github.com/stdlib-js/array-base-ternary2d/actions/workflows/test.yml?query=branch:v0.2.3
|
|
183
183
|
|
|
184
184
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-ternary2d/main.svg
|
|
185
185
|
[coverage-url]: https://codecov.io/github/stdlib-js/array-base-ternary2d?branch=main
|
|
@@ -191,8 +191,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
191
191
|
|
|
192
192
|
-->
|
|
193
193
|
|
|
194
|
-
[chat-image]: https://img.shields.io/
|
|
195
|
-
[chat-url]: https://
|
|
194
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
195
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
196
196
|
|
|
197
197
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
198
198
|
|
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 ternary callback to elements in three two-dimensional nested input arrays and assigns results to elements in a two-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 three input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - ternary callback\n* @returns {void}\n*\n* @example\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// MAIN //\n\n/**\n* Applies a ternary callback to elements in three two-dimensional nested input arrays and assigns results to elements in a two-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 three input nested arrays and one output nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {Callback} fcn - ternary callback\n* @returns {void}\n*\n* @example\n* var add = require( '@stdlib/number-float64-base-add3' );\n* var ones2d = require( '@stdlib/array-base-ones2d' );\n* var zeros2d = require( '@stdlib/array-base-zeros2d' );\n*\n* var shape = [ 2, 2 ];\n*\n* var x = ones2d( shape );\n* var y = ones2d( shape );\n* var z = ones2d( shape );\n* var out = zeros2d( shape );\n*\n* ternary2d( [ x, y, z, out ], shape, add );\n*\n* console.log( out );\n* // => [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ]\n*/\nfunction ternary2d( arrays, shape, fcn ) {\n\tvar S0;\n\tvar S1;\n\tvar i0;\n\tvar i1;\n\tvar x0;\n\tvar y0;\n\tvar z0;\n\tvar w0;\n\tvar x;\n\tvar y;\n\tvar z;\n\tvar w;\n\n\tS0 = shape[ 1 ];\n\tS1 = shape[ 0 ];\n\tif ( S0 <= 0 || S1 <= 0 ) {\n\t\treturn;\n\t}\n\tx = arrays[ 0 ];\n\ty = arrays[ 1 ];\n\tz = arrays[ 2 ];\n\tw = arrays[ 3 ];\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tx0 = x[ i1 ];\n\t\ty0 = y[ i1 ];\n\t\tz0 = z[ i1 ];\n\t\tw0 = w[ i1 ];\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tw0[ i0 ] = fcn( x0[ i0 ], y0[ i0 ], z0[ i0 ] );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ternary2d;\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 ternary callback to elements in three two-dimensional nested input arrays and assign results to elements in a two-dimensional nested output array.\n*\n* @module @stdlib/array-base-ternary2d\n*\n* @example\n* var add = require( '@stdlib/number-float64-base-add3' );\n* var ones2d = require( '@stdlib/array-base-ones2d' );\n* var zeros2d = require( '@stdlib/array-base-zeros2d' );\n* var ternary2d = require( '@stdlib/array-base-ternary2d' );\n*\n* var shape = [ 2, 2 ];\n*\n* var x = ones2d( shape );\n* var y = ones2d( shape );\n* var z = ones2d( shape );\n* var out = zeros2d( shape );\n*\n* ternary2d( [ x, y, z, out ], shape, add );\n*\n* console.log( out );\n* // => [ [ 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"],
|
|
5
5
|
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAmDA,SAASC,EAAWC,EAAQC,EAAOC,EAAM,CACxC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACA,EACAC,EACAC,EACA,EAIJ,GAFAT,EAAKF,EAAO,CAAE,EACdG,EAAKH,EAAO,CAAE,EACT,EAAAE,GAAM,GAAKC,GAAM,GAOtB,IAJA,EAAIJ,EAAQ,CAAE,EACdW,EAAIX,EAAQ,CAAE,EACdY,EAAIZ,EAAQ,CAAE,EACd,EAAIA,EAAQ,CAAE,EACRM,EAAK,EAAGA,EAAKF,EAAIE,IAKtB,IAJAC,EAAK,EAAGD,CAAG,EACXE,EAAKG,EAAGL,CAAG,EACXG,EAAKG,EAAGN,CAAG,EACXI,EAAK,EAAGJ,CAAG,EACLD,EAAK,EAAGA,EAAKF,EAAIE,IACtBK,EAAIL,CAAG,EAAIH,EAAKK,EAAIF,CAAG,EAAGG,EAAIH,CAAG,EAAGI,EAAIJ,CAAG,CAAE,CAGhD,CAKAP,EAAO,QAAUC,IC1CjB,IAAIc,EAAO,IAKX,OAAO,QAAUA",
|
|
6
6
|
"names": ["require_main", "__commonJSMin", "exports", "module", "ternary2d", "arrays", "shape", "fcn", "S0", "S1", "i0", "i1", "x0", "y0", "z0", "w0", "y", "z", "main"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ type Ternary<T, U, V, W> = ( v1: T, v2: U, v3: V ) => W;
|
|
|
45
45
|
* @param fcn - ternary callback
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
|
-
* var add = require( '@stdlib/
|
|
48
|
+
* var add = require( '@stdlib/number-float64-base-add3' );
|
|
49
49
|
* var ones2d = require( '@stdlib/array-base-ones2d' );
|
|
50
50
|
* var zeros2d = require( '@stdlib/array-base-zeros2d' );
|
|
51
51
|
*
|
package/lib/index.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* @module @stdlib/array-base-ternary2d
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
|
-
* var add = require( '@stdlib/
|
|
27
|
+
* var add = require( '@stdlib/number-float64-base-add3' );
|
|
28
28
|
* var ones2d = require( '@stdlib/array-base-ones2d' );
|
|
29
29
|
* var zeros2d = require( '@stdlib/array-base-zeros2d' );
|
|
30
30
|
* var ternary2d = require( '@stdlib/array-base-ternary2d' );
|
package/lib/main.js
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* @returns {void}
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
|
-
* var add = require( '@stdlib/
|
|
36
|
+
* var add = require( '@stdlib/number-float64-base-add3' );
|
|
37
37
|
* var ones2d = require( '@stdlib/array-base-ones2d' );
|
|
38
38
|
* var zeros2d = require( '@stdlib/array-base-zeros2d' );
|
|
39
39
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/array-base-ternary2d",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Apply a ternary callback to elements in three two-dimensional nested input arrays and assign results to elements in a two-dimensional nested output array.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
"map",
|
|
61
61
|
"transform"
|
|
62
62
|
],
|
|
63
|
-
"__stdlib__": {},
|
|
64
63
|
"funding": {
|
|
65
64
|
"type": "opencollective",
|
|
66
65
|
"url": "https://opencollective.com/stdlib"
|