@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
package/dist/flat.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object forms of typed-array results, built on request, and point clouds
|
|
3
|
+
* from rows (internal module; the package root re-exports the API). Pure
|
|
4
|
+
* TypeScript: none of these needs the module loaded.
|
|
5
|
+
*/
|
|
6
|
+
import { kind, oneOf } from './check.js';
|
|
7
|
+
import { complexArgs } from './persistence.js';
|
|
8
|
+
/**
|
|
9
|
+
* A point cloud from one array of coordinates per point. Every row must have
|
|
10
|
+
* the same positive length `d`, and every coordinate must be a number (a
|
|
11
|
+
* string, `null` or a hole is a `TypeError`).
|
|
12
|
+
*/
|
|
13
|
+
export function pointCloud(rows) {
|
|
14
|
+
if (rows === null || typeof rows !== 'object' || typeof rows.length !== 'number')
|
|
15
|
+
throw new TypeError(`rows must be an array of rows, got ${kind(rows)}`);
|
|
16
|
+
if (rows.length === 0)
|
|
17
|
+
throw new RangeError('rows must hold at least one point');
|
|
18
|
+
const first = rows[0];
|
|
19
|
+
if (first === null || typeof first !== 'object' || typeof first.length !== 'number')
|
|
20
|
+
throw new TypeError(`rows[0] must be an array of numbers, got ${kind(first)}`);
|
|
21
|
+
const d = first.length;
|
|
22
|
+
if (d === 0)
|
|
23
|
+
throw new RangeError('rows[0] must have at least one coordinate');
|
|
24
|
+
const coords = new Float64Array(rows.length * d);
|
|
25
|
+
for (let i = 0; i < rows.length; i++) {
|
|
26
|
+
const row = rows[i];
|
|
27
|
+
if (row === null || typeof row !== 'object' || typeof row.length !== 'number')
|
|
28
|
+
throw new TypeError(`rows[${i}] must be an array of numbers, got ${kind(row)}`);
|
|
29
|
+
if (row.length !== d)
|
|
30
|
+
throw new RangeError(`rows[${i}] has ${row.length} coordinates, rows[0] has ${d}`);
|
|
31
|
+
for (let c = 0; c < d; c++) {
|
|
32
|
+
const x = row[c];
|
|
33
|
+
if (typeof x !== 'number')
|
|
34
|
+
throw new TypeError(`rows[${i}][${c}] must be a number, got ${kind(x)}`);
|
|
35
|
+
coords[i * d + c] = x;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return { coords, d };
|
|
39
|
+
}
|
|
40
|
+
/** Rows of `width` ids from flat `values`, rows [from, to). */
|
|
41
|
+
function idRows(values, from, to, width) {
|
|
42
|
+
const out = [];
|
|
43
|
+
for (let s = from; s < to; s++)
|
|
44
|
+
out.push(Array.from(values.subarray(s * width, (s + 1) * width)));
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
export function materialize(input) {
|
|
48
|
+
if (input === null || typeof input !== 'object') {
|
|
49
|
+
throw new TypeError(`materialize takes a complex, volume-optimal cycles or Rips representatives, got ${kind(input)}`);
|
|
50
|
+
}
|
|
51
|
+
if ('coefficients' in input && 'pairIndex' in input) {
|
|
52
|
+
const r = input;
|
|
53
|
+
const out = [];
|
|
54
|
+
for (let i = 0; i < r.pairIndex.length; i++) {
|
|
55
|
+
const dim = r.dims[i];
|
|
56
|
+
const simplices = [];
|
|
57
|
+
const coefficients = [];
|
|
58
|
+
let at = r.vertexOffsets[i];
|
|
59
|
+
for (let s = r.simplexOffsets[i]; s < r.simplexOffsets[i + 1]; s++) {
|
|
60
|
+
simplices.push(Array.from(r.vertices.subarray(at, at + dim + 1)));
|
|
61
|
+
at += dim + 1;
|
|
62
|
+
coefficients.push(r.coefficients[s]);
|
|
63
|
+
}
|
|
64
|
+
const touched = Array.from(new Set(r.vertices.subarray(r.vertexOffsets[i], r.vertexOffsets[i + 1]))).sort((a, b) => a - b);
|
|
65
|
+
out.push({ dim, pairIndex: r.pairIndex[i], birth: r.births[i], death: r.deaths[i], simplices, coefficients, vertices: touched });
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
if ('births' in input && 'found' in input) {
|
|
70
|
+
const c = input;
|
|
71
|
+
const out = [];
|
|
72
|
+
for (let r = 0; r < c.births.length; r++) {
|
|
73
|
+
out.push({
|
|
74
|
+
dim: c.dim,
|
|
75
|
+
birth: c.births[r],
|
|
76
|
+
death: c.deaths[r],
|
|
77
|
+
cycleVertices: Array.from(c.cycleVertices.subarray(c.cycleVertexOffsets[r], c.cycleVertexOffsets[r + 1])),
|
|
78
|
+
cycleSimplices: idRows(c.boundaryVertices, c.boundaryOffsets[r], c.boundaryOffsets[r + 1], c.dim + 1),
|
|
79
|
+
volumeSimplices: idRows(c.volumeVertices, c.volumeOffsets[r], c.volumeOffsets[r + 1], c.dim + 2),
|
|
80
|
+
found: c.found[r] === 1
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
const given = input;
|
|
86
|
+
if (given.vertices === undefined || given.offsets === undefined || given.filtrations === undefined) {
|
|
87
|
+
throw new TypeError(`materialize takes a complex, volume-optimal cycles or Rips representatives, got ${kind(input)}`);
|
|
88
|
+
}
|
|
89
|
+
// The entries as for every function that takes a complex, then its CSR
|
|
90
|
+
// shape as the engine checks it, with the engine's messages.
|
|
91
|
+
const { vertices, offsets, filtrations } = complexArgs(input, 'complex');
|
|
92
|
+
const n = filtrations.length;
|
|
93
|
+
if (offsets.length !== n + 1 || offsets[0] !== 0 || offsets[n] !== vertices.length) {
|
|
94
|
+
throw new RangeError(`invalid input: offsets must have length n + 1 = ${n + 1} (one per value, plus one), start at 0 and end at vertices.length = ${vertices.length}`);
|
|
95
|
+
}
|
|
96
|
+
for (let i = 0; i < n; i++) {
|
|
97
|
+
if (offsets[i + 1] < offsets[i]) {
|
|
98
|
+
throw new RangeError(`invalid input: offsets must be non-decreasing; offsets[${i + 1}] = ${offsets[i + 1]} < offsets[${i}] = ${offsets[i]}`);
|
|
99
|
+
}
|
|
100
|
+
if (offsets[i + 1] === offsets[i])
|
|
101
|
+
throw new RangeError(`invalid input: simplex ${i} is empty`);
|
|
102
|
+
}
|
|
103
|
+
const out = [];
|
|
104
|
+
for (let i = 0; i < filtrations.length; i++) {
|
|
105
|
+
const simplex = [];
|
|
106
|
+
for (let j = offsets[i]; j < offsets[i + 1]; j++)
|
|
107
|
+
simplex.push(vertices[j]);
|
|
108
|
+
out.push({ vertices: simplex, filtration: filtrations[i] });
|
|
109
|
+
}
|
|
110
|
+
return out;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A `{ vertices, filtration }[]` list as a {@link Complex} (same order of
|
|
114
|
+
* the simplices, each simplex's vertices sorted increasing), on `scale`
|
|
115
|
+
* (default `'value'`): the inverse of {@link materialize} on a complex, for
|
|
116
|
+
* handing object lists to the functions that take a complex. Vertex ids must
|
|
117
|
+
* be integers that fit 32 bits, distinct within a simplex, and values
|
|
118
|
+
* numbers; anything else is refused rather than truncated.
|
|
119
|
+
*/
|
|
120
|
+
export function flatten(simplices, scale = 'value') {
|
|
121
|
+
oneOf(scale, 'scale', ['edgeLength', 'radius', 'squaredRadius', 'squaredRelaxation', 'epsilon', 'growthRadius', 'value']);
|
|
122
|
+
if (!Array.isArray(simplices))
|
|
123
|
+
throw new TypeError(`simplices must be an array of { vertices, filtration }, got ${kind(simplices)}`);
|
|
124
|
+
const offsets = new Uint32Array(simplices.length + 1);
|
|
125
|
+
let total = 0;
|
|
126
|
+
for (let i = 0; i < simplices.length; i++) {
|
|
127
|
+
const s = simplices[i];
|
|
128
|
+
if (!s || !Array.isArray(s.vertices))
|
|
129
|
+
throw new TypeError(`simplices[${i}].vertices must be an array of vertex ids, got ${kind(s?.vertices)}`);
|
|
130
|
+
if (typeof s.filtration !== 'number')
|
|
131
|
+
throw new TypeError(`simplices[${i}].filtration must be a number, got ${kind(s.filtration)}`);
|
|
132
|
+
for (let j = 0; j < s.vertices.length; j++) {
|
|
133
|
+
const v = s.vertices[j];
|
|
134
|
+
if (typeof v !== 'number')
|
|
135
|
+
throw new TypeError(`simplices[${i}].vertices[${j}] must be a number, got ${kind(v)}`);
|
|
136
|
+
if (!Number.isInteger(v) || v < -2147483648 || v > 2147483647) {
|
|
137
|
+
throw new RangeError(`simplices[${i}].vertices[${j}] must be an integer from -2147483648 to 2147483647, got ${String(v)}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
total += s.vertices.length;
|
|
141
|
+
offsets[i + 1] = total;
|
|
142
|
+
}
|
|
143
|
+
const vertices = new Int32Array(total);
|
|
144
|
+
const filtrations = new Float64Array(simplices.length);
|
|
145
|
+
for (let i = 0; i < simplices.length; i++) {
|
|
146
|
+
const row = vertices.subarray(offsets[i], offsets[i + 1]);
|
|
147
|
+
row.set(simplices[i].vertices);
|
|
148
|
+
row.sort();
|
|
149
|
+
for (let j = 1; j < row.length; j++) {
|
|
150
|
+
if (row[j] === row[j - 1]) {
|
|
151
|
+
throw new RangeError(`simplices[${i}].vertices lists the vertex ${row[j]} twice; a simplex is a set of distinct vertices`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
filtrations[i] = simplices[i].filtration;
|
|
155
|
+
}
|
|
156
|
+
return { vertices, offsets, filtrations, scale };
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=flat.js.map
|
package/dist/flat.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat.js","sourceRoot":"","sources":["../src/flat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI/C;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAkC;IAC3D,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;QAC9E,MAAM,IAAI,SAAS,CAAC,sCAAsC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1E,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,mCAAmC,CAAC,CAAC;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C,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBAC1B,MAAM,IAAI,UAAU,CAAC,aAAa,CAAC,+BAA+B,GAAG,CAAC,CAAC,CAAC,iDAAiD,CAAC,CAAC;YAC7H,CAAC;QACH,CAAC;QACD,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAE,CAAC,UAAU,CAAC;IAC5C,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AACnD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@topolab/tda`: topolab TDA, topological data analysis in Rust compiled
|
|
3
|
+
* to WebAssembly. Call {@link load} once; the functions are then plain calls.
|
|
4
|
+
*
|
|
5
|
+
* Point clouds are `{ coords, d }` (row-major `Float64Array`, `d`
|
|
6
|
+
* coordinates per point; {@link pointCloud} converts rows), images and
|
|
7
|
+
* volumes `{ values, shape }` in NumPy's order. Complexes come back as typed
|
|
8
|
+
* arrays (`{ vertices, offsets, filtrations, scale }`) and diagrams as one
|
|
9
|
+
* `[birth, death, …]` array per homology dimension (`{ pairs, scale, coeff }`).
|
|
10
|
+
* Results are plain objects of typed arrays, numbers, strings and booleans,
|
|
11
|
+
* so they survive `postMessage` and `structuredClone` whole. A bad argument
|
|
12
|
+
* throws a `TypeError` (wrong type, or an option the function does not
|
|
13
|
+
* take) or a `RangeError` (out of range) whose message names the parameter;
|
|
14
|
+
* an input over a size limit throws a `RangeError`, and a failure inside an
|
|
15
|
+
* engine an `Error` with the engine's message.
|
|
16
|
+
*
|
|
17
|
+
* Functions are named for what they return: `xComplex` a filtered complex,
|
|
18
|
+
* `xPersistence` a persistence diagram, `diagramX` a distance between two
|
|
19
|
+
* diagrams; variants are options.
|
|
20
|
+
*
|
|
21
|
+
* @packageDocumentation
|
|
22
|
+
*/
|
|
23
|
+
export { load, unload, isLoaded, version } from './load.js';
|
|
24
|
+
export type { LoadSource } from './load.js';
|
|
25
|
+
export type { PointCloud, Vec } from './check.js';
|
|
26
|
+
export type { Complex, ComplexLike, CubicalComplex, Diagram, DistanceMatrix, Grid, BuilderPersistence, BuilderPersistenceOptions, Scale, Simplex } from './types.js';
|
|
27
|
+
export { ripsComplex, cechComplex, cechPersistence, delaunayCechComplex, alphaComplex, alphaPersistence, coupledAlphaComplex, witnessComplex, kFoldCoverComplex, kFoldCoverPersistence, ellipsoids, ellipsoidRipsComplex, ellipsoidRipsPersistence, ellipsoidCechComplex, ellipsoidCechPersistence, wings, wingComplex, wingPersistence, boxFiltration, boxFiltrationPersistence, cubicalComplex } from './complex.js';
|
|
28
|
+
export type { RipsComplexOptions, CechComplexOptions, CechPersistenceOptions, DelaunayCechComplexOptions, AlphaComplexOptions, AlphaPersistenceOptions, AlphaPersistence, Flattened, FlattenableComplex, CoupledAlphaComplexOptions, WitnessComplexOptions, KFoldCoverComplex, KFoldCoverComplexOptions, KFoldCoverDiagnostics, KFoldCoverPersistenceOptions, EllipsoidAxes, EllipsoidGeometry, EllipsoidOptions, EllipsoidRipsComplexOptions, EllipsoidRipsPersistenceOptions, EllipsoidCechComplexOptions, EllipsoidCechPersistenceOptions, WingGeometry, WingNormalSource, WingOptions, WingComplexOptions, WingPersistenceOptions, BoxExtent, BoxFiltration, BoxFiltrationDiagnostics, BoxFiltrationOptions, BoxFiltrationPersistenceOptions } from './complex.js';
|
|
29
|
+
export { functionRipsPresentation, degreeRipsPresentation, bifiltrationPresentation, bigradedBetti, fiberedBarcode, coarsenPresentation, firepPresentation } from './two_parameter.js';
|
|
30
|
+
export { parseRivetInput, rivetPresentation } from './rivet_input.js';
|
|
31
|
+
export type { RivetInput, RivetPresentationOptions } from './rivet_input.js';
|
|
32
|
+
export type { Presentation, FunctionRipsPresentationOptions, DegreeRipsPresentationOptions, Bifiltration, BifiltrationPresentationOptions, BigradedBetti, SliceLine, FiberedBarcode, CoarsenPresentationOptions, Firep, FirepMatrix, FirepPresentationOptions } from './two_parameter.js';
|
|
33
|
+
export { persistence, ripsPersistence, cubicalPersistence, zigzagPersistence, insertOp, removeOp, volumeOptimalCycles } from './persistence.js';
|
|
34
|
+
export type { PersistenceOptions, RipsPersistence, RipsPersistenceOptions, RipsRepresentatives, RepresentativesOptions, CubicalPersistenceOptions, InsertOp, RemoveOp, ZigzagOp, PackedZigzag, ZigzagPersistence, ZigzagPersistenceOptions, VolumeOptimalCycles, VolumeOptimalCyclesOptions } from './persistence.js';
|
|
35
|
+
export { cubicalVineyard, ripsVineyard, vineyard } from './vineyard.js';
|
|
36
|
+
export type { CubicalVineyard, RipsVineyard, RipsVineyardOptions, Vineyard, VineyardOptions, VineyardRepresentatives, VineyardRepresentativesOptions } from './vineyard.js';
|
|
37
|
+
export { bettiNumbers, bettiCurve, persistenceLandscape, persistenceImage, diagramWasserstein, diagramBottleneck } from './diagram.js';
|
|
38
|
+
export type { PersistenceLandscapeOptions, ImageBounds, PersistenceImage, PersistenceImageOptions, DiagramWassersteinOptions, DiagramMatching } from './diagram.js';
|
|
39
|
+
export { pointCloud, materialize, flatten } from './flat.js';
|
|
40
|
+
export type { RipsRepresentative, VolumeOptimalCycle } from './flat.js';
|
|
41
|
+
export type { CapacityError, CapacityDetails } from './memory.js';
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,YAAY,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 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@topolab/tda`: topolab TDA, topological data analysis in Rust compiled
|
|
3
|
+
* to WebAssembly. Call {@link load} once; the functions are then plain calls.
|
|
4
|
+
*
|
|
5
|
+
* Point clouds are `{ coords, d }` (row-major `Float64Array`, `d`
|
|
6
|
+
* coordinates per point; {@link pointCloud} converts rows), images and
|
|
7
|
+
* volumes `{ values, shape }` in NumPy's order. Complexes come back as typed
|
|
8
|
+
* arrays (`{ vertices, offsets, filtrations, scale }`) and diagrams as one
|
|
9
|
+
* `[birth, death, …]` array per homology dimension (`{ pairs, scale, coeff }`).
|
|
10
|
+
* Results are plain objects of typed arrays, numbers, strings and booleans,
|
|
11
|
+
* so they survive `postMessage` and `structuredClone` whole. A bad argument
|
|
12
|
+
* throws a `TypeError` (wrong type, or an option the function does not
|
|
13
|
+
* take) or a `RangeError` (out of range) whose message names the parameter;
|
|
14
|
+
* an input over a size limit throws a `RangeError`, and a failure inside an
|
|
15
|
+
* engine an `Error` with the engine's message.
|
|
16
|
+
*
|
|
17
|
+
* Functions are named for what they return: `xComplex` a filtered complex,
|
|
18
|
+
* `xPersistence` a persistence diagram, `diagramX` a distance between two
|
|
19
|
+
* diagrams; variants are options.
|
|
20
|
+
*
|
|
21
|
+
* @packageDocumentation
|
|
22
|
+
*/
|
|
23
|
+
export { load, unload, isLoaded, version } from './load.js';
|
|
24
|
+
export { ripsComplex, cechComplex, cechPersistence, delaunayCechComplex, alphaComplex, alphaPersistence, coupledAlphaComplex, witnessComplex, kFoldCoverComplex, kFoldCoverPersistence, ellipsoids, ellipsoidRipsComplex, ellipsoidRipsPersistence, ellipsoidCechComplex, ellipsoidCechPersistence, wings, wingComplex, wingPersistence, boxFiltration, boxFiltrationPersistence, cubicalComplex } from './complex.js';
|
|
25
|
+
export { functionRipsPresentation, degreeRipsPresentation, bifiltrationPresentation, bigradedBetti, fiberedBarcode, coarsenPresentation, firepPresentation } from './two_parameter.js';
|
|
26
|
+
export { parseRivetInput, rivetPresentation } from './rivet_input.js';
|
|
27
|
+
export { persistence, ripsPersistence, cubicalPersistence, zigzagPersistence, insertOp, removeOp, volumeOptimalCycles } from './persistence.js';
|
|
28
|
+
export { cubicalVineyard, ripsVineyard, vineyard } from './vineyard.js';
|
|
29
|
+
export { bettiNumbers, bettiCurve, persistenceLandscape, persistenceImage, diagramWasserstein, diagramBottleneck } from './diagram.js';
|
|
30
|
+
export { pointCloud, materialize, flatten } from './flat.js';
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgB5D,OAAO,EACL,WAAW,EACX,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,KAAK,EACL,WAAW,EACX,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,cAAc,EACf,MAAM,cAAc,CAAC;AAoCtB,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAiBtE,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAkB1B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAWxE,OAAO,EACL,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The source-sink interval approximation of `H_q` of a ladder filtration.
|
|
6
|
+
*/
|
|
7
|
+
export class Approximation {
|
|
8
|
+
private constructor();
|
|
9
|
+
free(): void;
|
|
10
|
+
[Symbol.dispose](): void;
|
|
11
|
+
/**
|
|
12
|
+
* `c^ξss(I)` per interval.
|
|
13
|
+
*/
|
|
14
|
+
readonly compressed: Uint32Array;
|
|
15
|
+
/**
|
|
16
|
+
* `δ̃(I)` per interval (Definition 4.5).
|
|
17
|
+
*/
|
|
18
|
+
readonly deltaTilde: Int32Array;
|
|
19
|
+
/**
|
|
20
|
+
* `δ(I)` per interval (may be negative).
|
|
21
|
+
*/
|
|
22
|
+
readonly delta: Int32Array;
|
|
23
|
+
/**
|
|
24
|
+
* 4 per interval of CL(n): `b2, d2, b1, d1`, ends inclusive, `0, 0` for
|
|
25
|
+
* a row the interval does not meet. Order: `[b,d]_1`, `[b,d]_2`, then
|
|
26
|
+
* `[b2,d2]_2 ⊔ [b1,d1]_1`, each lexicographic.
|
|
27
|
+
*/
|
|
28
|
+
readonly intervals: Uint32Array;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The CL(4) catalogue the decomposition is expressed in.
|
|
33
|
+
*/
|
|
34
|
+
export class Cl4Catalogue {
|
|
35
|
+
private constructor();
|
|
36
|
+
free(): void;
|
|
37
|
+
[Symbol.dispose](): void;
|
|
38
|
+
/**
|
|
39
|
+
* Course ids, newline-separated (`c01` … `c76`).
|
|
40
|
+
*/
|
|
41
|
+
readonly courseIds: string;
|
|
42
|
+
readonly courseLabels: Uint32Array;
|
|
43
|
+
/**
|
|
44
|
+
* Course `i` has labels `courseLabels[2·courseOffsets[i] ..
|
|
45
|
+
* 2·courseOffsets[i+1]]` as `column, row` pairs.
|
|
46
|
+
*/
|
|
47
|
+
readonly courseOffsets: Uint32Array;
|
|
48
|
+
/**
|
|
49
|
+
* Course remarks of the record, newline-separated.
|
|
50
|
+
*/
|
|
51
|
+
readonly courseRemarks: string;
|
|
52
|
+
/**
|
|
53
|
+
* 8 per indecomposable, index `(row − 1)·4 + column − 1`.
|
|
54
|
+
*/
|
|
55
|
+
readonly dimensionVectors: Uint32Array;
|
|
56
|
+
/**
|
|
57
|
+
* Names of the 76 indecomposables, newline-separated.
|
|
58
|
+
*/
|
|
59
|
+
readonly names: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Exact decomposition of `H_q` of a ladder filtration on CL(n), `n ≤ 4`,
|
|
64
|
+
* indexed as on CL(4).
|
|
65
|
+
*/
|
|
66
|
+
export class Cl4Decomposition {
|
|
67
|
+
private constructor();
|
|
68
|
+
free(): void;
|
|
69
|
+
[Symbol.dispose](): void;
|
|
70
|
+
/**
|
|
71
|
+
* The 76 course ranks, in the order of `cl4_courses.json`.
|
|
72
|
+
*/
|
|
73
|
+
readonly courseRanks: Uint32Array;
|
|
74
|
+
/**
|
|
75
|
+
* The 76 multiplicities: 55 intervals, then N1 … N21.
|
|
76
|
+
*/
|
|
77
|
+
readonly multiplicities: Uint32Array;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The indecomposables of CL(n), `n ≤ 4`, as extensions by zero into CL(4).
|
|
82
|
+
*/
|
|
83
|
+
export class ClnCatalogue {
|
|
84
|
+
private constructor();
|
|
85
|
+
free(): void;
|
|
86
|
+
[Symbol.dispose](): void;
|
|
87
|
+
/**
|
|
88
|
+
* Index of each among the 76 CL(4) indecomposables.
|
|
89
|
+
*/
|
|
90
|
+
readonly cl4Indices: Uint32Array;
|
|
91
|
+
/**
|
|
92
|
+
* `2n` per indecomposable, index `(row − 1)·n + column − 1`.
|
|
93
|
+
*/
|
|
94
|
+
readonly dimensionVectors: Uint32Array;
|
|
95
|
+
/**
|
|
96
|
+
* CL(n) names, newline-separated: intervals in CL(n) columns; for
|
|
97
|
+
* n < 4 a non-interval is `N[upper row/lower row]` by its dimensions.
|
|
98
|
+
*/
|
|
99
|
+
readonly names: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* A ladder filtration in flat form.
|
|
104
|
+
*/
|
|
105
|
+
export class FlatFiltration {
|
|
106
|
+
private constructor();
|
|
107
|
+
free(): void;
|
|
108
|
+
[Symbol.dispose](): void;
|
|
109
|
+
readonly lower: Uint32Array;
|
|
110
|
+
readonly n: number;
|
|
111
|
+
readonly offsets: Uint32Array;
|
|
112
|
+
readonly upper: Uint32Array;
|
|
113
|
+
readonly vertices: Uint32Array;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function cl4Catalogue(): Cl4Catalogue;
|
|
117
|
+
|
|
118
|
+
export function clnCatalogue(n: number): ClnCatalogue;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The course function (4.1) of `H_q` along an alternating zigzag course
|
|
122
|
+
* given as `column, row` pairs.
|
|
123
|
+
*/
|
|
124
|
+
export function courseRank(n: number, offsets: Uint32Array, vertices: Uint32Array, lower: Uint32Array, upper: Uint32Array, labels: Uint32Array, q: number, p: number): number;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Exact decomposition of `H_q` of a ladder filtration on CL(n), `n ≤ 4`
|
|
128
|
+
* (CL(1)…CL(3) are extended by zero into CL(4)). Indexed as on CL(4); see
|
|
129
|
+
* `clnCatalogue(n)` for the CL(n) names.
|
|
130
|
+
*/
|
|
131
|
+
export function decomposeCL4(n: number, offsets: Uint32Array, vertices: Uint32Array, lower: Uint32Array, upper: Uint32Array, q: number, p: number): Cl4Decomposition;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Interval approximation of `H_q` over GF(p) of the ladder filtration
|
|
135
|
+
* `(offsets, vertices, lower, upper)` on CL(n).
|
|
136
|
+
*/
|
|
137
|
+
export function intervalApproximation(n: number, offsets: Uint32Array, vertices: Uint32Array, lower: Uint32Array, upper: Uint32Array, q: number, p: number): Approximation;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The Rips thinning ladder: upper row the Rips filtration of `points`
|
|
141
|
+
* (`count × dim`), lower row that of the points with `inLower[i] ≠ 0`, at
|
|
142
|
+
* the strictly increasing edge lengths `thresholds` (the API's `edgeLengths`), simplices up to `max_dim` (`maxSimplexDim`).
|
|
143
|
+
*/
|
|
144
|
+
export function ripsThinningLadder(points: Float64Array, dim: number, in_lower: Uint8Array, thresholds: Float64Array, max_dim: number): FlatFiltration;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Crate version.
|
|
148
|
+
*/
|
|
149
|
+
export function version(): string;
|
|
150
|
+
|
|
151
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
152
|
+
|
|
153
|
+
export interface InitOutput {
|
|
154
|
+
readonly memory: WebAssembly.Memory;
|
|
155
|
+
readonly __capacity_record: () => number;
|
|
156
|
+
readonly __oom_record: () => number;
|
|
157
|
+
readonly __wbg_approximation_free: (a: number, b: number) => void;
|
|
158
|
+
readonly __wbg_cl4catalogue_free: (a: number, b: number) => void;
|
|
159
|
+
readonly __wbg_cl4decomposition_free: (a: number, b: number) => void;
|
|
160
|
+
readonly __wbg_clncatalogue_free: (a: number, b: number) => void;
|
|
161
|
+
readonly __wbg_flatfiltration_free: (a: number, b: number) => void;
|
|
162
|
+
readonly approximation_compressed: (a: number) => [number, number];
|
|
163
|
+
readonly approximation_delta: (a: number) => [number, number];
|
|
164
|
+
readonly approximation_deltaTilde: (a: number) => [number, number];
|
|
165
|
+
readonly approximation_intervals: (a: number) => [number, number];
|
|
166
|
+
readonly cl4Catalogue: () => number;
|
|
167
|
+
readonly cl4catalogue_courseIds: (a: number) => [number, number];
|
|
168
|
+
readonly cl4catalogue_courseLabels: (a: number) => [number, number];
|
|
169
|
+
readonly cl4catalogue_courseOffsets: (a: number) => [number, number];
|
|
170
|
+
readonly cl4catalogue_courseRemarks: (a: number) => [number, number];
|
|
171
|
+
readonly cl4catalogue_dimensionVectors: (a: number) => [number, number];
|
|
172
|
+
readonly cl4catalogue_names: (a: number) => [number, number];
|
|
173
|
+
readonly cl4decomposition_courseRanks: (a: number) => [number, number];
|
|
174
|
+
readonly cl4decomposition_multiplicities: (a: number) => [number, number];
|
|
175
|
+
readonly clnCatalogue: (a: number) => [number, number, number];
|
|
176
|
+
readonly clncatalogue_cl4Indices: (a: number) => [number, number];
|
|
177
|
+
readonly clncatalogue_dimensionVectors: (a: number) => [number, number];
|
|
178
|
+
readonly clncatalogue_names: (a: number) => [number, number];
|
|
179
|
+
readonly 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];
|
|
180
|
+
readonly 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];
|
|
181
|
+
readonly flatfiltration_lower: (a: number) => [number, number];
|
|
182
|
+
readonly flatfiltration_n: (a: number) => number;
|
|
183
|
+
readonly flatfiltration_offsets: (a: number) => [number, number];
|
|
184
|
+
readonly flatfiltration_upper: (a: number) => [number, number];
|
|
185
|
+
readonly flatfiltration_vertices: (a: number) => [number, number];
|
|
186
|
+
readonly 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];
|
|
187
|
+
readonly oom_reserve: (a: number, b: number) => number;
|
|
188
|
+
readonly ripsThinningLadder: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
189
|
+
readonly version: () => [number, number];
|
|
190
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
191
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
192
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
193
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
194
|
+
readonly __wbindgen_start: () => void;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
201
|
+
* a precompiled `WebAssembly.Module`.
|
|
202
|
+
*
|
|
203
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
204
|
+
*
|
|
205
|
+
* @returns {InitOutput}
|
|
206
|
+
*/
|
|
207
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
211
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
212
|
+
*
|
|
213
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
214
|
+
*
|
|
215
|
+
* @returns {Promise<InitOutput>}
|
|
216
|
+
*/
|
|
217
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
218
|
+
|
|
219
|
+
/** Forget the instance (`unload()` of @topolab/tda/ladder). */
|
|
220
|
+
export function __ladder_unload(): void;
|
|
221
|
+
|
|
222
|
+
export function __oom_on_recover(callback: (memory: WebAssembly.Memory) => void): void;
|
|
223
|
+
export function __oom_status(): {memory: WebAssembly.Memory; epoch: number; limitBytes: number};
|