@stdlib/ndarray-base-broadcast-array 0.2.1 → 0.2.2
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 +2 -2
- package/dist/index.js +18 -4
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -197,8 +197,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
197
197
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/ndarray-base-broadcast-array.svg
|
|
198
198
|
[npm-url]: https://npmjs.org/package/@stdlib/ndarray-base-broadcast-array
|
|
199
199
|
|
|
200
|
-
[test-image]: https://github.com/stdlib-js/ndarray-base-broadcast-array/actions/workflows/test.yml/badge.svg?branch=v0.2.
|
|
201
|
-
[test-url]: https://github.com/stdlib-js/ndarray-base-broadcast-array/actions/workflows/test.yml?query=branch:v0.2.
|
|
200
|
+
[test-image]: https://github.com/stdlib-js/ndarray-base-broadcast-array/actions/workflows/test.yml/badge.svg?branch=v0.2.2
|
|
201
|
+
[test-url]: https://github.com/stdlib-js/ndarray-base-broadcast-array/actions/workflows/test.yml?query=branch:v0.2.2
|
|
202
202
|
|
|
203
203
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/ndarray-base-broadcast-array/main.svg
|
|
204
204
|
[coverage-url]: https://codecov.io/github/stdlib-js/ndarray-base-broadcast-array?branch=main
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
"use strict";var m=function(a,r){return function(){return r||a((r={exports:{}}).exports,r),r.exports}};var c=m(function(x,f){
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";var m=function(a,r){return function(){return r||a((r={exports:{}}).exports,r),r.exports}};var c=m(function(x,f){"use strict";var t=require("@stdlib/array-base-copy-indexed"),g=require("@stdlib/ndarray-base-ctor"),l=require("@stdlib/ndarray-base-shape"),y=require("@stdlib/ndarray-base-strides"),q=require("@stdlib/ndarray-base-offset"),b=require("@stdlib/ndarray-base-order"),w=require("@stdlib/ndarray-base-dtype"),D=require("@stdlib/ndarray-base-data-buffer"),p=require("@stdlib/string-format");function j(a,r){var i,o,s,v,n,u,d,e,h;if(n=r.length,s=l(a,!1),u=s.length,n<u)throw 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.");for(i=[],e=0;e<n;e++)i.push(0);for(v=y(a,!1),e=n-1;e>=0;e--)if(h=u-n+e,!(h<0)){if(d=s[h],o=r[e],o!==0&&o<d)throw new Error(p("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.",t(s).join(", "),t(r).join(", "),e));if(d===o)i[e]=v[h];else if(d===1)i[e]=0;else throw new Error(p("invalid argument. Input array and the specified shape are broadcast incompatible. Array shape: (%s). Desired shape: (%s). Dimension: %u.",t(s).join(", "),t(r).join(", "),e))}return g(w(a),D(a),t(r),i,q(a),b(a))}f.exports=j});var A=c();module.exports=A;
|
|
2
|
+
/**
|
|
3
|
+
* @license Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2021 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
|
+
*/
|
|
5
19
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/ndarray-base-broadcast-array",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Broadcast an ndarray to a specified shape.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@stdlib/array-base-copy-indexed": "^0.2.1",
|
|
34
|
-
"@stdlib/ndarray-base-ctor": "^0.2.
|
|
35
|
-
"@stdlib/ndarray-base-data-buffer": "^0.2.
|
|
36
|
-
"@stdlib/ndarray-base-dtype": "^0.2.
|
|
37
|
-
"@stdlib/ndarray-base-offset": "^0.2.
|
|
38
|
-
"@stdlib/ndarray-base-order": "^0.2.
|
|
34
|
+
"@stdlib/ndarray-base-ctor": "^0.2.2",
|
|
35
|
+
"@stdlib/ndarray-base-data-buffer": "^0.2.2",
|
|
36
|
+
"@stdlib/ndarray-base-dtype": "^0.2.2",
|
|
37
|
+
"@stdlib/ndarray-base-offset": "^0.2.2",
|
|
38
|
+
"@stdlib/ndarray-base-order": "^0.2.2",
|
|
39
39
|
"@stdlib/ndarray-base-shape": "^0.2.1",
|
|
40
40
|
"@stdlib/ndarray-base-strides": "^0.2.1",
|
|
41
|
-
"@stdlib/string-format": "^0.2.
|
|
42
|
-
"@stdlib/error-tools-fmtprodmsg": "^0.2.
|
|
41
|
+
"@stdlib/string-format": "^0.2.2",
|
|
42
|
+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {},
|
|
45
45
|
"engines": {
|