numpy-ts 0.5.0 → 0.7.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 +36 -38
- package/dist/numpy-ts.browser.js +2 -2
- package/dist/numpy-ts.esm.js +2 -2
- package/dist/numpy-ts.node-io.cjs +2 -2
- package/dist/numpy-ts.node-io.cjs.map +4 -4
- package/dist/numpy-ts.node-io.mjs +2 -2
- package/dist/numpy-ts.node-io.mjs.map +4 -4
- package/dist/numpy-ts.node.cjs +2 -2
- package/dist/numpy-ts.node.cjs.map +4 -4
- package/dist/types/core/broadcasting.d.ts +18 -0
- package/dist/types/core/ndarray.d.ts +989 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/ops/advanced.d.ts +74 -0
- package/dist/types/ops/arithmetic.d.ts +54 -0
- package/dist/types/ops/bitwise.d.ts +91 -0
- package/dist/types/ops/comparison.d.ts +12 -0
- package/dist/types/ops/linalg.d.ts +51 -0
- package/dist/types/ops/reduction.d.ts +76 -0
- package/dist/types/ops/shape.d.ts +44 -0
- package/dist/types/ops/trig.d.ts +16 -0
- package/package.json +5 -4
|
@@ -54,6 +54,24 @@ export declare function broadcastTo(storage: ArrayStorage, targetShape: readonly
|
|
|
54
54
|
* @throws Error if arrays have incompatible shapes
|
|
55
55
|
*/
|
|
56
56
|
export declare function broadcastArrays(storages: ArrayStorage[]): ArrayStorage[];
|
|
57
|
+
/**
|
|
58
|
+
* Compute the broadcast shape for multiple shapes without creating arrays.
|
|
59
|
+
* Returns the resulting shape if all shapes are broadcast-compatible.
|
|
60
|
+
*
|
|
61
|
+
* This is the NumPy-compatible function for computing broadcast shape.
|
|
62
|
+
*
|
|
63
|
+
* @param shapes - Variable number of shapes to broadcast
|
|
64
|
+
* @returns The broadcast output shape
|
|
65
|
+
* @throws Error if shapes are not broadcast-compatible
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* broadcastShapes([3, 4], [4]); // [3, 4]
|
|
70
|
+
* broadcastShapes([3, 4], [3, 1]); // [3, 4]
|
|
71
|
+
* broadcastShapes([3, 4], [5]); // Error
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function broadcastShapes(...shapes: readonly number[][]): number[];
|
|
57
75
|
/**
|
|
58
76
|
* Generate a descriptive error message for broadcasting failures
|
|
59
77
|
*
|