@topolab/tda 0.0.0-stage → 0.4.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/CHANGELOG.md +106 -0
- package/CITATION.cff +72 -0
- package/LICENSE +21 -0
- package/README.md +100 -2
- package/SECURITY.md +34 -0
- package/THIRD_PARTY_LICENSES.md +697 -0
- package/dist/arrangement.d.ts +50 -0
- package/dist/arrangement.d.ts.map +1 -0
- package/dist/arrangement.js +63 -0
- package/dist/arrangement.js.map +1 -0
- package/dist/build_info.json +12 -0
- package/dist/check.d.ts +118 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +298 -0
- package/dist/check.js.map +1 -0
- package/dist/complex.d.ts +543 -0
- package/dist/complex.d.ts.map +1 -0
- package/dist/complex.js +712 -0
- package/dist/complex.js.map +1 -0
- package/dist/diagram.d.ts +116 -0
- package/dist/diagram.d.ts.map +1 -0
- package/dist/diagram.js +238 -0
- package/dist/diagram.js.map +1 -0
- package/dist/diagram_of.d.ts +17 -0
- package/dist/diagram_of.d.ts.map +1 -0
- package/dist/diagram_of.js +40 -0
- package/dist/diagram_of.js.map +1 -0
- package/dist/experimental.d.ts +18 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +16 -0
- package/dist/experimental.js.map +1 -0
- package/dist/flat.d.ts +64 -0
- package/dist/flat.d.ts.map +1 -0
- package/dist/flat.js +158 -0
- package/dist/flat.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/ladder/tda_ladder.d.ts +223 -0
- package/dist/ladder/tda_ladder.js +1360 -0
- package/dist/ladder/tda_ladder_bg.wasm +0 -0
- package/dist/ladder/tda_ladder_bg.wasm.d.ts +43 -0
- package/dist/ladder.d.ts +306 -0
- package/dist/ladder.d.ts.map +1 -0
- package/dist/ladder.js +607 -0
- package/dist/ladder.js.map +1 -0
- package/dist/load.d.ts +53 -0
- package/dist/load.d.ts.map +1 -0
- package/dist/load.js +173 -0
- package/dist/load.js.map +1 -0
- package/dist/memory.d.ts +58 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +2 -0
- package/dist/memory.js.map +1 -0
- package/dist/persistence.d.ts +349 -0
- package/dist/persistence.d.ts.map +1 -0
- package/dist/persistence.js +478 -0
- package/dist/persistence.js.map +1 -0
- package/dist/pkg/tda_wasm.d.ts +13 -0
- package/dist/pkg/tda_wasm.js +2528 -0
- package/dist/prepared.d.ts +62 -0
- package/dist/prepared.d.ts.map +1 -0
- package/dist/prepared.js +81 -0
- package/dist/prepared.js.map +1 -0
- package/dist/rivet_input.d.ts +93 -0
- package/dist/rivet_input.d.ts.map +1 -0
- package/dist/rivet_input.js +132 -0
- package/dist/rivet_input.js.map +1 -0
- package/dist/source.d.ts +43 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +99 -0
- package/dist/source.js.map +1 -0
- package/dist/tda.wasm +0 -0
- package/dist/two_parameter.d.ts +243 -0
- package/dist/two_parameter.d.ts.map +1 -0
- package/dist/two_parameter.js +275 -0
- package/dist/two_parameter.js.map +1 -0
- package/dist/types.d.ts +146 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/vineyard.d.ts +278 -0
- package/dist/vineyard.d.ts.map +1 -0
- package/dist/vineyard.js +236 -0
- package/dist/vineyard.js.map +1 -0
- package/package.json +77 -4
- package/src/arrangement.ts +96 -0
- package/src/check.ts +338 -0
- package/src/complex.ts +1179 -0
- package/src/diagram.ts +299 -0
- package/src/diagram_of.ts +40 -0
- package/src/experimental.ts +17 -0
- package/src/flat.ts +204 -0
- package/src/index.ts +181 -0
- package/src/ladder.ts +903 -0
- package/src/load.ts +201 -0
- package/src/memory.ts +58 -0
- package/src/persistence.ts +752 -0
- package/src/prepared.ts +111 -0
- package/src/rivet_input.ts +195 -0
- package/src/source.ts +132 -0
- package/src/two_parameter.ts +480 -0
- package/src/types.ts +163 -0
- package/src/vineyard.ts +463 -0
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __capacity_record: () => number;
|
|
5
|
+
export const __oom_record: () => number;
|
|
6
|
+
export const __wbg_approximation_free: (a: number, b: number) => void;
|
|
7
|
+
export const __wbg_cl4catalogue_free: (a: number, b: number) => void;
|
|
8
|
+
export const __wbg_cl4decomposition_free: (a: number, b: number) => void;
|
|
9
|
+
export const __wbg_clncatalogue_free: (a: number, b: number) => void;
|
|
10
|
+
export const __wbg_flatfiltration_free: (a: number, b: number) => void;
|
|
11
|
+
export const approximation_compressed: (a: number) => [number, number];
|
|
12
|
+
export const approximation_delta: (a: number) => [number, number];
|
|
13
|
+
export const approximation_deltaTilde: (a: number) => [number, number];
|
|
14
|
+
export const approximation_intervals: (a: number) => [number, number];
|
|
15
|
+
export const cl4Catalogue: () => number;
|
|
16
|
+
export const cl4catalogue_courseIds: (a: number) => [number, number];
|
|
17
|
+
export const cl4catalogue_courseLabels: (a: number) => [number, number];
|
|
18
|
+
export const cl4catalogue_courseOffsets: (a: number) => [number, number];
|
|
19
|
+
export const cl4catalogue_courseRemarks: (a: number) => [number, number];
|
|
20
|
+
export const cl4catalogue_dimensionVectors: (a: number) => [number, number];
|
|
21
|
+
export const cl4catalogue_names: (a: number) => [number, number];
|
|
22
|
+
export const cl4decomposition_courseRanks: (a: number) => [number, number];
|
|
23
|
+
export const cl4decomposition_multiplicities: (a: number) => [number, number];
|
|
24
|
+
export const clnCatalogue: (a: number) => [number, number, number];
|
|
25
|
+
export const clncatalogue_cl4Indices: (a: number) => [number, number];
|
|
26
|
+
export const clncatalogue_dimensionVectors: (a: number) => [number, number];
|
|
27
|
+
export const clncatalogue_names: (a: number) => [number, number];
|
|
28
|
+
export const courseRank: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => [number, number, number];
|
|
29
|
+
export const decomposeCL4: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number];
|
|
30
|
+
export const flatfiltration_lower: (a: number) => [number, number];
|
|
31
|
+
export const flatfiltration_n: (a: number) => number;
|
|
32
|
+
export const flatfiltration_offsets: (a: number) => [number, number];
|
|
33
|
+
export const flatfiltration_upper: (a: number) => [number, number];
|
|
34
|
+
export const flatfiltration_vertices: (a: number) => [number, number];
|
|
35
|
+
export const intervalApproximation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number];
|
|
36
|
+
export const oom_reserve: (a: number, b: number) => number;
|
|
37
|
+
export const ripsThinningLadder: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
38
|
+
export const version: () => [number, number];
|
|
39
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
40
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
41
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
42
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
43
|
+
export const __wbindgen_start: () => void;
|
package/dist/ladder.d.ts
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistence modules over commutative ladders CL(n), computed from data.
|
|
3
|
+
*
|
|
4
|
+
* Input is a *ladder filtration*: one simplicial complex in which every
|
|
5
|
+
* simplex carries the column (1..n) at which it enters the LOWER row and the
|
|
6
|
+
* column at which it enters the UPPER row (0 = never). The complex at vertex
|
|
7
|
+
* `(c, r)` of CL(n) holds the simplices that entered row `r` at a column
|
|
8
|
+
* `≤ c`; the upper row must contain the lower one and faces must enter no
|
|
9
|
+
* later than their cofaces. This is the general model ([reference](https://topolab.ai/tda/docs/references/#hiraoka-nakashima-obayashi-and-xu-2023), (5.1)).
|
|
10
|
+
*
|
|
11
|
+
* Two computations, both over GF(p) and both by zigzag persistence of
|
|
12
|
+
* subcomplexes (the representation itself is never formed):
|
|
13
|
+
*
|
|
14
|
+
* - {@link decomposeCL4}: for CL(n), n ≤ 4, the exact indecomposable
|
|
15
|
+
* decomposition — on CL(4) the multiplicity of each of the 76
|
|
16
|
+
* indecomposables (55 intervals, 21 non-intervals N1…N21), from the ranks of
|
|
17
|
+
* the 76 alternating zigzag courses of the CL(4) course list
|
|
18
|
+
* ({@link cl4Catalogue}) and the inverse of their 76 × 76 matrix (§4.1); CL(1),
|
|
19
|
+
* CL(2) and CL(3) by extension by zero into CL(4), reported on CL(n).
|
|
20
|
+
* - {@link intervalApproximation} and {@link connectedPersistenceDiagram}:
|
|
21
|
+
* for CL(n), the source-sink interval approximation δ (Definition 3.25,
|
|
22
|
+
* Remark 3.26) and the connected persistence diagram (Definitions 4.5,
|
|
23
|
+
* 4.7) as a `topolab.cpd.v1` record
|
|
24
|
+
* (https://topolab.ai/tda/docs/guides/commutative-ladders/).
|
|
25
|
+
*
|
|
26
|
+
* The engine is a WebAssembly module separate from the package root's
|
|
27
|
+
* (`@topolab/tda/ladder.wasm`). Call {@link load} once; the
|
|
28
|
+
* functions are then plain calls. A bad argument throws a `TypeError` (wrong
|
|
29
|
+
* type) or a `RangeError` (out of range) whose message names the parameter;
|
|
30
|
+
* a failure inside the engine throws an `Error`. An allocation trap replaces the instance and throws `TOO_LARGE`; the
|
|
31
|
+
* next call needs no `load()`. An empty-record trap remains an internal error.
|
|
32
|
+
*
|
|
33
|
+
* @packageDocumentation
|
|
34
|
+
*/
|
|
35
|
+
import type { LoadSource } from './source.js';
|
|
36
|
+
import type { PointCloud } from './check.js';
|
|
37
|
+
export type { PointCloud } from './check.js';
|
|
38
|
+
export type { LoadSource };
|
|
39
|
+
/**
|
|
40
|
+
* Load the engine. Without `source` it is read from `ladder.wasm` next to
|
|
41
|
+
* the package's code (`@topolab/tda/ladder.wasm`): from the file in
|
|
42
|
+
* Node, by `fetch` in a browser, where bundlers that understand
|
|
43
|
+
* `new URL(…, import.meta.url)` resolve it. Nothing is written to
|
|
44
|
+
* `globalThis`.
|
|
45
|
+
*
|
|
46
|
+
* Concurrent calls behave as the root module's `load` does. Once the engine
|
|
47
|
+
* is loaded, `load` returns the same resolved promise and ignores `source`.
|
|
48
|
+
* While a load is in progress, a call with the same `source` (the same
|
|
49
|
+
* value, or none both times) shares that load and its outcome. A call with
|
|
50
|
+
* another `source` waits for the load in progress: if it succeeds, the call
|
|
51
|
+
* resolves too, without using its own `source`; if it fails, the call does
|
|
52
|
+
* not share that failure but loads from its own `source`. A failed load is
|
|
53
|
+
* not kept, so a later call can retry with a corrected source;
|
|
54
|
+
* {@link unload} rejects every load in progress.
|
|
55
|
+
*/
|
|
56
|
+
export declare function load(source?: LoadSource): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Drop the engine, so that its memory can be reclaimed. Results already
|
|
59
|
+
* returned are copies and stay valid; functions that need the engine throw
|
|
60
|
+
* until {@link load} is called again; a load in progress rejects.
|
|
61
|
+
*/
|
|
62
|
+
export declare function unload(): void;
|
|
63
|
+
/** Whether the engine is loaded (a {@link load} has resolved and no {@link unload} followed). */
|
|
64
|
+
export declare function isLoaded(): boolean;
|
|
65
|
+
/** The version of the loaded engine (equal to the package's). */
|
|
66
|
+
export declare function version(): string;
|
|
67
|
+
/**
|
|
68
|
+
* A ladder filtration on CL(n). Give the simplices either as vertex lists
|
|
69
|
+
* (`simplices`) or flat (`offsets` of length count + 1 starting at 0, and the
|
|
70
|
+
* concatenated `vertices`), each simplex's vertices in any order (the engine
|
|
71
|
+
* sorts them; a vertex listed twice is a `RangeError`). `lower[i]` /
|
|
72
|
+
* `upper[i]` is the column (1..n) at which simplex `i` enters the lower /
|
|
73
|
+
* upper row, 0 for never.
|
|
74
|
+
*/
|
|
75
|
+
export interface LadderFiltration {
|
|
76
|
+
readonly n: number;
|
|
77
|
+
readonly simplices?: ReadonlyArray<ReadonlyArray<number>>;
|
|
78
|
+
readonly offsets?: ArrayLike<number>;
|
|
79
|
+
readonly vertices?: ArrayLike<number>;
|
|
80
|
+
readonly lower: ArrayLike<number>;
|
|
81
|
+
readonly upper: ArrayLike<number>;
|
|
82
|
+
}
|
|
83
|
+
/** A ladder filtration in the flat form the engine takes and returns. */
|
|
84
|
+
export interface FlatLadderFiltration extends LadderFiltration {
|
|
85
|
+
readonly offsets: Uint32Array;
|
|
86
|
+
readonly vertices: Uint32Array;
|
|
87
|
+
readonly lower: Uint32Array;
|
|
88
|
+
readonly upper: Uint32Array;
|
|
89
|
+
}
|
|
90
|
+
/** Homology dimension and coefficient field. */
|
|
91
|
+
export interface LadderOptions {
|
|
92
|
+
/** The homology dimension q, an integer from 0 to 61 (a simplex has at most 64 vertices). Required. */
|
|
93
|
+
readonly dim: number;
|
|
94
|
+
/** The prime p of the coefficient field GF(p), from 2 to `2^31 − 1`. Default 2. */
|
|
95
|
+
readonly coeff?: number;
|
|
96
|
+
}
|
|
97
|
+
/** The flat form of a filtration (no copy when it already is flat). */
|
|
98
|
+
export declare function flattenLadderFiltration(f: LadderFiltration): FlatLadderFiltration;
|
|
99
|
+
/**
|
|
100
|
+
* An interval of CL(n), (4.2): a run `[birth, last]` in the upper row, the
|
|
101
|
+
* lower row, or both with `upper.birth ≤ lower.birth ≤ upper.last ≤
|
|
102
|
+
* lower.last`. Ends are INCLUSIVE.
|
|
103
|
+
*/
|
|
104
|
+
export interface LadderInterval {
|
|
105
|
+
readonly upper: readonly [birth: number, last: number] | null;
|
|
106
|
+
readonly lower: readonly [birth: number, last: number] | null;
|
|
107
|
+
}
|
|
108
|
+
/** `[b,d]_1`, `[b,d]_2` or `[b2,d2]_2 ⊔ [b1,d1]_1`; a value that is not a {@link LadderInterval} is a `TypeError` or `RangeError`. */
|
|
109
|
+
export declare function intervalName(iv: LadderInterval): string;
|
|
110
|
+
/** The source-sink interval approximation of the homology in degree `q` (arrays in interval order). */
|
|
111
|
+
export interface IntervalApproximation {
|
|
112
|
+
readonly n: number;
|
|
113
|
+
/** The homology dimension. */
|
|
114
|
+
readonly dim: number;
|
|
115
|
+
/** The prime of the coefficient field. */
|
|
116
|
+
readonly coeff: number;
|
|
117
|
+
/** Every interval of CL(n): `[b,d]_1`, `[b,d]_2`, then two-row, each lexicographic. */
|
|
118
|
+
readonly intervals: readonly LadderInterval[];
|
|
119
|
+
/** `c^ξss(I)`: the ξss-compressed multiplicity (Definition 3.16). */
|
|
120
|
+
readonly compressed: Uint32Array;
|
|
121
|
+
/** `δ(I)`: the interval approximation (Definition 3.25); may be negative. */
|
|
122
|
+
readonly delta: Int32Array;
|
|
123
|
+
/** `δ̃(I)` (Definition 4.5): on a row, that row's persistence diagram (Proposition 4.6). */
|
|
124
|
+
readonly deltaTilde: Int32Array;
|
|
125
|
+
/** A negative δ: by Proposition 6.2 the module has a non-interval summand. */
|
|
126
|
+
readonly hasNegative: boolean;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The source-sink interval approximation of the homology in degree `q` of a ladder filtration,
|
|
130
|
+
* from `n(n+1)/2` zigzag persistence computations.
|
|
131
|
+
*/
|
|
132
|
+
export declare function intervalApproximation(f: LadderFiltration, opts: LadderOptions): IntervalApproximation;
|
|
133
|
+
/** A point of `topolab.cpd.v1`: `(birth, death)` with death EXCLUSIVE. */
|
|
134
|
+
export interface CpdPointV1 {
|
|
135
|
+
readonly id: string;
|
|
136
|
+
readonly birth: number;
|
|
137
|
+
readonly death: number;
|
|
138
|
+
readonly multiplicity: number;
|
|
139
|
+
readonly note: string | null;
|
|
140
|
+
}
|
|
141
|
+
/** A coupling of `topolab.cpd.v1`, endpoints by coordinate. */
|
|
142
|
+
export interface CpdCouplingV1 {
|
|
143
|
+
readonly id: string;
|
|
144
|
+
readonly upper: {
|
|
145
|
+
readonly birth: number;
|
|
146
|
+
readonly death: number;
|
|
147
|
+
};
|
|
148
|
+
readonly lower: {
|
|
149
|
+
readonly birth: number;
|
|
150
|
+
readonly death: number;
|
|
151
|
+
};
|
|
152
|
+
readonly multiplicity: number;
|
|
153
|
+
readonly note: string | null;
|
|
154
|
+
}
|
|
155
|
+
/** The `topolab.cpd.v1` record: the connected persistence diagram as a viewer of the record reads it (https://topolab.ai/tda/docs/guides/commutative-ladders/). */
|
|
156
|
+
export interface CpdRecordV1 {
|
|
157
|
+
readonly schema: 'topolab.cpd.v1';
|
|
158
|
+
readonly title: string;
|
|
159
|
+
/** `true` when the multiplicities were invented rather than computed from data. */
|
|
160
|
+
readonly synthetic: boolean;
|
|
161
|
+
readonly provenance: string;
|
|
162
|
+
readonly generator: string;
|
|
163
|
+
readonly citation: string;
|
|
164
|
+
readonly ladder: {
|
|
165
|
+
readonly length: number;
|
|
166
|
+
readonly orientation: string;
|
|
167
|
+
readonly rows: Readonly<Record<string, string>>;
|
|
168
|
+
};
|
|
169
|
+
readonly homologyDimension: number;
|
|
170
|
+
readonly essentialAssignment: string;
|
|
171
|
+
readonly death: {
|
|
172
|
+
readonly convention: 'exclusive';
|
|
173
|
+
readonly note: string;
|
|
174
|
+
};
|
|
175
|
+
readonly lifetime: string;
|
|
176
|
+
readonly multiplicity: string;
|
|
177
|
+
readonly upper: readonly CpdPointV1[];
|
|
178
|
+
readonly lower: readonly CpdPointV1[];
|
|
179
|
+
readonly couplings: readonly CpdCouplingV1[];
|
|
180
|
+
}
|
|
181
|
+
/** What a record says about its data; everything else is filled in. */
|
|
182
|
+
export interface CpdRecordMeta {
|
|
183
|
+
/** A non-empty title. */
|
|
184
|
+
readonly title: string;
|
|
185
|
+
/** One non-empty sentence: where the numbers came from (data set, model, thresholds). */
|
|
186
|
+
readonly provenance: string;
|
|
187
|
+
/** What each row is, e.g. `{ 1: 'the thinned cloud', 2: 'the full cloud' }`: the keys `'1'` and `'2'`, each a non-empty string; a row left out keeps its default, the lower row (1) or the upper row (2). */
|
|
188
|
+
readonly rows?: Readonly<Record<string, string>>;
|
|
189
|
+
/** What wrote the record. Default: this function and the package version. */
|
|
190
|
+
readonly generator?: string;
|
|
191
|
+
/** `true` when the multiplicities were invented rather than computed from data (an example). Default `false`. */
|
|
192
|
+
readonly synthetic?: boolean;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The connected persistence diagram (Definition 4.7) as a `topolab.cpd.v1`
|
|
196
|
+
* record. Points carry EXCLUSIVE deaths: the interval `[b, d]` of a row is
|
|
197
|
+
* the point `(b, d + 1)`, and a two-row interval `[b2,d2]_2 ⊔ [b1,d1]_1` is
|
|
198
|
+
* the coupling from `(b2, d2 + 1)` to `(b1, d1 + 1)`. Zero multiplicities are
|
|
199
|
+
* omitted; couplings may be negative. `a` is what {@link intervalApproximation}
|
|
200
|
+
* returns (a ladder of length at least 2: CL(1) has no diagram); `meta` is
|
|
201
|
+
* checked as {@link CpdRecordMeta} describes, an unknown key included.
|
|
202
|
+
*/
|
|
203
|
+
export declare function connectedPersistenceDiagram(a: IntervalApproximation, meta: CpdRecordMeta): CpdRecordV1;
|
|
204
|
+
/** One of the 76 indecomposables of CL(4). */
|
|
205
|
+
export interface CL4Indecomposable {
|
|
206
|
+
/** `[b,d]_1`, `[b,d]_2`, `[b2,d2]_2 ⊔ [b1,d1]_1`, or `N1` … `N21` ([reference](https://topolab.ai/tda/docs/references/#hiraoka-nakashima-obayashi-and-xu-2023), Fig. 15). */
|
|
207
|
+
readonly name: string;
|
|
208
|
+
/** The interval, or null for a non-interval N_k. */
|
|
209
|
+
readonly interval: LadderInterval | null;
|
|
210
|
+
/** Dimensions at the 8 vertices, index `(row − 1)·4 + column − 1`. */
|
|
211
|
+
readonly dimensionVector: readonly number[];
|
|
212
|
+
}
|
|
213
|
+
/** One of the 76 alternating zigzag courses of the CL(4) course list. */
|
|
214
|
+
export interface CL4Course {
|
|
215
|
+
readonly id: string;
|
|
216
|
+
readonly remark: string;
|
|
217
|
+
/** Labels as `[column, row]`, alternating forward/backward from the first arrow. */
|
|
218
|
+
readonly labels: ReadonlyArray<readonly [column: number, row: number]>;
|
|
219
|
+
}
|
|
220
|
+
/** The 76 indecomposables (decomposition order) and the 76 courses. */
|
|
221
|
+
export declare function cl4Catalogue(): {
|
|
222
|
+
readonly indecomposables: readonly CL4Indecomposable[];
|
|
223
|
+
readonly courses: readonly CL4Course[];
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* An indecomposable of CL(n), `n ≤ 4`, through its extension by zero into
|
|
227
|
+
* CL(4) (the first `4 − n` columns padded with zero spaces).
|
|
228
|
+
*/
|
|
229
|
+
export interface CLnIndecomposable {
|
|
230
|
+
/**
|
|
231
|
+
* The name on CL(n): an interval in CL(n) columns (`[b,d]_1`, `[b,d]_2`,
|
|
232
|
+
* `[b2,d2]_2 ⊔ [b1,d1]_1`); a non-interval is `N1` … `N21` on CL(4) and, for
|
|
233
|
+
* n < 4, `N[upper row/lower row]` by its CL(n) dimension vector — CL(3) has
|
|
234
|
+
* two, `N[121/011]` and `N[110/121]` ([reference](https://topolab.ai/tda/docs/references/#hiraoka-nakashima-obayashi-and-xu-2023), Remark 6.1); CL(1) and
|
|
235
|
+
* CL(2) have none.
|
|
236
|
+
*/
|
|
237
|
+
readonly name: string;
|
|
238
|
+
/** The interval in CL(n) coordinates, or null for a non-interval. */
|
|
239
|
+
readonly interval: LadderInterval | null;
|
|
240
|
+
/** Dimensions on CL(n), index `(row − 1)·n + column − 1`. */
|
|
241
|
+
readonly dimensionVector: readonly number[];
|
|
242
|
+
/** Index of the extension by zero in {@link cl4Catalogue}`().indecomposables`. */
|
|
243
|
+
readonly cl4Index: number;
|
|
244
|
+
/** Name of the extension by zero on CL(4). */
|
|
245
|
+
readonly cl4Name: string;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* The indecomposables of CL(n), `n ≤ 4`, in the order of their extensions by
|
|
249
|
+
* zero in {@link cl4Catalogue} — 3, 11, 29 and 76 of them for n = 1…4.
|
|
250
|
+
*/
|
|
251
|
+
export declare function clnCatalogue(n: number): readonly CLnIndecomposable[];
|
|
252
|
+
/** The decomposition of the homology in degree `q` of a ladder filtration on CL(n), `n ≤ 4`. */
|
|
253
|
+
export interface CL4Decomposition {
|
|
254
|
+
/** The ladder length of the input, 1 … 4. */
|
|
255
|
+
readonly n: number;
|
|
256
|
+
/** The homology dimension. */
|
|
257
|
+
readonly dim: number;
|
|
258
|
+
/** The prime of the coefficient field. */
|
|
259
|
+
readonly coeff: number;
|
|
260
|
+
/** The 76 course ranks (of the extension by zero when n < 4), in the order of {@link cl4Catalogue}`().courses`. */
|
|
261
|
+
readonly courseRanks: Uint32Array;
|
|
262
|
+
/** The 76 multiplicities on CL(4), in the order of {@link cl4Catalogue}`().indecomposables`. */
|
|
263
|
+
readonly multiplicities: Uint32Array;
|
|
264
|
+
/** The summands with non-zero multiplicity, named and placed on CL(n) (with their CL(4) names). */
|
|
265
|
+
readonly summands: ReadonlyArray<CLnIndecomposable & {
|
|
266
|
+
readonly multiplicity: number;
|
|
267
|
+
}>;
|
|
268
|
+
readonly isIntervalDecomposable: boolean;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* The exact indecomposable decomposition of the degree-`q` homology over GF(p) of a ladder
|
|
272
|
+
* filtration on CL(n), `n ≤ 4`: 76 zigzag persistence computations (one per
|
|
273
|
+
* course), then `d = A⁻¹ r` solved exactly. For `n < 4` the filtration is
|
|
274
|
+
* extended by zero into CL(4) — every entry column shifted by `4 − n`, so the
|
|
275
|
+
* first `4 − n` columns are empty — and the summands are mapped back to CL(n)
|
|
276
|
+
* by dropping those columns. The embedding is exact: extension by zero is
|
|
277
|
+
* fully faithful, so it preserves indecomposability and multiplicities, and
|
|
278
|
+
* the engine checks that no summand meets the padded columns. The engine
|
|
279
|
+
* refuses (throws) rather than return a non-integral or negative
|
|
280
|
+
* multiplicity.
|
|
281
|
+
*/
|
|
282
|
+
export declare function decomposeCL4(f: LadderFiltration, opts: LadderOptions): CL4Decomposition;
|
|
283
|
+
/**
|
|
284
|
+
* The course function (4.1) of the degree-`q` homology: the multiplicity of the longest
|
|
285
|
+
* interval in the tour along an alternating zigzag course, labels as
|
|
286
|
+
* `[column, row]` (`F(1) → F(2) ← F(3) → …`). One zigzag computation.
|
|
287
|
+
*/
|
|
288
|
+
export declare function courseRank(f: LadderFiltration, labels: ReadonlyArray<readonly [number, number]>, opts: LadderOptions): number;
|
|
289
|
+
/** Options of {@link ripsThinningLadder}. */
|
|
290
|
+
export interface RipsThinningOptions {
|
|
291
|
+
/** Whether each point survives the thinning (is in the lower row's cloud), one entry per point: `true` or `1` to keep it, `false` or `0`. Required. */
|
|
292
|
+
readonly keep: ArrayLike<boolean | number>;
|
|
293
|
+
/** The edge lengths `ℓ_1 < … < ℓ_n`, finite, non-negative and strictly increasing: a simplex enters at the first `ℓ_i` at least its diameter (its longest edge). Required. */
|
|
294
|
+
readonly edgeLengths: ArrayLike<number>;
|
|
295
|
+
/** The largest simplex dimension built (degree `q` needs `q + 1`), an integer from 0 to 8. Default 2. */
|
|
296
|
+
readonly maxSimplexDim?: number;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* The thinning model ([reference](https://topolab.ai/tda/docs/references/#hiraoka-nakashima-obayashi-and-xu-2023), §5.2) with Vietoris–Rips complexes:
|
|
300
|
+
* the upper row is the Rips filtration of the cloud, the lower row the Rips
|
|
301
|
+
* filtration of the points kept, both at the given edge lengths. Rips of a
|
|
302
|
+
* subset is the full subcomplex of Rips of the whole cloud, so the rows
|
|
303
|
+
* nest.
|
|
304
|
+
*/
|
|
305
|
+
export declare function ripsThinningLadder(cloud: PointCloud, opts: RipsThinningOptions): FlatLadderFiltration;
|
|
306
|
+
//# sourceMappingURL=ladder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ladder.d.ts","sourceRoot":"","sources":["../src/ladder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAOH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,K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