@topolab/tda 0.0.0-stage → 0.3.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 +82 -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 +696 -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 +14 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +13 -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 +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -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 +1900 -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/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/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/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 +13 -0
- package/src/flat.ts +204 -0
- package/src/index.ts +155 -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/source.ts +132 -0
- package/src/types.ts +163 -0
- package/src/vineyard.ts +463 -0
|
@@ -0,0 +1,1360 @@
|
|
|
1
|
+
/* @ts-self-types="./tda_ladder.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The source-sink interval approximation of `H_q` of a ladder filtration.
|
|
5
|
+
*/
|
|
6
|
+
export class Approximation {
|
|
7
|
+
static __wrap(ptr, context) {
|
|
8
|
+
const obj = Object.create(Approximation.prototype);
|
|
9
|
+
obj.__wbg_ptr = ptr;
|
|
10
|
+
obj.__oomEpoch = __oomEpoch;
|
|
11
|
+
obj.__oomContext = context;
|
|
12
|
+
ApproximationFinalization.register(obj, {ptr:obj.__wbg_ptr, epoch:__oomEpoch}, obj);
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
__destroy_into_raw() {
|
|
16
|
+
const ptr = this.__wbg_ptr;
|
|
17
|
+
this.__wbg_ptr = 0;
|
|
18
|
+
ApproximationFinalization.unregister(this);
|
|
19
|
+
return ptr;
|
|
20
|
+
}
|
|
21
|
+
free() {
|
|
22
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
23
|
+
const context = { function: "free", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
24
|
+
const copies = [];
|
|
25
|
+
__oomBegin();
|
|
26
|
+
try {
|
|
27
|
+
const ptr = this.__destroy_into_raw();
|
|
28
|
+
wasm.__wbg_approximation_free(ptr, 0);
|
|
29
|
+
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
32
|
+
throw __oomNormalize(error, context);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* `c^ξss(I)` per interval.
|
|
37
|
+
* @returns {Uint32Array}
|
|
38
|
+
*/
|
|
39
|
+
get compressed() {
|
|
40
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
41
|
+
const context = { function: this.__oomContext?.function ?? "compressed", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
42
|
+
const copies = [];
|
|
43
|
+
__oomBegin();
|
|
44
|
+
try {
|
|
45
|
+
copies.length = 0;
|
|
46
|
+
|
|
47
|
+
const ret = wasm.approximation_compressed(this.__wbg_ptr);
|
|
48
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
49
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
50
|
+
throw error;
|
|
51
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
52
|
+
|
|
53
|
+
} catch (error) {
|
|
54
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
55
|
+
throw __oomNormalize(error, context);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `δ̃(I)` per interval (Definition 4.5).
|
|
60
|
+
* @returns {Int32Array}
|
|
61
|
+
*/
|
|
62
|
+
get deltaTilde() {
|
|
63
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
64
|
+
const context = { function: this.__oomContext?.function ?? "deltaTilde", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
65
|
+
const copies = [];
|
|
66
|
+
__oomBegin();
|
|
67
|
+
try {
|
|
68
|
+
copies.length = 0;
|
|
69
|
+
|
|
70
|
+
const ret = wasm.approximation_deltaTilde(this.__wbg_ptr);
|
|
71
|
+
try { return new Int32Array(getArrayI32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
72
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
73
|
+
throw error;
|
|
74
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
75
|
+
|
|
76
|
+
} catch (error) {
|
|
77
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
78
|
+
throw __oomNormalize(error, context);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* `δ(I)` per interval (may be negative).
|
|
83
|
+
* @returns {Int32Array}
|
|
84
|
+
*/
|
|
85
|
+
get delta() {
|
|
86
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
87
|
+
const context = { function: this.__oomContext?.function ?? "delta", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
88
|
+
const copies = [];
|
|
89
|
+
__oomBegin();
|
|
90
|
+
try {
|
|
91
|
+
copies.length = 0;
|
|
92
|
+
|
|
93
|
+
const ret = wasm.approximation_delta(this.__wbg_ptr);
|
|
94
|
+
try { return new Int32Array(getArrayI32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
95
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
96
|
+
throw error;
|
|
97
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
98
|
+
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
101
|
+
throw __oomNormalize(error, context);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* 4 per interval of CL(n): `b2, d2, b1, d1`, ends inclusive, `0, 0` for
|
|
106
|
+
* a row the interval does not meet. Order: `[b,d]_1`, `[b,d]_2`, then
|
|
107
|
+
* `[b2,d2]_2 ⊔ [b1,d1]_1`, each lexicographic.
|
|
108
|
+
* @returns {Uint32Array}
|
|
109
|
+
*/
|
|
110
|
+
get intervals() {
|
|
111
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
112
|
+
const context = { function: this.__oomContext?.function ?? "intervals", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
113
|
+
const copies = [];
|
|
114
|
+
__oomBegin();
|
|
115
|
+
try {
|
|
116
|
+
copies.length = 0;
|
|
117
|
+
|
|
118
|
+
const ret = wasm.approximation_intervals(this.__wbg_ptr);
|
|
119
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
120
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
121
|
+
throw error;
|
|
122
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
123
|
+
|
|
124
|
+
} catch (error) {
|
|
125
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
126
|
+
throw __oomNormalize(error, context);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (Symbol.dispose) Approximation.prototype[Symbol.dispose] = Approximation.prototype.free;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The CL(4) catalogue the decomposition is expressed in.
|
|
134
|
+
*/
|
|
135
|
+
export class Cl4Catalogue {
|
|
136
|
+
static __wrap(ptr, context) {
|
|
137
|
+
const obj = Object.create(Cl4Catalogue.prototype);
|
|
138
|
+
obj.__wbg_ptr = ptr;
|
|
139
|
+
obj.__oomEpoch = __oomEpoch;
|
|
140
|
+
obj.__oomContext = context;
|
|
141
|
+
Cl4CatalogueFinalization.register(obj, {ptr:obj.__wbg_ptr, epoch:__oomEpoch}, obj);
|
|
142
|
+
return obj;
|
|
143
|
+
}
|
|
144
|
+
__destroy_into_raw() {
|
|
145
|
+
const ptr = this.__wbg_ptr;
|
|
146
|
+
this.__wbg_ptr = 0;
|
|
147
|
+
Cl4CatalogueFinalization.unregister(this);
|
|
148
|
+
return ptr;
|
|
149
|
+
}
|
|
150
|
+
free() {
|
|
151
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
152
|
+
const context = { function: "free", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
153
|
+
const copies = [];
|
|
154
|
+
__oomBegin();
|
|
155
|
+
try {
|
|
156
|
+
const ptr = this.__destroy_into_raw();
|
|
157
|
+
wasm.__wbg_cl4catalogue_free(ptr, 0);
|
|
158
|
+
|
|
159
|
+
} catch (error) {
|
|
160
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
161
|
+
throw __oomNormalize(error, context);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Course ids, newline-separated (`c01` … `c76`).
|
|
166
|
+
* @returns {string}
|
|
167
|
+
*/
|
|
168
|
+
get courseIds() {
|
|
169
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
170
|
+
const context = { function: this.__oomContext?.function ?? "courseIds", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
171
|
+
const copies = [];
|
|
172
|
+
__oomBegin();
|
|
173
|
+
try {
|
|
174
|
+
let deferred1_0;
|
|
175
|
+
let deferred1_1;
|
|
176
|
+
try {
|
|
177
|
+
copies.length = 0;
|
|
178
|
+
const ret = wasm.cl4catalogue_courseIds(this.__wbg_ptr);
|
|
179
|
+
deferred1_0 = ret[0];
|
|
180
|
+
deferred1_1 = ret[1];
|
|
181
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
182
|
+
} finally {
|
|
183
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
} catch (error) {
|
|
187
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
188
|
+
throw __oomNormalize(error, context);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @returns {Uint32Array}
|
|
193
|
+
*/
|
|
194
|
+
get courseLabels() {
|
|
195
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
196
|
+
const context = { function: this.__oomContext?.function ?? "courseLabels", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
197
|
+
const copies = [];
|
|
198
|
+
__oomBegin();
|
|
199
|
+
try {
|
|
200
|
+
copies.length = 0;
|
|
201
|
+
|
|
202
|
+
const ret = wasm.cl4catalogue_courseLabels(this.__wbg_ptr);
|
|
203
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
204
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
205
|
+
throw error;
|
|
206
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
207
|
+
|
|
208
|
+
} catch (error) {
|
|
209
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
210
|
+
throw __oomNormalize(error, context);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Course `i` has labels `courseLabels[2·courseOffsets[i] ..
|
|
215
|
+
* 2·courseOffsets[i+1]]` as `column, row` pairs.
|
|
216
|
+
* @returns {Uint32Array}
|
|
217
|
+
*/
|
|
218
|
+
get courseOffsets() {
|
|
219
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
220
|
+
const context = { function: this.__oomContext?.function ?? "courseOffsets", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
221
|
+
const copies = [];
|
|
222
|
+
__oomBegin();
|
|
223
|
+
try {
|
|
224
|
+
copies.length = 0;
|
|
225
|
+
|
|
226
|
+
const ret = wasm.cl4catalogue_courseOffsets(this.__wbg_ptr);
|
|
227
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
228
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
229
|
+
throw error;
|
|
230
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
231
|
+
|
|
232
|
+
} catch (error) {
|
|
233
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
234
|
+
throw __oomNormalize(error, context);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Course remarks of the record, newline-separated.
|
|
239
|
+
* @returns {string}
|
|
240
|
+
*/
|
|
241
|
+
get courseRemarks() {
|
|
242
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
243
|
+
const context = { function: this.__oomContext?.function ?? "courseRemarks", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
244
|
+
const copies = [];
|
|
245
|
+
__oomBegin();
|
|
246
|
+
try {
|
|
247
|
+
let deferred1_0;
|
|
248
|
+
let deferred1_1;
|
|
249
|
+
try {
|
|
250
|
+
copies.length = 0;
|
|
251
|
+
const ret = wasm.cl4catalogue_courseRemarks(this.__wbg_ptr);
|
|
252
|
+
deferred1_0 = ret[0];
|
|
253
|
+
deferred1_1 = ret[1];
|
|
254
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
255
|
+
} finally {
|
|
256
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
} catch (error) {
|
|
260
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
261
|
+
throw __oomNormalize(error, context);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* 8 per indecomposable, index `(row − 1)·4 + column − 1`.
|
|
266
|
+
* @returns {Uint32Array}
|
|
267
|
+
*/
|
|
268
|
+
get dimensionVectors() {
|
|
269
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
270
|
+
const context = { function: this.__oomContext?.function ?? "dimensionVectors", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
271
|
+
const copies = [];
|
|
272
|
+
__oomBegin();
|
|
273
|
+
try {
|
|
274
|
+
copies.length = 0;
|
|
275
|
+
|
|
276
|
+
const ret = wasm.cl4catalogue_dimensionVectors(this.__wbg_ptr);
|
|
277
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
278
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
279
|
+
throw error;
|
|
280
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
281
|
+
|
|
282
|
+
} catch (error) {
|
|
283
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
284
|
+
throw __oomNormalize(error, context);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Names of the 76 indecomposables, newline-separated.
|
|
289
|
+
* @returns {string}
|
|
290
|
+
*/
|
|
291
|
+
get names() {
|
|
292
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
293
|
+
const context = { function: this.__oomContext?.function ?? "names", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
294
|
+
const copies = [];
|
|
295
|
+
__oomBegin();
|
|
296
|
+
try {
|
|
297
|
+
let deferred1_0;
|
|
298
|
+
let deferred1_1;
|
|
299
|
+
try {
|
|
300
|
+
copies.length = 0;
|
|
301
|
+
const ret = wasm.cl4catalogue_names(this.__wbg_ptr);
|
|
302
|
+
deferred1_0 = ret[0];
|
|
303
|
+
deferred1_1 = ret[1];
|
|
304
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
305
|
+
} finally {
|
|
306
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
} catch (error) {
|
|
310
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
311
|
+
throw __oomNormalize(error, context);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (Symbol.dispose) Cl4Catalogue.prototype[Symbol.dispose] = Cl4Catalogue.prototype.free;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Exact decomposition of `H_q` of a ladder filtration on CL(n), `n ≤ 4`,
|
|
319
|
+
* indexed as on CL(4).
|
|
320
|
+
*/
|
|
321
|
+
export class Cl4Decomposition {
|
|
322
|
+
static __wrap(ptr, context) {
|
|
323
|
+
const obj = Object.create(Cl4Decomposition.prototype);
|
|
324
|
+
obj.__wbg_ptr = ptr;
|
|
325
|
+
obj.__oomEpoch = __oomEpoch;
|
|
326
|
+
obj.__oomContext = context;
|
|
327
|
+
Cl4DecompositionFinalization.register(obj, {ptr:obj.__wbg_ptr, epoch:__oomEpoch}, obj);
|
|
328
|
+
return obj;
|
|
329
|
+
}
|
|
330
|
+
__destroy_into_raw() {
|
|
331
|
+
const ptr = this.__wbg_ptr;
|
|
332
|
+
this.__wbg_ptr = 0;
|
|
333
|
+
Cl4DecompositionFinalization.unregister(this);
|
|
334
|
+
return ptr;
|
|
335
|
+
}
|
|
336
|
+
free() {
|
|
337
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
338
|
+
const context = { function: "free", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
339
|
+
const copies = [];
|
|
340
|
+
__oomBegin();
|
|
341
|
+
try {
|
|
342
|
+
const ptr = this.__destroy_into_raw();
|
|
343
|
+
wasm.__wbg_cl4decomposition_free(ptr, 0);
|
|
344
|
+
|
|
345
|
+
} catch (error) {
|
|
346
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
347
|
+
throw __oomNormalize(error, context);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* The 76 course ranks, in the order of `cl4_courses.json`.
|
|
352
|
+
* @returns {Uint32Array}
|
|
353
|
+
*/
|
|
354
|
+
get courseRanks() {
|
|
355
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
356
|
+
const context = { function: this.__oomContext?.function ?? "courseRanks", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
357
|
+
const copies = [];
|
|
358
|
+
__oomBegin();
|
|
359
|
+
try {
|
|
360
|
+
copies.length = 0;
|
|
361
|
+
|
|
362
|
+
const ret = wasm.cl4decomposition_courseRanks(this.__wbg_ptr);
|
|
363
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
364
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
365
|
+
throw error;
|
|
366
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
367
|
+
|
|
368
|
+
} catch (error) {
|
|
369
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
370
|
+
throw __oomNormalize(error, context);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* The 76 multiplicities: 55 intervals, then N1 … N21.
|
|
375
|
+
* @returns {Uint32Array}
|
|
376
|
+
*/
|
|
377
|
+
get multiplicities() {
|
|
378
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
379
|
+
const context = { function: this.__oomContext?.function ?? "multiplicities", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
380
|
+
const copies = [];
|
|
381
|
+
__oomBegin();
|
|
382
|
+
try {
|
|
383
|
+
copies.length = 0;
|
|
384
|
+
|
|
385
|
+
const ret = wasm.cl4decomposition_multiplicities(this.__wbg_ptr);
|
|
386
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
387
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
388
|
+
throw error;
|
|
389
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
390
|
+
|
|
391
|
+
} catch (error) {
|
|
392
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
393
|
+
throw __oomNormalize(error, context);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
if (Symbol.dispose) Cl4Decomposition.prototype[Symbol.dispose] = Cl4Decomposition.prototype.free;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* The indecomposables of CL(n), `n ≤ 4`, as extensions by zero into CL(4).
|
|
401
|
+
*/
|
|
402
|
+
export class ClnCatalogue {
|
|
403
|
+
static __wrap(ptr, context) {
|
|
404
|
+
const obj = Object.create(ClnCatalogue.prototype);
|
|
405
|
+
obj.__wbg_ptr = ptr;
|
|
406
|
+
obj.__oomEpoch = __oomEpoch;
|
|
407
|
+
obj.__oomContext = context;
|
|
408
|
+
ClnCatalogueFinalization.register(obj, {ptr:obj.__wbg_ptr, epoch:__oomEpoch}, obj);
|
|
409
|
+
return obj;
|
|
410
|
+
}
|
|
411
|
+
__destroy_into_raw() {
|
|
412
|
+
const ptr = this.__wbg_ptr;
|
|
413
|
+
this.__wbg_ptr = 0;
|
|
414
|
+
ClnCatalogueFinalization.unregister(this);
|
|
415
|
+
return ptr;
|
|
416
|
+
}
|
|
417
|
+
free() {
|
|
418
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
419
|
+
const context = { function: "free", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
420
|
+
const copies = [];
|
|
421
|
+
__oomBegin();
|
|
422
|
+
try {
|
|
423
|
+
const ptr = this.__destroy_into_raw();
|
|
424
|
+
wasm.__wbg_clncatalogue_free(ptr, 0);
|
|
425
|
+
|
|
426
|
+
} catch (error) {
|
|
427
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
428
|
+
throw __oomNormalize(error, context);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Index of each among the 76 CL(4) indecomposables.
|
|
433
|
+
* @returns {Uint32Array}
|
|
434
|
+
*/
|
|
435
|
+
get cl4Indices() {
|
|
436
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
437
|
+
const context = { function: this.__oomContext?.function ?? "cl4Indices", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
438
|
+
const copies = [];
|
|
439
|
+
__oomBegin();
|
|
440
|
+
try {
|
|
441
|
+
copies.length = 0;
|
|
442
|
+
|
|
443
|
+
const ret = wasm.clncatalogue_cl4Indices(this.__wbg_ptr);
|
|
444
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
445
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
446
|
+
throw error;
|
|
447
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
448
|
+
|
|
449
|
+
} catch (error) {
|
|
450
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
451
|
+
throw __oomNormalize(error, context);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* `2n` per indecomposable, index `(row − 1)·n + column − 1`.
|
|
456
|
+
* @returns {Uint32Array}
|
|
457
|
+
*/
|
|
458
|
+
get dimensionVectors() {
|
|
459
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
460
|
+
const context = { function: this.__oomContext?.function ?? "dimensionVectors", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
461
|
+
const copies = [];
|
|
462
|
+
__oomBegin();
|
|
463
|
+
try {
|
|
464
|
+
copies.length = 0;
|
|
465
|
+
|
|
466
|
+
const ret = wasm.clncatalogue_dimensionVectors(this.__wbg_ptr);
|
|
467
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
468
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
469
|
+
throw error;
|
|
470
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
471
|
+
|
|
472
|
+
} catch (error) {
|
|
473
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
474
|
+
throw __oomNormalize(error, context);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* CL(n) names, newline-separated: intervals in CL(n) columns; for
|
|
479
|
+
* n < 4 a non-interval is `N[upper row/lower row]` by its dimensions.
|
|
480
|
+
* @returns {string}
|
|
481
|
+
*/
|
|
482
|
+
get names() {
|
|
483
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
484
|
+
const context = { function: this.__oomContext?.function ?? "names", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
485
|
+
const copies = [];
|
|
486
|
+
__oomBegin();
|
|
487
|
+
try {
|
|
488
|
+
let deferred1_0;
|
|
489
|
+
let deferred1_1;
|
|
490
|
+
try {
|
|
491
|
+
copies.length = 0;
|
|
492
|
+
const ret = wasm.clncatalogue_names(this.__wbg_ptr);
|
|
493
|
+
deferred1_0 = ret[0];
|
|
494
|
+
deferred1_1 = ret[1];
|
|
495
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
496
|
+
} finally {
|
|
497
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
} catch (error) {
|
|
501
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
502
|
+
throw __oomNormalize(error, context);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
if (Symbol.dispose) ClnCatalogue.prototype[Symbol.dispose] = ClnCatalogue.prototype.free;
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* A ladder filtration in flat form.
|
|
510
|
+
*/
|
|
511
|
+
export class FlatFiltration {
|
|
512
|
+
static __wrap(ptr, context) {
|
|
513
|
+
const obj = Object.create(FlatFiltration.prototype);
|
|
514
|
+
obj.__wbg_ptr = ptr;
|
|
515
|
+
obj.__oomEpoch = __oomEpoch;
|
|
516
|
+
obj.__oomContext = context;
|
|
517
|
+
FlatFiltrationFinalization.register(obj, {ptr:obj.__wbg_ptr, epoch:__oomEpoch}, obj);
|
|
518
|
+
return obj;
|
|
519
|
+
}
|
|
520
|
+
__destroy_into_raw() {
|
|
521
|
+
const ptr = this.__wbg_ptr;
|
|
522
|
+
this.__wbg_ptr = 0;
|
|
523
|
+
FlatFiltrationFinalization.unregister(this);
|
|
524
|
+
return ptr;
|
|
525
|
+
}
|
|
526
|
+
free() {
|
|
527
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
528
|
+
const context = { function: "free", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
529
|
+
const copies = [];
|
|
530
|
+
__oomBegin();
|
|
531
|
+
try {
|
|
532
|
+
const ptr = this.__destroy_into_raw();
|
|
533
|
+
wasm.__wbg_flatfiltration_free(ptr, 0);
|
|
534
|
+
|
|
535
|
+
} catch (error) {
|
|
536
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
537
|
+
throw __oomNormalize(error, context);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* @returns {Uint32Array}
|
|
542
|
+
*/
|
|
543
|
+
get lower() {
|
|
544
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
545
|
+
const context = { function: this.__oomContext?.function ?? "lower", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
546
|
+
const copies = [];
|
|
547
|
+
__oomBegin();
|
|
548
|
+
try {
|
|
549
|
+
copies.length = 0;
|
|
550
|
+
|
|
551
|
+
const ret = wasm.flatfiltration_lower(this.__wbg_ptr);
|
|
552
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
553
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
554
|
+
throw error;
|
|
555
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
556
|
+
|
|
557
|
+
} catch (error) {
|
|
558
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
559
|
+
throw __oomNormalize(error, context);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* @returns {number}
|
|
564
|
+
*/
|
|
565
|
+
get n() {
|
|
566
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
567
|
+
const context = { function: this.__oomContext?.function ?? "n", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
568
|
+
const copies = [];
|
|
569
|
+
__oomBegin();
|
|
570
|
+
try {
|
|
571
|
+
copies.length = 0;
|
|
572
|
+
|
|
573
|
+
const ret = wasm.flatfiltration_n(this.__wbg_ptr);
|
|
574
|
+
return ret >>> 0;
|
|
575
|
+
|
|
576
|
+
} catch (error) {
|
|
577
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
578
|
+
throw __oomNormalize(error, context);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* @returns {Uint32Array}
|
|
583
|
+
*/
|
|
584
|
+
get offsets() {
|
|
585
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
586
|
+
const context = { function: this.__oomContext?.function ?? "offsets", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
587
|
+
const copies = [];
|
|
588
|
+
__oomBegin();
|
|
589
|
+
try {
|
|
590
|
+
copies.length = 0;
|
|
591
|
+
|
|
592
|
+
const ret = wasm.flatfiltration_offsets(this.__wbg_ptr);
|
|
593
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
594
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
595
|
+
throw error;
|
|
596
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
597
|
+
|
|
598
|
+
} catch (error) {
|
|
599
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
600
|
+
throw __oomNormalize(error, context);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* @returns {Uint32Array}
|
|
605
|
+
*/
|
|
606
|
+
get upper() {
|
|
607
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
608
|
+
const context = { function: this.__oomContext?.function ?? "upper", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
609
|
+
const copies = [];
|
|
610
|
+
__oomBegin();
|
|
611
|
+
try {
|
|
612
|
+
copies.length = 0;
|
|
613
|
+
|
|
614
|
+
const ret = wasm.flatfiltration_upper(this.__wbg_ptr);
|
|
615
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
616
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
617
|
+
throw error;
|
|
618
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
619
|
+
|
|
620
|
+
} catch (error) {
|
|
621
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
622
|
+
throw __oomNormalize(error, context);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* @returns {Uint32Array}
|
|
627
|
+
*/
|
|
628
|
+
get vertices() {
|
|
629
|
+
if (this.__oomEpoch !== undefined && this.__oomEpoch !== __oomEpoch) throw new Error("wasm handle is invalid after instance recovery or unload");
|
|
630
|
+
const context = { function: this.__oomContext?.function ?? "vertices", input: {...this.__oomContext?.input,}, parameters: {} };
|
|
631
|
+
const copies = [];
|
|
632
|
+
__oomBegin();
|
|
633
|
+
try {
|
|
634
|
+
copies.length = 0;
|
|
635
|
+
|
|
636
|
+
const ret = wasm.flatfiltration_vertices(this.__wbg_ptr);
|
|
637
|
+
try { return new Uint32Array(getArrayU32FromWasm0(ret[0], ret[1])); } catch (error) {
|
|
638
|
+
if (error instanceof RangeError) throw __oomCapacity(context, 'output-copy', ret[1] * 4, {elementBytes:4, elements:ret[1]});
|
|
639
|
+
throw error;
|
|
640
|
+
} finally { wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); }
|
|
641
|
+
|
|
642
|
+
} catch (error) {
|
|
643
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
644
|
+
throw __oomNormalize(error, context);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
if (Symbol.dispose) FlatFiltration.prototype[Symbol.dispose] = FlatFiltration.prototype.free;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* @returns {Cl4Catalogue}
|
|
652
|
+
*/
|
|
653
|
+
export function cl4Catalogue() {
|
|
654
|
+
const context = { function: "cl4Catalogue", input: {}, parameters: {} };
|
|
655
|
+
const copies = [];
|
|
656
|
+
__oomBegin();
|
|
657
|
+
try {
|
|
658
|
+
copies.length = 0;
|
|
659
|
+
|
|
660
|
+
const ret = wasm.cl4Catalogue();
|
|
661
|
+
return Cl4Catalogue.__wrap(ret, context);
|
|
662
|
+
|
|
663
|
+
} catch (error) {
|
|
664
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
665
|
+
throw __oomNormalize(error, context);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* @param {number} n
|
|
671
|
+
* @returns {ClnCatalogue}
|
|
672
|
+
*/
|
|
673
|
+
export function clnCatalogue(n) {
|
|
674
|
+
const context = { function: "clnCatalogue", input: {}, parameters: {"n": n} };
|
|
675
|
+
const copies = [];
|
|
676
|
+
__oomBegin();
|
|
677
|
+
try {
|
|
678
|
+
copies.length = 0;
|
|
679
|
+
|
|
680
|
+
const ret = wasm.clnCatalogue(n);
|
|
681
|
+
if (ret[2]) {
|
|
682
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
683
|
+
}
|
|
684
|
+
return ClnCatalogue.__wrap(ret[0], context);
|
|
685
|
+
|
|
686
|
+
} catch (error) {
|
|
687
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
688
|
+
throw __oomNormalize(error, context);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* The course function (4.1) of `H_q` along an alternating zigzag course
|
|
694
|
+
* given as `column, row` pairs.
|
|
695
|
+
* @param {number} n
|
|
696
|
+
* @param {Uint32Array} offsets
|
|
697
|
+
* @param {Uint32Array} vertices
|
|
698
|
+
* @param {Uint32Array} lower
|
|
699
|
+
* @param {Uint32Array} upper
|
|
700
|
+
* @param {Uint32Array} labels
|
|
701
|
+
* @param {number} q
|
|
702
|
+
* @param {number} p
|
|
703
|
+
* @returns {number}
|
|
704
|
+
*/
|
|
705
|
+
export function courseRank(n, offsets, vertices, lower, upper, labels, q, p) {
|
|
706
|
+
const context = { function: "courseRank", input: {"offsets": offsets.length,"vertices": vertices.length,"lower": lower.length,"upper": upper.length,"labels": labels.length}, parameters: {"n": n,"q": q,"p": p} };
|
|
707
|
+
const copies = [];
|
|
708
|
+
__oomBegin();
|
|
709
|
+
try {
|
|
710
|
+
const ptr0 = passArray32ToWasm0(offsets, (size, align) => __oomAllocate(size, align, copies, context));
|
|
711
|
+
const len0 = WASM_VECTOR_LEN;
|
|
712
|
+
const ptr1 = passArray32ToWasm0(vertices, (size, align) => __oomAllocate(size, align, copies, context));
|
|
713
|
+
const len1 = WASM_VECTOR_LEN;
|
|
714
|
+
const ptr2 = passArray32ToWasm0(lower, (size, align) => __oomAllocate(size, align, copies, context));
|
|
715
|
+
const len2 = WASM_VECTOR_LEN;
|
|
716
|
+
const ptr3 = passArray32ToWasm0(upper, (size, align) => __oomAllocate(size, align, copies, context));
|
|
717
|
+
const len3 = WASM_VECTOR_LEN;
|
|
718
|
+
const ptr4 = passArray32ToWasm0(labels, (size, align) => __oomAllocate(size, align, copies, context));
|
|
719
|
+
const len4 = WASM_VECTOR_LEN;
|
|
720
|
+
copies.length = 0;
|
|
721
|
+
const ret = wasm.courseRank(n, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, q, p);
|
|
722
|
+
if (ret[2]) {
|
|
723
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
724
|
+
}
|
|
725
|
+
return ret[0] >>> 0;
|
|
726
|
+
|
|
727
|
+
} catch (error) {
|
|
728
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
729
|
+
throw __oomNormalize(error, context);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Exact decomposition of `H_q` of a ladder filtration on CL(n), `n ≤ 4`
|
|
735
|
+
* (CL(1)…CL(3) are extended by zero into CL(4)). Indexed as on CL(4); see
|
|
736
|
+
* `clnCatalogue(n)` for the CL(n) names.
|
|
737
|
+
* @param {number} n
|
|
738
|
+
* @param {Uint32Array} offsets
|
|
739
|
+
* @param {Uint32Array} vertices
|
|
740
|
+
* @param {Uint32Array} lower
|
|
741
|
+
* @param {Uint32Array} upper
|
|
742
|
+
* @param {number} q
|
|
743
|
+
* @param {number} p
|
|
744
|
+
* @returns {Cl4Decomposition}
|
|
745
|
+
*/
|
|
746
|
+
export function decomposeCL4(n, offsets, vertices, lower, upper, q, p) {
|
|
747
|
+
const context = { function: "decomposeCL4", input: {"offsets": offsets.length,"vertices": vertices.length,"lower": lower.length,"upper": upper.length}, parameters: {"n": n,"q": q,"p": p} };
|
|
748
|
+
const copies = [];
|
|
749
|
+
__oomBegin();
|
|
750
|
+
try {
|
|
751
|
+
const ptr0 = passArray32ToWasm0(offsets, (size, align) => __oomAllocate(size, align, copies, context));
|
|
752
|
+
const len0 = WASM_VECTOR_LEN;
|
|
753
|
+
const ptr1 = passArray32ToWasm0(vertices, (size, align) => __oomAllocate(size, align, copies, context));
|
|
754
|
+
const len1 = WASM_VECTOR_LEN;
|
|
755
|
+
const ptr2 = passArray32ToWasm0(lower, (size, align) => __oomAllocate(size, align, copies, context));
|
|
756
|
+
const len2 = WASM_VECTOR_LEN;
|
|
757
|
+
const ptr3 = passArray32ToWasm0(upper, (size, align) => __oomAllocate(size, align, copies, context));
|
|
758
|
+
const len3 = WASM_VECTOR_LEN;
|
|
759
|
+
copies.length = 0;
|
|
760
|
+
const ret = wasm.decomposeCL4(n, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, q, p);
|
|
761
|
+
if (ret[2]) {
|
|
762
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
763
|
+
}
|
|
764
|
+
return Cl4Decomposition.__wrap(ret[0], context);
|
|
765
|
+
|
|
766
|
+
} catch (error) {
|
|
767
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
768
|
+
throw __oomNormalize(error, context);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Interval approximation of `H_q` over GF(p) of the ladder filtration
|
|
774
|
+
* `(offsets, vertices, lower, upper)` on CL(n).
|
|
775
|
+
* @param {number} n
|
|
776
|
+
* @param {Uint32Array} offsets
|
|
777
|
+
* @param {Uint32Array} vertices
|
|
778
|
+
* @param {Uint32Array} lower
|
|
779
|
+
* @param {Uint32Array} upper
|
|
780
|
+
* @param {number} q
|
|
781
|
+
* @param {number} p
|
|
782
|
+
* @returns {Approximation}
|
|
783
|
+
*/
|
|
784
|
+
export function intervalApproximation(n, offsets, vertices, lower, upper, q, p) {
|
|
785
|
+
const context = { function: "intervalApproximation", input: {"offsets": offsets.length,"vertices": vertices.length,"lower": lower.length,"upper": upper.length}, parameters: {"n": n,"q": q,"p": p} };
|
|
786
|
+
const copies = [];
|
|
787
|
+
__oomBegin();
|
|
788
|
+
try {
|
|
789
|
+
const ptr0 = passArray32ToWasm0(offsets, (size, align) => __oomAllocate(size, align, copies, context));
|
|
790
|
+
const len0 = WASM_VECTOR_LEN;
|
|
791
|
+
const ptr1 = passArray32ToWasm0(vertices, (size, align) => __oomAllocate(size, align, copies, context));
|
|
792
|
+
const len1 = WASM_VECTOR_LEN;
|
|
793
|
+
const ptr2 = passArray32ToWasm0(lower, (size, align) => __oomAllocate(size, align, copies, context));
|
|
794
|
+
const len2 = WASM_VECTOR_LEN;
|
|
795
|
+
const ptr3 = passArray32ToWasm0(upper, (size, align) => __oomAllocate(size, align, copies, context));
|
|
796
|
+
const len3 = WASM_VECTOR_LEN;
|
|
797
|
+
copies.length = 0;
|
|
798
|
+
const ret = wasm.intervalApproximation(n, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, q, p);
|
|
799
|
+
if (ret[2]) {
|
|
800
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
801
|
+
}
|
|
802
|
+
return Approximation.__wrap(ret[0], context);
|
|
803
|
+
|
|
804
|
+
} catch (error) {
|
|
805
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
806
|
+
throw __oomNormalize(error, context);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* The Rips thinning ladder: upper row the Rips filtration of `points`
|
|
812
|
+
* (`count × dim`), lower row that of the points with `inLower[i] ≠ 0`, at
|
|
813
|
+
* the strictly increasing edge lengths `thresholds` (the API's `edgeLengths`), simplices up to `max_dim` (`maxSimplexDim`).
|
|
814
|
+
* @param {Float64Array} points
|
|
815
|
+
* @param {number} dim
|
|
816
|
+
* @param {Uint8Array} in_lower
|
|
817
|
+
* @param {Float64Array} thresholds
|
|
818
|
+
* @param {number} max_dim
|
|
819
|
+
* @returns {FlatFiltration}
|
|
820
|
+
*/
|
|
821
|
+
export function ripsThinningLadder(points, dim, in_lower, thresholds, max_dim) {
|
|
822
|
+
const context = { function: "ripsThinningLadder", input: {"points": points.length,"in_lower": in_lower.length,"thresholds": thresholds.length}, parameters: {"dim": dim,"maxDim": max_dim} };
|
|
823
|
+
const copies = [];
|
|
824
|
+
__oomBegin();
|
|
825
|
+
try {
|
|
826
|
+
const ptr0 = passArrayF64ToWasm0(points, (size, align) => __oomAllocate(size, align, copies, context));
|
|
827
|
+
const len0 = WASM_VECTOR_LEN;
|
|
828
|
+
const ptr1 = passArray8ToWasm0(in_lower, (size, align) => __oomAllocate(size, align, copies, context));
|
|
829
|
+
const len1 = WASM_VECTOR_LEN;
|
|
830
|
+
const ptr2 = passArrayF64ToWasm0(thresholds, (size, align) => __oomAllocate(size, align, copies, context));
|
|
831
|
+
const len2 = WASM_VECTOR_LEN;
|
|
832
|
+
copies.length = 0;
|
|
833
|
+
const ret = wasm.ripsThinningLadder(ptr0, len0, dim, ptr1, len1, ptr2, len2, max_dim);
|
|
834
|
+
if (ret[2]) {
|
|
835
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
836
|
+
}
|
|
837
|
+
return FlatFiltration.__wrap(ret[0], context);
|
|
838
|
+
|
|
839
|
+
} catch (error) {
|
|
840
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
841
|
+
throw __oomNormalize(error, context);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Crate version.
|
|
847
|
+
* @returns {string}
|
|
848
|
+
*/
|
|
849
|
+
export function version() {
|
|
850
|
+
const context = { function: "version", input: {}, parameters: {} };
|
|
851
|
+
const copies = [];
|
|
852
|
+
__oomBegin();
|
|
853
|
+
try {
|
|
854
|
+
let deferred1_0;
|
|
855
|
+
let deferred1_1;
|
|
856
|
+
try {
|
|
857
|
+
copies.length = 0;
|
|
858
|
+
const ret = wasm.version();
|
|
859
|
+
deferred1_0 = ret[0];
|
|
860
|
+
deferred1_1 = ret[1];
|
|
861
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
862
|
+
} finally {
|
|
863
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
} catch (error) {
|
|
867
|
+
if (!__oomPoisoned) for (const [ptr, size, align] of copies) wasm.__wbindgen_free(ptr, size, align);
|
|
868
|
+
throw __oomNormalize(error, context);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
function __wbg_get_imports() {
|
|
872
|
+
const import0 = {
|
|
873
|
+
__proto__: null,
|
|
874
|
+
__wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
|
|
875
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
876
|
+
return ret;
|
|
877
|
+
},
|
|
878
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
879
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
880
|
+
},
|
|
881
|
+
__wbindgen_init_externref_table: function() {
|
|
882
|
+
const table = wasm.__wbindgen_externrefs;
|
|
883
|
+
const offset = table.grow(4);
|
|
884
|
+
table.set(0, undefined);
|
|
885
|
+
table.set(offset + 0, undefined);
|
|
886
|
+
table.set(offset + 1, null);
|
|
887
|
+
table.set(offset + 2, true);
|
|
888
|
+
table.set(offset + 3, false);
|
|
889
|
+
},
|
|
890
|
+
};
|
|
891
|
+
return {
|
|
892
|
+
__proto__: null,
|
|
893
|
+
"./tda_ladder_bg.js": import0,
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
const ApproximationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
898
|
+
? { register: () => {}, unregister: () => {} }
|
|
899
|
+
: new FinalizationRegistry(({ptr,epoch}) => { if (epoch === __oomEpoch) wasm.__wbg_approximation_free(ptr, 1); });
|
|
900
|
+
const Cl4CatalogueFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
901
|
+
? { register: () => {}, unregister: () => {} }
|
|
902
|
+
: new FinalizationRegistry(({ptr,epoch}) => { if (epoch === __oomEpoch) wasm.__wbg_cl4catalogue_free(ptr, 1); });
|
|
903
|
+
const Cl4DecompositionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
904
|
+
? { register: () => {}, unregister: () => {} }
|
|
905
|
+
: new FinalizationRegistry(({ptr,epoch}) => { if (epoch === __oomEpoch) wasm.__wbg_cl4decomposition_free(ptr, 1); });
|
|
906
|
+
const ClnCatalogueFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
907
|
+
? { register: () => {}, unregister: () => {} }
|
|
908
|
+
: new FinalizationRegistry(({ptr,epoch}) => { if (epoch === __oomEpoch) wasm.__wbg_clncatalogue_free(ptr, 1); });
|
|
909
|
+
const FlatFiltrationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
910
|
+
? { register: () => {}, unregister: () => {} }
|
|
911
|
+
: new FinalizationRegistry(({ptr,epoch}) => { if (epoch === __oomEpoch) wasm.__wbg_flatfiltration_free(ptr, 1); });
|
|
912
|
+
|
|
913
|
+
function getArrayI32FromWasm0(ptr, len) {
|
|
914
|
+
ptr = ptr >>> 0;
|
|
915
|
+
return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
919
|
+
ptr = ptr >>> 0;
|
|
920
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
924
|
+
function getFloat64ArrayMemory0() {
|
|
925
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
926
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
927
|
+
}
|
|
928
|
+
return cachedFloat64ArrayMemory0;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
let cachedInt32ArrayMemory0 = null;
|
|
932
|
+
function getInt32ArrayMemory0() {
|
|
933
|
+
if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) {
|
|
934
|
+
cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer);
|
|
935
|
+
}
|
|
936
|
+
return cachedInt32ArrayMemory0;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
function getStringFromWasm0(ptr, len) {
|
|
940
|
+
return decodeText(ptr >>> 0, len);
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
let cachedUint32ArrayMemory0 = null;
|
|
944
|
+
function getUint32ArrayMemory0() {
|
|
945
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
946
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
947
|
+
}
|
|
948
|
+
return cachedUint32ArrayMemory0;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
let cachedUint8ArrayMemory0 = null;
|
|
952
|
+
function getUint8ArrayMemory0() {
|
|
953
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
954
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
955
|
+
}
|
|
956
|
+
return cachedUint8ArrayMemory0;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
960
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
961
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
962
|
+
WASM_VECTOR_LEN = arg.length;
|
|
963
|
+
return ptr;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
967
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
968
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
969
|
+
WASM_VECTOR_LEN = arg.length;
|
|
970
|
+
return ptr;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
|
974
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
975
|
+
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
976
|
+
WASM_VECTOR_LEN = arg.length;
|
|
977
|
+
return ptr;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
function takeFromExternrefTable0(idx) {
|
|
981
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
982
|
+
wasm.__externref_table_dealloc(idx);
|
|
983
|
+
return value;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
987
|
+
cachedTextDecoder.decode();
|
|
988
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
989
|
+
let numBytesDecoded = 0;
|
|
990
|
+
function decodeText(ptr, len) {
|
|
991
|
+
numBytesDecoded += len;
|
|
992
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
993
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
994
|
+
cachedTextDecoder.decode();
|
|
995
|
+
numBytesDecoded = len;
|
|
996
|
+
}
|
|
997
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
let WASM_VECTOR_LEN = 0;
|
|
1001
|
+
|
|
1002
|
+
let wasmModule, wasmInstance, wasm;
|
|
1003
|
+
function __wbg_finalize_init(instance, module) {
|
|
1004
|
+
const limits = WebAssembly.Module.customSections(module, 'topolab.memory-limit');
|
|
1005
|
+
if (limits.length) __oomLimit = Number(new TextDecoder().decode(limits[limits.length - 1]));
|
|
1006
|
+
wasmInstance = instance;
|
|
1007
|
+
wasm = __oomExports(instance.exports);
|
|
1008
|
+
__oomEpoch++;
|
|
1009
|
+
__oomInitialBytes = wasm.memory.buffer.byteLength;
|
|
1010
|
+
__oomRecordAddress = wasm.__oom_record();
|
|
1011
|
+
__capacityRecordAddress = wasm.__capacity_record();
|
|
1012
|
+
wasmModule = module;
|
|
1013
|
+
cachedFloat64ArrayMemory0 = null;
|
|
1014
|
+
cachedInt32ArrayMemory0 = null;
|
|
1015
|
+
cachedUint32ArrayMemory0 = null;
|
|
1016
|
+
cachedUint8ArrayMemory0 = null;
|
|
1017
|
+
wasm.__wbindgen_start();
|
|
1018
|
+
return wasm;
|
|
1019
|
+
}
|
|
1020
|
+
// Only evaluated on refusal. Sizes describe a fresh instance with retained
|
|
1021
|
+
// handles discarded; this is an estimate, never an admission check.
|
|
1022
|
+
const __oomPhases = ['allocator','edge list','adjacency matrix','edge collapse',
|
|
1023
|
+
'coboundary columns','Delaunay triangulation','filtration','boundary matrix',
|
|
1024
|
+
'cubical cells','cost matrix','transport plan','transport solver',
|
|
1025
|
+
'sorted samples','projections','directions','result','input validation',
|
|
1026
|
+
'geometric neighborhoods','zigzag interval state','volume optimization',
|
|
1027
|
+
'representation grid','ladder matrices','(unused)','catalogue'];
|
|
1028
|
+
function __oomSize(bytes) {
|
|
1029
|
+
const units=['bytes','KiB','MiB','GiB'];
|
|
1030
|
+
let u=0; while(bytes>=1024 && u<3) {bytes/=1024;u++;}
|
|
1031
|
+
return bytes.toFixed(2)+' '+units[u];
|
|
1032
|
+
}
|
|
1033
|
+
function __oomEstimate(details) {
|
|
1034
|
+
const {function:fn,input:i,parameters:p,requestedBytes:r}=details;
|
|
1035
|
+
const headroom=Math.max(0,details.limitBytes-__oomInitialBytes);
|
|
1036
|
+
// Committed pages are NOT live usage. Their sum with the failed request
|
|
1037
|
+
// is a conservative pressure observation, not an exact peak calculation.
|
|
1038
|
+
const pressure=details.memoryBytes+r;
|
|
1039
|
+
const budget=0.5*headroom;
|
|
1040
|
+
const limits=details.allocationLimitBytes;
|
|
1041
|
+
let n,m,degree=2,working,unit='points per side',law,reference;
|
|
1042
|
+
if(fn==='ripsPersistence' && (p.maxDim??1)<=1 && (p.maxEdgeLength===Infinity) && p.coeff===2) {
|
|
1043
|
+
n=i.points??i.rows;
|
|
1044
|
+
// Infinity bounds edges by n*(n-1)/2; the enclosing-radius shortcut
|
|
1045
|
+
// can remove some. Radix staging and reduction also occupy memory.
|
|
1046
|
+
working=x=>(i.rows?56:48)*x*x+8*(i.dimension??0)*x;
|
|
1047
|
+
unit='points';law='Rips edge storage O(n^2), at most n*(n-1)/2 edges; same maxDim<=1, Infinity and coeff=2. Reduction is data dependent.';
|
|
1048
|
+
if(p.maxDim===1&&((i.dimension===3)||i.rows)) reference={size:i.rows?4096:8192,limitBytes:2147483648,unit:'points',parameters:'uniform unit-cube cloud, maxDim=1, Infinity, coeff=2; dense Euclidean matrix when applicable'};
|
|
1049
|
+
} else if((fn==='cubicalComplex'||fn==='cubicalPersistence') && i.shape?.length>=1 && i.shape.length<=3 && (fn==='cubicalComplex'||p.coeff===2)) {
|
|
1050
|
+
const d=i.shape.length; n=i.cells;degree=1;
|
|
1051
|
+
working=x=>32*3**d*x;
|
|
1052
|
+
unit='grid cells';law='Cubical cell count O(3^d * voxels), fixed dimension and aspect ratio, coeff=2. Reduction fill depends on values; conservative structural model.';
|
|
1053
|
+
if(fn==='cubicalPersistence'&&p.construction!=='V'&&d>=2&&i.shape.every(x=>x===i.shape[0])) reference={size:(d===2?4096**2:128**3),limitBytes:2147483648,unit:'grid cells',parameters:'uniform values, construction T, coeff=2, equal grid sides'};
|
|
1054
|
+
} else if(fn==='ripsComplex' && p.maxEdgeLength===Infinity && p.maxDim>=0 && p.maxDim<=3) {
|
|
1055
|
+
n=i.points??i.rows;degree=Math.max(i.rows?2:1,p.maxDim+1);
|
|
1056
|
+
working=x=>{let cells=0,choose=1;for(let k=1;k<=p.maxDim+1;k++){choose*=Math.max(0,x-k+1)/k;cells+=choose;}return 64*cells+(i.rows?8*x*x:8*x*(i.dimension??1));};
|
|
1057
|
+
unit='points';law='Full Rips complex bounded by sum(k=1..maxDim+1) binomial(n,k) simplices, plus graph and input, at Infinity; fixed maxDim<=3.';
|
|
1058
|
+
} else if(fn==='diagramWasserstein' && i.n>0 && i.m>0) {
|
|
1059
|
+
n=i.n;m=i.m;const ratio=m/n;
|
|
1060
|
+
working=x=>(x+1)*(ratio*x+1)>16777216?Infinity:64*(x+1)*(ratio*x+1)+512*(1+ratio)*x;
|
|
1061
|
+
unit='pairs per source diagram';law='Diagram Wasserstein O((n+1)*(m+1)), finite-pair counts bounded by total pairs, fixed ratio; includes cost matrix, diagonal node and simplex scratch. Existing 16777216-entry cap still applies.';
|
|
1062
|
+
if(n===m&&p.order===2&&p.internal_p===Infinity) reference={size:2048,limitBytes:2147483648,unit:'pairs per diagram',parameters:'finite uniform births/lifetimes, order=2, internalP=Infinity'};
|
|
1063
|
+
} else if(fn==='persistenceLandscape' && i.gridPoints>0 && p.first>=1 && p.last>=p.first) {
|
|
1064
|
+
n=i.gridPoints;degree=1;
|
|
1065
|
+
working=x=>8*x*(p.last-p.first+1+2*Math.min(p.last,16)+8)+64*i.pairElements;
|
|
1066
|
+
unit='grid points';law='Landscape memory O(gridPoints*levels+pairs), fixed first/last levels and same pairs. Includes output, per-grid work and sort buffers.';
|
|
1067
|
+
} else if(fn==='persistenceImage' && i.shape?.every(x=>x>0)) {
|
|
1068
|
+
n=i.cells;degree=1;
|
|
1069
|
+
working=x=>32*x+64*i.pairElements;
|
|
1070
|
+
unit='pixels';law='Persistence image memory O(rows*cols+pairs), fixed aspect ratio and same pairs. Output and per-axis work; double output allowance.';
|
|
1071
|
+
}
|
|
1072
|
+
if(!working || !(n>0) || !Number.isFinite(r) || !(r>0)) {
|
|
1073
|
+
details.estimateMethod='Omitted: data-dependent output size or reduction fill, or missing input dimensions, prevent a whole-input estimate. Input-copy and result-copy ceilings alone do not predict pipeline capacity.';
|
|
1074
|
+
return;
|
|
1075
|
+
}
|
|
1076
|
+
// Invert both the full working-set model and the failed structure's
|
|
1077
|
+
// measured pressure under its known degree. Round down, never up.
|
|
1078
|
+
const structural=n*Math.min(1,(budget/Math.max(pressure,1))**(1/degree), (limits/r)**(1/degree));
|
|
1079
|
+
let lo=0,hi=Math.min(n,structural);
|
|
1080
|
+
for(let k=0;k<48;k++) {const mid=(lo+hi)/2;if(working(mid)<=budget)lo=mid;else hi=mid;}
|
|
1081
|
+
let fit=Math.floor(lo);
|
|
1082
|
+
if(reference) {
|
|
1083
|
+
// Cross-check against the same-parameter capacity-benchmark doubling ladder.
|
|
1084
|
+
// A measured largest success is a conservative ceiling, not the true
|
|
1085
|
+
// maximum. Scaling that reference is still only a model at 64 MiB.
|
|
1086
|
+
fit=Math.min(fit,Math.floor(reference.size*(details.limitBytes/reference.limitBytes)**(1/degree)));
|
|
1087
|
+
details.capacityReference=reference;
|
|
1088
|
+
}
|
|
1089
|
+
if(fit<1) {details.estimateMethod=law+' Omitted: fixed inputs or the modeled working set leave no positive retry size.';return;}
|
|
1090
|
+
if(i.shape) {
|
|
1091
|
+
const factor=(fit/n)**(1/i.shape.length);
|
|
1092
|
+
const shape=i.shape.map(x=>Math.max(1,Math.floor(x*factor)));
|
|
1093
|
+
fit=shape.reduce((a,b)=>a*b,1);details.estimatedInputShape=shape;
|
|
1094
|
+
} else if(m) details.estimatedInputShape=[fit,Math.floor(fit*m/n)];
|
|
1095
|
+
if(fit<1 || (details.estimatedInputShape?.some(x=>x<1))) return;
|
|
1096
|
+
details.estimatedMaxInput=fit;
|
|
1097
|
+
details.estimateUnit=unit;
|
|
1098
|
+
details.estimateMethod=law+' Invert requestedBytes and committedBytes pressure with growth degree '+degree+'; take the smaller of that and the full working-set model using 50% of fresh-instance headroom, bounded by the single-buffer ceiling'+(reference?' and cross-checked against the 2026-10-17 capacity benchmark at the stated parameters':'')+'. Round down. Discard retained handles first; fragmentation, data-dependent fill and later stages can reduce capacity. Estimate, not a guarantee.';
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
// Embedded inside each generated glue instance by patch_memory_glue.mjs.
|
|
1102
|
+
let __oomLimit = 4294967296;
|
|
1103
|
+
let __oomEpoch = 0, __oomPoisoned = false, __oomInitialBytes = 0;
|
|
1104
|
+
let __oomRecovery = () => {};
|
|
1105
|
+
let __oomCallDepth = 0, __oomFailureContext;
|
|
1106
|
+
export function __oom_on_recover(callback) { __oomRecovery = callback; }
|
|
1107
|
+
export function __oom_status() { return {memory:wasm.memory, epoch:__oomEpoch, limitBytes:__oomLimit}; }
|
|
1108
|
+
function __oomExports(raw) {
|
|
1109
|
+
const exports = {...raw};
|
|
1110
|
+
for (const [name, fn] of Object.entries(raw)) {
|
|
1111
|
+
if (typeof fn !== 'function') continue;
|
|
1112
|
+
exports[name] = (...args) => {
|
|
1113
|
+
if (__oomPoisoned) {
|
|
1114
|
+
if (/free|dealloc/.test(name)) return;
|
|
1115
|
+
throw new WebAssembly.RuntimeError('instance already trapped');
|
|
1116
|
+
}
|
|
1117
|
+
__oomCallDepth++;
|
|
1118
|
+
try {
|
|
1119
|
+
const result=fn(...args);
|
|
1120
|
+
if (__oomPoisoned) throw new WebAssembly.RuntimeError('nested engine call trapped');
|
|
1121
|
+
return result;
|
|
1122
|
+
}
|
|
1123
|
+
catch (error) {
|
|
1124
|
+
if (error instanceof WebAssembly.RuntimeError) __oomPoisoned = true;
|
|
1125
|
+
throw error;
|
|
1126
|
+
} finally { __oomCallDepth--; }
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
return exports;
|
|
1130
|
+
}
|
|
1131
|
+
function __oomBegin() {
|
|
1132
|
+
if (__oomPoisoned) throw new WebAssembly.RuntimeError('instance already trapped');
|
|
1133
|
+
// A previous fallible reservation may have returned an ordinary error.
|
|
1134
|
+
// Clear only the failure marker; Rust exports set their own function id.
|
|
1135
|
+
new Uint32Array(wasm.memory.buffer, __oomRecordAddress, 5)[0] = 0;
|
|
1136
|
+
new Uint32Array(wasm.memory.buffer, __capacityRecordAddress, 5).fill(0);
|
|
1137
|
+
}
|
|
1138
|
+
function __oomCapacity(context, phase, requestedBytes, extra = {}) {
|
|
1139
|
+
const memoryBytes = extra.memoryBytes ?? wasm.memory.buffer.byteLength;
|
|
1140
|
+
// A recorded allocator failure whose request still fits the declared
|
|
1141
|
+
// remaining address space means the host refused growth before that max.
|
|
1142
|
+
// The reached pages are a conservative retry budget, not a discovered
|
|
1143
|
+
// permanent browser ceiling. Never infer this from a Layout/JS-copy error.
|
|
1144
|
+
const record = new Uint32Array(wasm.memory.buffer, __oomRecordAddress, 5);
|
|
1145
|
+
const capacityOverflow = extra.capacityOverflow === true || (phase === 'input-copy' && requestedBytes > 2147483647);
|
|
1146
|
+
const growthRefused = !capacityOverflow && phase !== 'output-copy' && record[0] > 0
|
|
1147
|
+
&& memoryBytes < __oomLimit && requestedBytes <= __oomLimit - memoryBytes;
|
|
1148
|
+
const limitBytes = capacityOverflow ? Math.min(__oomLimit,2147483647) : growthRefused ? memoryBytes : __oomLimit;
|
|
1149
|
+
const details = {...context, phase, requestedBytes, inUseBytes:null,
|
|
1150
|
+
memoryBytes, committedBytes:memoryBytes, limitBytes, declaredMaxBytes:__oomLimit,
|
|
1151
|
+
allocationLimitBytes:Math.min(limitBytes,2147483647), ...extra};
|
|
1152
|
+
if (extra.elementBytes > 0) details.capacityEstimate = {
|
|
1153
|
+
maximumElements: Math.floor(details.allocationLimitBytes / extra.elementBytes),
|
|
1154
|
+
method:'Absolute ceiling for this buffer alone; other allocations and fragmentation reduce it. Not a largest-fitting whole-input estimate.'
|
|
1155
|
+
};
|
|
1156
|
+
__oomEstimate(details);
|
|
1157
|
+
const describe = value => JSON.stringify(value,(_key,x)=>typeof x==='number' && !Number.isFinite(x)?String(x):x);
|
|
1158
|
+
const remedy = __oomRemedies[context.function] ?? 'Use a smaller input.';
|
|
1159
|
+
const ceiling = requestedBytes > 2147483647 ? '; exceeds the wasm32 per-allocation ceiling (just below 2 GiB)' : '';
|
|
1160
|
+
// A growth the standard library refused before its size was checked
|
|
1161
|
+
// (the panic hook's record, alignment 0): only a lower bound is known.
|
|
1162
|
+
const atLeast = capacityOverflow && extra.alignment === 0 ? 'at least ' : '';
|
|
1163
|
+
const growth = growthRefused ? '; this browser refused to grow WebAssembly memory beyond '+__oomSize(limitBytes)+' (declared maximum '+__oomSize(__oomLimit)+')' : '';
|
|
1164
|
+
const fit = details.estimatedMaxInput;
|
|
1165
|
+
const estimate = fit ? '. About '+fit.toLocaleString('en-US')+' '+details.estimateUnit+' should fit with these parameters'+(details.estimatedInputShape ? ' (shape '+details.estimatedInputShape.join(' × ')+')' : '')+' in a fresh instance; estimate, not a guarantee' : '. No whole-input fit estimate is available for this stage';
|
|
1166
|
+
const error = new RangeError(context.function+': input too large for WebAssembly memory while building '+phase+'; '+atLeast+__oomSize(requestedBytes)+' requested'+ceiling+'; '+__oomSize(details.memoryBytes)+' committed (live usage unknown) of a '+__oomSize(__oomLimit)+' maximum'+growth+'; input '+describe(context.input)+'; parameters '+describe(context.parameters)+estimate+'. '+remedy);
|
|
1167
|
+
error.code='TOO_LARGE'; error.details=details;
|
|
1168
|
+
return error;
|
|
1169
|
+
}
|
|
1170
|
+
function __oomAllocate(size, align, copies, context) {
|
|
1171
|
+
const ptr=Number.isSafeInteger(size) && size>=0 && size<=Math.min(__oomLimit,2147483647) ? wasm.oom_reserve(size/align,align)>>>0 : 0;
|
|
1172
|
+
if (!ptr) throw __oomCapacity(context,'input-copy',size,{elements:size/align,elementBytes:align});
|
|
1173
|
+
copies.push([ptr,size,align]);
|
|
1174
|
+
return ptr;
|
|
1175
|
+
}
|
|
1176
|
+
function __oomNormalize(error, context) {
|
|
1177
|
+
if (error instanceof WebAssembly.RuntimeError) {
|
|
1178
|
+
// A nested user callback may catch a trap while an outer Rust call
|
|
1179
|
+
// is still on the stack. Recover only after all old wasm frames exit.
|
|
1180
|
+
__oomFailureContext ??= context;
|
|
1181
|
+
if (__oomCallDepth) throw error;
|
|
1182
|
+
context=__oomFailureContext;
|
|
1183
|
+
__oomFailureContext=undefined;
|
|
1184
|
+
// Read the poisoned instance before replacing any glue state. Do not
|
|
1185
|
+
// call back into it: even the record's address is cached at finalize.
|
|
1186
|
+
const record=Array.from(new Uint32Array(wasm.memory.buffer,__oomRecordAddress,5));
|
|
1187
|
+
const capacity=Array.from(new Uint32Array(wasm.memory.buffer,__capacityRecordAddress,5));
|
|
1188
|
+
const failure=(capacity[0] || capacity[1]) ? __oomCapacity(context,__oomPhases[capacity[3]]??'allocator',capacity[0]+4294967296*capacity[1],{
|
|
1189
|
+
capacityOverflow:true,alignment:capacity[2],functionId:record[2],phaseId:capacity[3],memoryBytes:capacity[4]*65536
|
|
1190
|
+
}) : record[0] ? __oomCapacity(context,__oomPhases[record[3]]??'allocator',record[0],{
|
|
1191
|
+
alignment:record[1],functionId:record[2],phaseId:record[3],memoryBytes:record[4]*65536
|
|
1192
|
+
}) : new Error(context.function+': internal WebAssembly trap ('+error.message+'); instance recovered',{cause:error});
|
|
1193
|
+
const compiled=wasmModule;
|
|
1194
|
+
const start=performance.now();
|
|
1195
|
+
__oomPoisoned=false;
|
|
1196
|
+
try {
|
|
1197
|
+
__wbg_finalize_init(new WebAssembly.Instance(compiled,__wbg_get_imports()),compiled);
|
|
1198
|
+
} catch (recoveryError) {
|
|
1199
|
+
__oomPoisoned=true;
|
|
1200
|
+
throw new Error(context.function+': WebAssembly instance recovery failed',{cause:recoveryError});
|
|
1201
|
+
}
|
|
1202
|
+
if (failure.details) failure.details.recoveryMilliseconds=performance.now()-start;
|
|
1203
|
+
// Memory views, scratch addresses and handles are invalidated before
|
|
1204
|
+
// control returns to the caller, including for an internal trap.
|
|
1205
|
+
__oomRecovery(wasm.memory);
|
|
1206
|
+
throw failure;
|
|
1207
|
+
}
|
|
1208
|
+
if (error && error.code==='TOO_LARGE') return error.details?.function ? error : __oomCapacity(context,error.details.phase,error.details.requestedBytes,error.details);
|
|
1209
|
+
// Existing allocation Result errors are retained only where already free.
|
|
1210
|
+
const match=/out of memory allocating (\d+) elements/.exec(error?.message);
|
|
1211
|
+
if (match) {
|
|
1212
|
+
const record=new Uint32Array(wasm.memory.buffer,__oomRecordAddress,5);
|
|
1213
|
+
if(record[0]) return __oomCapacity(context,__oomPhases[record[3]]??'allocator',record[0],{alignment:record[1],functionId:record[2],phaseId:record[3],memoryBytes:record[4]*65536});
|
|
1214
|
+
}
|
|
1215
|
+
return error;
|
|
1216
|
+
}
|
|
1217
|
+
let __oomRecordAddress=0, __capacityRecordAddress=0;
|
|
1218
|
+
// What a caller of each function can make smaller, in the API's own names.
|
|
1219
|
+
const __oomRemedies = {
|
|
1220
|
+
ripsPersistence:'Use fewer points, a smaller maxEdgeLength or a smaller maxDim.',
|
|
1221
|
+
ripsComplex:'Use fewer points, a smaller maxEdgeLength or a smaller maxSimplexDim.',
|
|
1222
|
+
ripsVineyard:'Use fewer points or clouds, a smaller maxEdgeLength or a smaller maxDim.',
|
|
1223
|
+
cechComplex:'Use fewer points, a smaller maxRadius or a smaller maxSimplexDim.',
|
|
1224
|
+
cechPersistence:'Use fewer points, a smaller maxRadius or a smaller maxSimplexDim.',
|
|
1225
|
+
delaunayCechComplex:'Use fewer points or a smaller maxRadius.',
|
|
1226
|
+
alphaComplex:'Use fewer points or a smaller maxSquaredRadius.',
|
|
1227
|
+
alphaPersistence:'Use fewer points or a smaller maxSquaredRadius.',
|
|
1228
|
+
coupledAlphaComplex:'Use a smaller maxSquaredRadius or a smaller maxSimplexDim.',
|
|
1229
|
+
kFoldCoverComplex:'Use fewer points, a smaller k, a smaller maxSquaredRadius or a smaller maxSimplexDim.',
|
|
1230
|
+
kFoldCoverPersistence:'Use fewer points, a smaller k, a smaller maxSquaredRadius or a smaller maxSimplexDim.',
|
|
1231
|
+
witnessComplex:'Use fewer points or landmarks, a smaller maxSquaredRelaxation or a smaller maxSimplexDim.',
|
|
1232
|
+
ellipsoids:'Use fewer points or a smaller neighbors.',
|
|
1233
|
+
ellipsoidRipsComplex:'Use fewer points, a smaller maxEdgeLength or a smaller maxSimplexDim.',
|
|
1234
|
+
ellipsoidRipsPersistence:'Use fewer points, a smaller maxEdgeLength or a smaller maxSimplexDim.',
|
|
1235
|
+
ellipsoidCechComplex:'Use fewer points, a smaller maxRadius or a smaller maxSimplexDim.',
|
|
1236
|
+
ellipsoidCechPersistence:'Use fewer points, a smaller maxRadius or a smaller maxSimplexDim.',
|
|
1237
|
+
wings:'Use fewer points.',
|
|
1238
|
+
wingComplex:'Use fewer points, a smaller maxEpsilon or a smaller maxSimplexDim.',
|
|
1239
|
+
wingPersistence:'Use fewer points, a smaller maxEpsilon or a smaller maxSimplexDim.',
|
|
1240
|
+
boxFiltration:'Use fewer points, a smaller maxSteps or a smaller maxSimplexDim.',
|
|
1241
|
+
boxFiltrationPersistence:'Use fewer points, a smaller maxSteps or a smaller maxSimplexDim.',
|
|
1242
|
+
cubicalComplex:'Use a smaller image or volume.',
|
|
1243
|
+
cubicalPersistence:'Use a smaller image or volume.',
|
|
1244
|
+
cubicalVineyard:'Use fewer or smaller images.',
|
|
1245
|
+
persistence:'Use a smaller complex.',
|
|
1246
|
+
prepareComplex:'Use a smaller complex.',
|
|
1247
|
+
vineyard:'Use a smaller complex or fewer frames.',
|
|
1248
|
+
zigzagPersistence:'Use fewer operations.',
|
|
1249
|
+
volumeOptimalCycles:'Use a smaller complex.',
|
|
1250
|
+
longPairs:'Use a smaller diagram.',
|
|
1251
|
+
bettiNumbers:'Use a smaller diagram.',
|
|
1252
|
+
bettiCurve:'Use a smaller diagram or grid.',
|
|
1253
|
+
persistenceLandscape:'Use a smaller diagram, a smaller grid or fewer layers.',
|
|
1254
|
+
persistenceImage:'Use a smaller diagram or resolution.',
|
|
1255
|
+
diagramWasserstein:'Use smaller diagrams.',
|
|
1256
|
+
diagramBottleneck:'Use smaller diagrams.',
|
|
1257
|
+
intervalApproximation:'Use a shorter ladder (a smaller n) or a smaller filtration.',
|
|
1258
|
+
decomposeCL4:'Use a smaller filtration.',
|
|
1259
|
+
courseRank:'Use a smaller filtration or a shorter course.',
|
|
1260
|
+
ripsThinningLadder:'Use fewer points, fewer edgeLengths or a smaller maxSimplexDim.'
|
|
1261
|
+
};
|
|
1262
|
+
|
|
1263
|
+
async function __wbg_load(module, imports) {
|
|
1264
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1265
|
+
if (!module.ok) {
|
|
1266
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1270
|
+
try {
|
|
1271
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1272
|
+
} catch (e) {
|
|
1273
|
+
const validResponse = expectedResponseType(module.type);
|
|
1274
|
+
|
|
1275
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1276
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1277
|
+
|
|
1278
|
+
} else { throw e; }
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
const bytes = await module.arrayBuffer();
|
|
1283
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1284
|
+
} else {
|
|
1285
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1286
|
+
|
|
1287
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1288
|
+
return { instance, module };
|
|
1289
|
+
} else {
|
|
1290
|
+
return instance;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
function expectedResponseType(type) {
|
|
1295
|
+
switch (type) {
|
|
1296
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1297
|
+
}
|
|
1298
|
+
return false;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
function initSync(module) {
|
|
1303
|
+
if (wasm !== undefined) return wasm;
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
if (module !== undefined) {
|
|
1307
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1308
|
+
({module} = module)
|
|
1309
|
+
} else {
|
|
1310
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
const imports = __wbg_get_imports();
|
|
1315
|
+
if (Object.prototype.toString.call(module) !== "[object WebAssembly.Module]") {
|
|
1316
|
+
module = new WebAssembly.Module(module);
|
|
1317
|
+
}
|
|
1318
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1319
|
+
return __wbg_finalize_init(instance, module);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
async function __wbg_init(module_or_path) {
|
|
1323
|
+
if (wasm !== undefined) return wasm;
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
if (module_or_path !== undefined) {
|
|
1327
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1328
|
+
({module_or_path} = module_or_path)
|
|
1329
|
+
} else {
|
|
1330
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
if (module_or_path === undefined) {
|
|
1335
|
+
module_or_path = new URL('tda_ladder_bg.wasm', import.meta.url);
|
|
1336
|
+
}
|
|
1337
|
+
const imports = __wbg_get_imports();
|
|
1338
|
+
|
|
1339
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1340
|
+
module_or_path = fetch(module_or_path);
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1344
|
+
|
|
1345
|
+
return __wbg_finalize_init(instance, module);
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
export { initSync, __wbg_init as default };
|
|
1349
|
+
|
|
1350
|
+
/** Forget the instance (`unload()` of @topolab/tda/ladder). */
|
|
1351
|
+
export function __ladder_unload() {
|
|
1352
|
+
__oomEpoch++;
|
|
1353
|
+
wasm = undefined;
|
|
1354
|
+
wasmInstance = undefined;
|
|
1355
|
+
wasmModule = undefined;
|
|
1356
|
+
cachedFloat64ArrayMemory0 = null;
|
|
1357
|
+
cachedInt32ArrayMemory0 = null;
|
|
1358
|
+
cachedUint32ArrayMemory0 = null;
|
|
1359
|
+
cachedUint8ArrayMemory0 = null;
|
|
1360
|
+
}
|