@danielsimonjr/mathts-tensor 0.2.18 → 0.2.20

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.
Files changed (44) hide show
  1. package/dist/Tensor.d.ts +176 -0
  2. package/dist/Tensor.d.ts.map +1 -0
  3. package/dist/contraction-sequence.d.ts +93 -0
  4. package/dist/contraction-sequence.d.ts.map +1 -0
  5. package/dist/index.d.ts +37 -1129
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +1 -1
  8. package/dist/named-index.d.ts +76 -0
  9. package/dist/named-index.d.ts.map +1 -0
  10. package/dist/operations/cholesky.d.ts +47 -0
  11. package/dist/operations/cholesky.d.ts.map +1 -0
  12. package/dist/operations/concatenate.d.ts +35 -0
  13. package/dist/operations/concatenate.d.ts.map +1 -0
  14. package/dist/operations/eig.d.ts +50 -0
  15. package/dist/operations/eig.d.ts.map +1 -0
  16. package/dist/operations/flip.d.ts +35 -0
  17. package/dist/operations/flip.d.ts.map +1 -0
  18. package/dist/operations/gather.d.ts +33 -0
  19. package/dist/operations/gather.d.ts.map +1 -0
  20. package/dist/operations/kron.d.ts +38 -0
  21. package/dist/operations/kron.d.ts.map +1 -0
  22. package/dist/operations/lu.d.ts +48 -0
  23. package/dist/operations/lu.d.ts.map +1 -0
  24. package/dist/operations/pad.d.ts +50 -0
  25. package/dist/operations/pad.d.ts.map +1 -0
  26. package/dist/operations/pinv.d.ts +39 -0
  27. package/dist/operations/pinv.d.ts.map +1 -0
  28. package/dist/operations/qr.d.ts +49 -0
  29. package/dist/operations/qr.d.ts.map +1 -0
  30. package/dist/operations/random.d.ts +61 -0
  31. package/dist/operations/random.d.ts.map +1 -0
  32. package/dist/operations/roll.d.ts +44 -0
  33. package/dist/operations/roll.d.ts.map +1 -0
  34. package/dist/operations/scatter.d.ts +54 -0
  35. package/dist/operations/scatter.d.ts.map +1 -0
  36. package/dist/operations/slice.d.ts +43 -0
  37. package/dist/operations/slice.d.ts.map +1 -0
  38. package/dist/operations/solve.d.ts +54 -0
  39. package/dist/operations/solve.d.ts.map +1 -0
  40. package/dist/operations/stack.d.ts +50 -0
  41. package/dist/operations/stack.d.ts.map +1 -0
  42. package/dist/operations/svd.d.ts +56 -0
  43. package/dist/operations/svd.d.ts.map +1 -0
  44. package/package.json +57 -57
@@ -0,0 +1,44 @@
1
+ /**
2
+ * roll — cyclic shift along given axes.
3
+ *
4
+ * Each element is moved `shifts[k]` positions forward along `axes[k]`
5
+ * (wrapping around at the axis boundaries). Negative shifts move backward.
6
+ *
7
+ * When `axes` is omitted, `shifts` must be a single number and the tensor is
8
+ * treated as a flattened 1-D array that is shifted by that amount, then
9
+ * reshaped back to the original shape — exactly matching NumPy `np.roll(t, n)`.
10
+ *
11
+ * Implementation: for each output flat index, the corresponding input flat
12
+ * index is computed by decoding the multi-index, un-shifting each specified
13
+ * axis (with modulo wrap), then re-encoding to a flat input index.
14
+ *
15
+ * Axis-label semantics: cyclic shifting does not change the semantic identity
16
+ * of any axis (it is the same axis with reordered elements), so all axis
17
+ * labels from the input are preserved unchanged in the output.
18
+ */
19
+ import { Tensor } from '../Tensor.js';
20
+ /**
21
+ * Cyclically shift a tensor along given axes.
22
+ *
23
+ * @param t - Input tensor of any rank.
24
+ * @param shifts - Number of positions to shift. A single number when `axes` is
25
+ * omitted (flat shift); an array of the same length as `axes`
26
+ * when `axes` is provided.
27
+ * @param axes - Axes to shift along. Supports negative indexing. When
28
+ * omitted, the tensor is treated as flattened and `shifts` must
29
+ * be a single number.
30
+ * @returns A new `Tensor` with the same shape as `t`, with axis labels
31
+ * preserved from `t`.
32
+ *
33
+ * @throws {Error} If `axes` is provided and `shifts` array length !== `axes`
34
+ * length, or if any axis value is out of range.
35
+ *
36
+ * @example
37
+ * // Shift a rank-1 tensor [1,2,3,4,5] by 2: → [4,5,1,2,3]
38
+ * const r = roll(t, 2, [0]);
39
+ *
40
+ * // Flat shift (no axes):
41
+ * const flat = roll(matrix, 3);
42
+ */
43
+ export declare function roll(t: Tensor, shifts: number | readonly number[], axes?: readonly number[]): Tensor;
44
+ //# sourceMappingURL=roll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roll.d.ts","sourceRoot":"","sources":["../../src/operations/roll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,IAAI,CAClB,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EAClC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GACvB,MAAM,CAkFR"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * scatter — inverse of gather. Writes `updates` into a copy of `t` at the
3
+ * given `indices` along `axis` (NumPy `np.put_along_axis` / JAX `scatter`).
4
+ *
5
+ * For each position `i` in `indices`, the corresponding "slice" of `updates`
6
+ * along `axis` is written into the matching "slice" of the output at position
7
+ * `indices[i]`. All positions of `t` not referenced by `indices` are copied
8
+ * unchanged.
9
+ *
10
+ * Duplicate-index semantics: **last-wins** — when the same index appears more
11
+ * than once in `indices`, the last occurrence overwrites earlier ones. This
12
+ * mirrors NumPy's default scatter behaviour. Document-level note: if
13
+ * deterministic accumulation (e.g. `add`) is needed, use `ScatterOpts.reduce`.
14
+ *
15
+ * Axis-label semantics: the output has exactly the same shape as `t`
16
+ * (scatter never changes the size of any axis), so all axis labels from `t`
17
+ * are preserved unchanged.
18
+ */
19
+ import { Tensor } from '../Tensor.js';
20
+ export interface ScatterOpts {
21
+ /**
22
+ * How to combine `updates` with existing values at the target positions.
23
+ * - `'overwrite'` (default) — last-wins; target is replaced.
24
+ * - `'add'` — target is incremented by the update value.
25
+ */
26
+ reduce?: 'overwrite' | 'add';
27
+ }
28
+ /**
29
+ * Scatter `updates` into a copy of `t` at `indices` along `axis`.
30
+ *
31
+ * @param t - Destination tensor (not mutated). Any rank.
32
+ * @param axis - The axis along which to scatter. Supports negative indexing.
33
+ * @param indices - Target positions along `axis`. Must all be in
34
+ * `[0, t.shape[axis])`. Duplicates are allowed (last-wins
35
+ * by default, or add-accumulate when `opts.reduce === 'add'`).
36
+ * @param updates - Source tensor. Must have the same rank as `t` with
37
+ * `updates.shape[axis] === indices.length` and all other
38
+ * dimensions equal to `t.shape`.
39
+ * @param opts - Optional scatter options.
40
+ * @returns A new `Tensor` with the same shape as `t`, with axis labels
41
+ * preserved from `t`.
42
+ *
43
+ * @throws {Error} If `axis` is out of range, `updates` rank mismatches,
44
+ * or `updates` shape is incompatible.
45
+ * @throws {RangeError} If any index in `indices` is outside `[0, shape[axis])`.
46
+ *
47
+ * @example
48
+ * // Round-trip with gather: scatter zeros back to a masked copy
49
+ * const zeros = new Tensor([3, 4], new Float64Array(12));
50
+ * const result = scatter(zeros, 0, [0, 2], gather(t, 0, [0, 2]));
51
+ * // result[0, :] === t[0, :], result[1, :] === 0, result[2, :] === t[2, :]
52
+ */
53
+ export declare function scatter(t: Tensor, axis: number, indices: readonly number[], updates: Tensor, opts?: ScatterOpts): Tensor;
54
+ //# sourceMappingURL=scatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scatter.d.ts","sourceRoot":"","sources":["../../src/operations/scatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,OAAO,CACrB,CAAC,EAAE,MAAM,EACT,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,WAAW,GACjB,MAAM,CAsFR"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * slice — extract a sub-tensor by per-axis [start, stop, step] ranges.
3
+ *
4
+ * Mirrors NumPy / JAX basic slicing semantics:
5
+ * - Negative indices wrap around: -1 refers to the last element.
6
+ * - `null` range for an axis means "take the entire axis".
7
+ * - `step` must be >= 1 (reverse-step slicing is deferred).
8
+ * - Output shape for axis i: Math.ceil((stop - start) / step).
9
+ *
10
+ * Axis-label semantics: labels from the input axes are preserved in the
11
+ * output. A slice is still the same logical axis — just smaller — so the
12
+ * label name and tags are carried forward (dimension is updated to match the
13
+ * new axis size; the id is re-minted since the Index type is immutable and
14
+ * dimension is part of the index identity).
15
+ */
16
+ import { Tensor } from '../Tensor.js';
17
+ export interface SliceRange {
18
+ /** Default 0. Supports negative indexing: -1 means shape[axis]-1. */
19
+ start?: number;
20
+ /** Default = shape[axis]. Supports negative indexing. */
21
+ stop?: number;
22
+ /** Default 1. Must be >= 1 (no reverse step). */
23
+ step?: number;
24
+ }
25
+ /**
26
+ * Extract a sub-tensor by per-axis `SliceRange` triples.
27
+ *
28
+ * @param t - Input tensor of any rank.
29
+ * @param ranges - Array of length `t.shape.length`. Each element is either a
30
+ * `SliceRange` or `null` (which means "take the entire axis").
31
+ * Must have the same length as `t.shape`.
32
+ * @returns A new `Tensor` whose shape[i] = ceil((stop_i - start_i) / step_i),
33
+ * carrying preserved axis labels (same name/tags, updated dim).
34
+ *
35
+ * @throws {RangeError} If `step` is not a positive integer.
36
+ * @throws {Error} If `ranges.length !== t.shape.length`.
37
+ *
38
+ * @example
39
+ * // Extract rows 1–3 (exclusive), all columns from a 5×4 tensor:
40
+ * const sub = slice(t, [{ start: 1, stop: 3 }, null]);
41
+ */
42
+ export declare function slice(t: Tensor, ranges: (SliceRange | null)[]): Tensor;
43
+ //# sourceMappingURL=slice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slice.d.ts","sourceRoot":"","sources":["../../src/operations/slice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,MAAM,WAAW,UAAU;IACzB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,CA0EtE"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * tensorSolve — named-index linear solver for rank-N tensors.
3
+ *
4
+ * Reshapes tensor A into a square matrix and tensor b into a column vector (or
5
+ * multi-column RHS matrix), solves A·x = b via LU decomposition with partial
6
+ * pivoting, and reshapes the solution back.
7
+ *
8
+ * Axis matching:
9
+ * - When A has `axisLabels` and `b` has `axisLabels`, the "row" axes of A
10
+ * are matched to axes of `b` by Index identity (ignoring prime level).
11
+ * - Otherwise `rowAxesA` / `rowAxesB` (integer indices) must be provided,
12
+ * or the first axes of each tensor are used by default.
13
+ *
14
+ * Constraints:
15
+ * - The reshaped A must be square (numRows_A × numRows_A).
16
+ * - A must be non-singular (LU decomposition throws if pivot is zero).
17
+ * - For multi-RHS, the RHS col dimension must match A's row dimension.
18
+ *
19
+ * Result shape:
20
+ * - `x` has shape [...colDimsA, ...colDimsB] where colDimsA are the axes
21
+ * of A not used as row axes and colDimsB are the axes of b not used as
22
+ * row (contracting) axes.
23
+ * - When A is square as a whole tensor (rank 2), the result has the same
24
+ * shape as b.
25
+ *
26
+ * Axis labels: propagated from A's col axes and b's col axes.
27
+ */
28
+ import { Tensor } from '../Tensor.js';
29
+ import { Index } from '../named-index.js';
30
+ export interface TensorSolveOpts {
31
+ /**
32
+ * Axis indices (integers) or Index objects of A that form the "contracting"
33
+ * (row) side of the square matrix. Default: first `ceil(rank/2)` axes.
34
+ */
35
+ rowAxesA?: ReadonlyArray<number | Index>;
36
+ /**
37
+ * Axis indices (integers) or Index objects of b that form the "contracting"
38
+ * (row) side matched to A's row dimension. Default: first axis of b.
39
+ */
40
+ rowAxesB?: ReadonlyArray<number | Index>;
41
+ }
42
+ export interface TensorSolveResult {
43
+ /** Solution tensor x satisfying A·x ≈ b. */
44
+ x: Tensor;
45
+ }
46
+ /**
47
+ * Solve A·x = b for x using LU decomposition.
48
+ *
49
+ * @param A - Coefficient tensor (rank ≥ 2 when reshaped to square).
50
+ * @param b - Right-hand side tensor.
51
+ * @param opts - Optional axis-selection overrides.
52
+ */
53
+ export declare function tensorSolve(A: Tensor, b: Tensor, opts?: TensorSolveOpts): TensorSolveResult;
54
+ //# sourceMappingURL=solve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solve.d.ts","sourceRoot":"","sources":["../../src/operations/solve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI1C,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,CAAC,EAAE,MAAM,CAAC;CACX;AAoED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,iBAAiB,CA8J3F"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * stack — stack same-shape tensors along a new axis (NumPy `stack`).
3
+ *
4
+ * All input tensors must have identical shapes. A new axis is inserted at
5
+ * position `axis` in the output, making the output rank = input rank + 1.
6
+ * `stack([a, b], 0)` is equivalent to NumPy's `np.stack([a, b], axis=0)`.
7
+ *
8
+ * Axis-label semantics:
9
+ * - The new axis gets `undefined` label by default (it has no correspondence
10
+ * to any input axis).
11
+ * - Pass `opts.newAxisLabel` (an `Index`) to label the new axis explicitly.
12
+ * - The remaining axes inherit labels from `tensors[0]`. If labels disagree
13
+ * across inputs for a given axis, `tensors[0]`'s label is used silently
14
+ * (no error, no warning — document this choice here).
15
+ * - If `tensors[0]` has no `axisLabels`, the output also carries none.
16
+ */
17
+ import { Tensor } from '../Tensor.js';
18
+ import { Index } from '../named-index.js';
19
+ export interface StackOpts {
20
+ /**
21
+ * Optional label for the newly created axis. If omitted, the new axis
22
+ * carries no label (`axisLabels[axis] === undefined` in the output, or more
23
+ * precisely: the output `axisLabels` array contains `undefined` at that
24
+ * position — encoded as `null` in the array but TypeScript sees it as the
25
+ * slot being absent when axisLabels is stripped to only defined entries).
26
+ *
27
+ * In practice: if `tensors[0].axisLabels` is defined, an `Index` for the
28
+ * new axis is created either from this option or as a placeholder.
29
+ */
30
+ newAxisLabel?: Index;
31
+ }
32
+ /**
33
+ * Stack same-shape tensors along a new axis.
34
+ *
35
+ * @param tensors - Array of tensors, all with the same shape. Must be non-empty.
36
+ * @param axis - Position of the new axis in the output. Supports negative
37
+ * indexing relative to the output rank. E.g. `axis=0` inserts
38
+ * a new leading axis; `axis=-1` appends a new trailing axis.
39
+ * @param opts - Optional `newAxisLabel` for the inserted axis.
40
+ * @returns A tensor of rank `inputRank + 1` with `shape[axis] === tensors.length`.
41
+ *
42
+ * @throws {Error} If `tensors` is empty, or if any tensor's shape differs from
43
+ * `tensors[0]`.
44
+ *
45
+ * @example
46
+ * // Stack two row-vectors [a, b, c] and [d, e, f] → 2×3 matrix:
47
+ * const matrix = stack([v1, v2], 0);
48
+ */
49
+ export declare function stack(tensors: Tensor[], axis: number, opts?: StackOpts): Tensor;
50
+ //# sourceMappingURL=stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../src/operations/stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,MAAM,WAAW,SAAS;IACxB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAuF/E"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * tensorSvd — truncated SVD for rank-N tensors.
3
+ *
4
+ * Partitions the axes of `t` into "row" axes (joining with U) and "col" axes
5
+ * (the remaining axes, joining with V), permutes + reshapes `t` into a 2-D
6
+ * matrix, calls the existing DenseMatrix SVD primitive, optionally truncates
7
+ * the singular-value spectrum, and reshapes U / S / V back into Tensors.
8
+ *
9
+ * Phase-2 note: `rowAxes` is positional-integer-only. The named-Index overload
10
+ * (accepting `ReadonlyArray<Index>`) is reserved for the Phase-1-enabled
11
+ * follow-up once `Index` is part of the Tensor surface.
12
+ *
13
+ * The `joiningIndexName` option is accepted for forward-compatibility with the
14
+ * labelled-tensor extension but is unused in Phase 2 — the output Tensors carry
15
+ * no `axisLabels`.
16
+ */
17
+ import { Tensor } from '../Tensor.js';
18
+ export interface TensorSvdOpts {
19
+ /** If set, keep at most `maxdim` singular values. */
20
+ maxdim?: number;
21
+ /**
22
+ * If set, drop singular values whose absolute value is strictly less than
23
+ * `cutoff`. Default is 0 (no cutoff). The test is `s >= cutoff`.
24
+ */
25
+ cutoff?: number;
26
+ /**
27
+ * Accepted for forward-compatibility with the labelled-tensor extension
28
+ * (Phase-2-extension follow-up). Currently unused — output Tensors carry
29
+ * no `axisLabels` in Phase 2.
30
+ */
31
+ joiningIndexName?: string;
32
+ }
33
+ export interface TensorSvdResult {
34
+ /** U factor reshaped to [...rowDims, k]. */
35
+ U: Tensor;
36
+ /** Singular values as a rank-1 Tensor of shape [k]. */
37
+ S: Tensor;
38
+ /** V factor reshaped to [k, ...colDims]. */
39
+ V: Tensor;
40
+ /** Number of singular values retained after truncation. */
41
+ truncatedDim: number;
42
+ /** Sum of squares of the dropped singular values (Frobenius-norm squared of the discarded part). */
43
+ truncationError: number;
44
+ }
45
+ /**
46
+ * Truncated tensor SVD using the pure-JS DenseMatrix SVD primitive (synchronous).
47
+ */
48
+ export declare function tensorSvd(t: Tensor, rowAxes: ReadonlyArray<number>, opts?: TensorSvdOpts): TensorSvdResult;
49
+ /**
50
+ * Truncated tensor SVD routed through the AssemblyScript WASM SVD kernel
51
+ * (`svdWasm`) — the same result as {@link tensorSvd} but accelerated for large
52
+ * matricisations. Async because WASM instantiation is async; falls back to JS
53
+ * inside `svdWasm` when no binary is available.
54
+ */
55
+ export declare function tensorSvdWasm(t: Tensor, rowAxes: ReadonlyArray<number>, opts?: TensorSvdOpts): Promise<TensorSvdResult>;
56
+ //# sourceMappingURL=svd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svd.d.ts","sourceRoot":"","sources":["../../src/operations/svd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,MAAM,WAAW,aAAa;IAC5B,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,CAAC,EAAE,MAAM,CAAC;IACV,uDAAuD;IACvD,CAAC,EAAE,MAAM,CAAC;IACV,4CAA4C;IAC5C,CAAC,EAAE,MAAM,CAAC;IACV,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,oGAAoG;IACpG,eAAe,EAAE,MAAM,CAAC;CACzB;AAkID;;GAEG;AACH,wBAAgB,SAAS,CACvB,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAC9B,IAAI,CAAC,EAAE,aAAa,GACnB,eAAe,CAGjB;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAC9B,IAAI,CAAC,EAAE,aAAa,GACnB,OAAO,CAAC,eAAe,CAAC,CAG1B"}
package/package.json CHANGED
@@ -1,57 +1,57 @@
1
- {
2
- "name": "@danielsimonjr/mathts-tensor",
3
- "version": "0.2.18",
4
- "description": "Rank-N dense Tensor type for MathTS with Float64Array-backed storage",
5
- "author": "Daniel Simon Jr.",
6
- "license": "MIT",
7
- "type": "module",
8
- "main": "./dist/index.js",
9
- "module": "./dist/index.js",
10
- "types": "./dist/index.d.ts",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.js",
14
- "types": "./dist/index.d.ts"
15
- }
16
- },
17
- "files": [
18
- "dist",
19
- "README.md"
20
- ],
21
- "scripts": {
22
- "build": "tsup src/index.ts --format esm --dts --clean",
23
- "dev": "tsup src/index.ts --format esm --dts --watch",
24
- "test": "vitest run",
25
- "test:watch": "vitest",
26
- "test:coverage": "vitest run --coverage",
27
- "typecheck": "tsc --noEmit",
28
- "lint": "eslint src --ext .ts",
29
- "lint:fix": "eslint src --ext .ts --fix",
30
- "clean": "rm -rf dist",
31
- "build:prod": "tsup src/index.ts --format esm --dts --clean --minify --treeshake"
32
- },
33
- "dependencies": {
34
- "@danielsimonjr/mathts-core": "^0.13.0",
35
- "@danielsimonjr/mathts-matrix": "^0.7.0"
36
- },
37
- "devDependencies": {
38
- "@types/node": "^25.5.2",
39
- "tsup": "^8.0.0",
40
- "typescript": "^5.3.0",
41
- "vitest": "^4.1.5"
42
- },
43
- "publishConfig": {
44
- "access": "public"
45
- },
46
- "repository": {
47
- "type": "git",
48
- "url": "https://github.com/danielsimonjr/mathts",
49
- "directory": "tensor"
50
- },
51
- "keywords": [
52
- "math",
53
- "tensor",
54
- "linear-algebra",
55
- "typescript"
56
- ]
57
- }
1
+ {
2
+ "name": "@danielsimonjr/mathts-tensor",
3
+ "version": "0.2.20",
4
+ "description": "Rank-N dense Tensor type for MathTS with Float64Array-backed storage",
5
+ "author": "Daniel Simon Jr.",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "./dist/index.js",
9
+ "module": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsup src/index.ts --format esm --clean && tsc -p tsconfig.dts.json",
23
+ "dev": "tsup src/index.ts --format esm --dts --watch",
24
+ "test": "bun test --isolate --timeout 30000",
25
+ "test:watch": "vitest",
26
+ "test:coverage": "bun test --isolate --timeout 30000 --coverage",
27
+ "typecheck": "tsc --noEmit",
28
+ "lint": "oxlint src",
29
+ "lint:fix": "oxlint src --fix",
30
+ "clean": "rm -rf dist",
31
+ "build:prod": "tsup src/index.ts --format esm --dts --clean --minify --treeshake"
32
+ },
33
+ "dependencies": {
34
+ "@danielsimonjr/mathts-core": "^0.15.0",
35
+ "@danielsimonjr/mathts-matrix": "^0.7.2"
36
+ },
37
+ "devDependencies": {
38
+ "@types/node": "^26.4.0",
39
+ "tsup": "^8.0.0",
40
+ "typescript": "^7.0.2",
41
+ "vitest": "^5.0.0"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/danielsimonjr/MathTS.git",
49
+ "directory": "tensor"
50
+ },
51
+ "keywords": [
52
+ "math",
53
+ "tensor",
54
+ "linear-algebra",
55
+ "typescript"
56
+ ]
57
+ }