@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,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"date": "2026-11-28T05:16:56Z",
|
|
3
|
+
"engine": "wasm-bindgen",
|
|
4
|
+
"rust": "rustc 1.98.1 (48a229cea 2026-09-01)",
|
|
5
|
+
"wasm_bindgen": "0.2.129",
|
|
6
|
+
"wasm_opt": "wasm-opt version 132",
|
|
7
|
+
"raw_bytes": 2053316,
|
|
8
|
+
"f64x2_lane_reads_rewritten": 573,
|
|
9
|
+
"bytes": 1778635,
|
|
10
|
+
"glue_bytes": 88676,
|
|
11
|
+
"sources": "the Rust crates tda-core, ot-diagram and musl-math, through tda-wasm"
|
|
12
|
+
}
|
package/dist/check.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Argument checks shared by the API (internal). A value of the wrong type is
|
|
3
|
+
* a `TypeError`, a value out of range a `RangeError`; both messages name the
|
|
4
|
+
* parameter as the caller wrote it (`maxEdgeLength`, `points.d`). Typed
|
|
5
|
+
* arrays are recognised by their kind, not by `instanceof`, so arrays made
|
|
6
|
+
* in another realm (an iframe, a `vm` context, a test runner's sandbox) are
|
|
7
|
+
* accepted.
|
|
8
|
+
*/
|
|
9
|
+
/** Weights, matrices and values: a `Float64Array`, or an array of numbers (converted). */
|
|
10
|
+
export type Vec = Float64Array | number[];
|
|
11
|
+
/** The kinds of typed array the API reads. */
|
|
12
|
+
type TypedArrayName = 'Float64Array' | 'Float32Array' | 'Int32Array' | 'Uint32Array' | 'Uint8Array';
|
|
13
|
+
interface TypedArrays {
|
|
14
|
+
Float64Array: Float64Array;
|
|
15
|
+
Float32Array: Float32Array;
|
|
16
|
+
Int32Array: Int32Array;
|
|
17
|
+
Uint32Array: Uint32Array;
|
|
18
|
+
Uint8Array: Uint8Array;
|
|
19
|
+
}
|
|
20
|
+
/** The kind of a typed array or `DataView` (`'Float64Array'`, …), from any realm; `undefined` for anything else. */
|
|
21
|
+
export declare function viewKind(v: unknown): string | undefined;
|
|
22
|
+
/** Whether `v` is a typed array of kind `name`, from this realm or another. */
|
|
23
|
+
export declare function isTyped<K extends TypedArrayName>(v: unknown, name: K): v is TypedArrays[K];
|
|
24
|
+
/** How a wrong value is described in a message. */
|
|
25
|
+
export declare function kind(v: unknown): string;
|
|
26
|
+
/**
|
|
27
|
+
* A `Float64Array` as it is, an array of numbers converted; an entry that is
|
|
28
|
+
* not a number (a string, `null`, `undefined`, a boolean, a hole) is a
|
|
29
|
+
* `TypeError` naming its index, and anything else is a `TypeError`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function f64(v: unknown, name: string): Float64Array;
|
|
32
|
+
/**
|
|
33
|
+
* Every key of an options type, for {@link options}: listing them as an
|
|
34
|
+
* object of this type makes the compiler check that none is missing or
|
|
35
|
+
* extra.
|
|
36
|
+
*/
|
|
37
|
+
export type Keys<T> = {
|
|
38
|
+
readonly [K in keyof T]-?: true;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* An options object (`undefined` reads as `{}`) of function `fn`: every own
|
|
42
|
+
* key must be one of `known` (a key set to `undefined` is allowed), or the
|
|
43
|
+
* call is refused with a `TypeError` naming the function and the key. `name`
|
|
44
|
+
* is the parameter's name in messages, and `prefix` what goes before a key in
|
|
45
|
+
* them (`'representatives.'` for an options object nested in another).
|
|
46
|
+
*/
|
|
47
|
+
export declare function options<T extends object>(v: unknown, fn: string, known: Keys<T>, name?: string, prefix?: string, what?: string): Partial<T>;
|
|
48
|
+
/** A number (any value; ranges are checked where they are known). */
|
|
49
|
+
export declare function num(v: unknown, name: string): number;
|
|
50
|
+
/** Largest value of an integer control: the wasm boundary takes u32. */
|
|
51
|
+
export declare const U32_MAX = 4294967295;
|
|
52
|
+
/** An integer control in `[min, 2³² − 1]`: the wasm boundary would truncate a fraction and wrap anything else. */
|
|
53
|
+
export declare function u32(v: unknown, name: string, min: number, max?: number): number;
|
|
54
|
+
/** A boolean. */
|
|
55
|
+
export declare function bool(v: unknown, name: string): boolean;
|
|
56
|
+
/** One of `allowed`. */
|
|
57
|
+
export declare function oneOf<T extends string>(v: unknown, name: string, allowed: readonly T[]): T;
|
|
58
|
+
/** A point cloud: `n` points of `d` coordinates, row-major (`coords[i·d + c]`). */
|
|
59
|
+
export interface PointCloud {
|
|
60
|
+
/** The coordinates, point after point (length `n · d`). */
|
|
61
|
+
coords: Float64Array;
|
|
62
|
+
/** Coordinates per point (a positive integer). */
|
|
63
|
+
d: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A point cloud with at least one point; returns its number of points. When
|
|
67
|
+
* `coords` is given but is not a `Float64Array`, the message says so, and
|
|
68
|
+
* for a plain array names `pointCloud`, which builds a cloud from rows.
|
|
69
|
+
*/
|
|
70
|
+
export declare function cloud(v: unknown, name: string): number;
|
|
71
|
+
/** `length` must be `expected`. */
|
|
72
|
+
export declare function sized(length: number, expected: number, name: string, what: string): void;
|
|
73
|
+
/** A number that is not NaN. */
|
|
74
|
+
export declare function notNaN(v: unknown, name: string): number;
|
|
75
|
+
/** A positive number or `Infinity` (a cutoff). */
|
|
76
|
+
export declare function positive(v: unknown, name: string): number;
|
|
77
|
+
/** A non-negative number or `Infinity` (a cutoff that may be 0). */
|
|
78
|
+
export declare function nonNegative(v: unknown, name: string): number;
|
|
79
|
+
/** A finite number. */
|
|
80
|
+
export declare function finite(v: unknown, name: string): number;
|
|
81
|
+
/** Every entry of `values` finite, naming the first that is not. */
|
|
82
|
+
export declare function allFinite(values: ArrayLike<number>, name: string): void;
|
|
83
|
+
/** No entry of `values` NaN, naming the first that is. */
|
|
84
|
+
export declare function noNaN(values: ArrayLike<number>, name: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* The largest coefficient field: `2^31 - 1`, a prime. The engines are exact
|
|
87
|
+
* up to it: sums of two elements stay below `2^32`, products are taken in 64
|
|
88
|
+
* bits, inverses come from a table below `2^16` and from Fermat's
|
|
89
|
+
* `a^(p - 2)` above, and the field reaches the engines as a 32-bit `int`.
|
|
90
|
+
*/
|
|
91
|
+
export declare const MAX_COEFF = 2147483647;
|
|
92
|
+
/** A prime coefficient field `coeff` in `[2, MAX_COEFF]`, default 2. */
|
|
93
|
+
export declare function coeff(v: unknown): number;
|
|
94
|
+
/** The `minPersistence` option: a finite non-negative number, default 0. */
|
|
95
|
+
export declare function minPersistence(v: unknown): number;
|
|
96
|
+
/** The `flatTolerance` option: a finite non-negative number, or `undefined` (off). */
|
|
97
|
+
export declare function flatTolerance(v: unknown): number | undefined;
|
|
98
|
+
/** An integer in `[min, max]` (a count or a dimension; `max` at most `2^31 - 1`, the module's 32-bit `int` arguments). */
|
|
99
|
+
export declare function int(v: unknown, name: string, min: number, max?: number): number;
|
|
100
|
+
/**
|
|
101
|
+
* A point cloud (`cloud`) whose coordinates are finite, with `d` among
|
|
102
|
+
* `dims` when given and at least `min` points; returns its number of points.
|
|
103
|
+
* With `squaredDistances`, for the builders that compute distances from
|
|
104
|
+
* squared coordinate differences in double precision, no pair of points may
|
|
105
|
+
* have a squared distance that overflows (computed as those builders compute
|
|
106
|
+
* it), or the call is a `RangeError` that says to rescale.
|
|
107
|
+
*/
|
|
108
|
+
export declare function points(v: unknown, name: string, opts?: {
|
|
109
|
+
min?: number;
|
|
110
|
+
dims?: readonly number[];
|
|
111
|
+
squaredDistances?: boolean;
|
|
112
|
+
}): number;
|
|
113
|
+
/** An integer option with a default. */
|
|
114
|
+
export declare function intOption(v: unknown, name: string, fallback: number, min: number, max?: number): number;
|
|
115
|
+
/** A boolean option with a default. */
|
|
116
|
+
export declare function boolOption(v: unknown, name: string, fallback: boolean): boolean;
|
|
117
|
+
export {};
|
|
118
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,0FAA0F;AAC1F,MAAM,MAAM,GAAG,GAAG,YAAY,GAAG,MAAM,EAAE,CAAC;AAE1C,8CAA8C;AAC9C,KAAK,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC;AACpG,UAAU,WAAW;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,oHAAoH;AACpH,wBAAgB,QAAQ,CAAC,CAAC,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,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAOjD;AAED,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAO5D;AAED,0HAA0H;AAC1H,wBAAgB,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,SAAa,GAAG,MAAM,CAEnF;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,CAAC,EAAE,OAAO,EACV,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAChF,MAAM,CAYR;AAyCD,wCAAwC;AACxC,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvG;AAED,uCAAuC;AACvC,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAE/E"}
|
package/dist/check.js
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Argument checks shared by the API (internal). A value of the wrong type is
|
|
3
|
+
* a `TypeError`, a value out of range a `RangeError`; both messages name the
|
|
4
|
+
* parameter as the caller wrote it (`maxEdgeLength`, `points.d`). Typed
|
|
5
|
+
* arrays are recognised by their kind, not by `instanceof`, so arrays made
|
|
6
|
+
* in another realm (an iframe, a `vm` context, a test runner's sandbox) are
|
|
7
|
+
* accepted.
|
|
8
|
+
*/
|
|
9
|
+
/** The kind of a typed array or `DataView` (`'Float64Array'`, …), from any realm; `undefined` for anything else. */
|
|
10
|
+
export function viewKind(v) {
|
|
11
|
+
if (!ArrayBuffer.isView(v))
|
|
12
|
+
return undefined;
|
|
13
|
+
// The tag of a typed array is read from its internal slot, so it is the
|
|
14
|
+
// same in every realm and cannot be forged by a plain object.
|
|
15
|
+
return Object.prototype.toString.call(v).slice(8, -1);
|
|
16
|
+
}
|
|
17
|
+
/** Whether `v` is a typed array of kind `name`, from this realm or another. */
|
|
18
|
+
export function isTyped(v, name) {
|
|
19
|
+
return viewKind(v) === name;
|
|
20
|
+
}
|
|
21
|
+
/** How a wrong value is described in a message. */
|
|
22
|
+
export function kind(v) {
|
|
23
|
+
if (v === null || v === undefined)
|
|
24
|
+
return String(v);
|
|
25
|
+
if (Array.isArray(v))
|
|
26
|
+
return 'an array';
|
|
27
|
+
const view = viewKind(v);
|
|
28
|
+
if (view !== undefined)
|
|
29
|
+
return `a ${view}`;
|
|
30
|
+
return typeof v === 'object' ? 'an object' : `${typeof v} ${String(v)}`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A `Float64Array` as it is, an array of numbers converted; an entry that is
|
|
34
|
+
* not a number (a string, `null`, `undefined`, a boolean, a hole) is a
|
|
35
|
+
* `TypeError` naming its index, and anything else is a `TypeError`.
|
|
36
|
+
*/
|
|
37
|
+
export function f64(v, name) {
|
|
38
|
+
if (isTyped(v, 'Float64Array'))
|
|
39
|
+
return v;
|
|
40
|
+
if (Array.isArray(v)) {
|
|
41
|
+
for (let i = 0; i < v.length; i++) {
|
|
42
|
+
if (typeof v[i] !== 'number')
|
|
43
|
+
throw new TypeError(`${name}[${i}] must be a number, got ${kind(v[i])}`);
|
|
44
|
+
}
|
|
45
|
+
return Float64Array.from(v);
|
|
46
|
+
}
|
|
47
|
+
throw new TypeError(`${name} must be a Float64Array or an array of numbers, got ${kind(v)}`);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The `TypeError` for an option `key` that `known` does not list: `fn: unknown
|
|
51
|
+
* option "key"`, with the known key it differs from only in case when there
|
|
52
|
+
* is one.
|
|
53
|
+
*/
|
|
54
|
+
function unknownKey(fn, key, known, prefix, what) {
|
|
55
|
+
const lower = key.toLowerCase();
|
|
56
|
+
const near = Object.keys(known).find((k) => k.toLowerCase() === lower);
|
|
57
|
+
const hint = near === undefined ? '' : ` (did you mean "${prefix}${near}"?)`;
|
|
58
|
+
return new TypeError(`${fn}: unknown ${what} "${prefix}${key}"${hint}`);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* An options object (`undefined` reads as `{}`) of function `fn`: every own
|
|
62
|
+
* key must be one of `known` (a key set to `undefined` is allowed), or the
|
|
63
|
+
* call is refused with a `TypeError` naming the function and the key. `name`
|
|
64
|
+
* is the parameter's name in messages, and `prefix` what goes before a key in
|
|
65
|
+
* them (`'representatives.'` for an options object nested in another).
|
|
66
|
+
*/
|
|
67
|
+
export function options(v, fn, known, name = 'opts', prefix = '', what = 'option') {
|
|
68
|
+
if (v === undefined)
|
|
69
|
+
return {};
|
|
70
|
+
if (v === null || typeof v !== 'object' || Array.isArray(v)) {
|
|
71
|
+
throw new TypeError(`${name} must be an object, got ${kind(v)}`);
|
|
72
|
+
}
|
|
73
|
+
for (const key of Object.keys(v)) {
|
|
74
|
+
if (!Object.prototype.hasOwnProperty.call(known, key))
|
|
75
|
+
throw unknownKey(fn, key, known, prefix, what);
|
|
76
|
+
}
|
|
77
|
+
return v;
|
|
78
|
+
}
|
|
79
|
+
/** A number (any value; ranges are checked where they are known). */
|
|
80
|
+
export function num(v, name) {
|
|
81
|
+
if (typeof v !== 'number')
|
|
82
|
+
throw new TypeError(`${name} must be a number, got ${kind(v)}`);
|
|
83
|
+
return v;
|
|
84
|
+
}
|
|
85
|
+
/** Largest value of an integer control: the wasm boundary takes u32. */
|
|
86
|
+
export const U32_MAX = 0xffffffff;
|
|
87
|
+
/** An integer control in `[min, 2³² − 1]`: the wasm boundary would truncate a fraction and wrap anything else. */
|
|
88
|
+
export function u32(v, name, min, max = U32_MAX) {
|
|
89
|
+
num(v, name);
|
|
90
|
+
if (!Number.isSafeInteger(v) || v < min || v > max)
|
|
91
|
+
throw new RangeError(`${name} must be an integer from ${min} to ${max}, got ${v}`);
|
|
92
|
+
return v;
|
|
93
|
+
}
|
|
94
|
+
/** A boolean. */
|
|
95
|
+
export function bool(v, name) {
|
|
96
|
+
if (typeof v !== 'boolean')
|
|
97
|
+
throw new TypeError(`${name} must be a boolean, got ${kind(v)}`);
|
|
98
|
+
return v;
|
|
99
|
+
}
|
|
100
|
+
/** One of `allowed`. */
|
|
101
|
+
export function oneOf(v, name, allowed) {
|
|
102
|
+
if (typeof v !== 'string')
|
|
103
|
+
throw new TypeError(`${name} must be a string, got ${kind(v)}`);
|
|
104
|
+
if (!allowed.includes(v)) {
|
|
105
|
+
throw new RangeError(`${name} must be ${allowed.map((a) => `"${a}"`).join(' or ')}, got "${v}"`);
|
|
106
|
+
}
|
|
107
|
+
return v;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A point cloud with at least one point; returns its number of points. When
|
|
111
|
+
* `coords` is given but is not a `Float64Array`, the message says so, and
|
|
112
|
+
* for a plain array names `pointCloud`, which builds a cloud from rows.
|
|
113
|
+
*/
|
|
114
|
+
export function cloud(v, name) {
|
|
115
|
+
if (v === null || typeof v !== 'object')
|
|
116
|
+
throw new TypeError(`${name} must be a point cloud { coords: Float64Array, d: number }, got ${kind(v)}`);
|
|
117
|
+
const given = v.coords;
|
|
118
|
+
if (!isTyped(given, 'Float64Array')) {
|
|
119
|
+
if (given === undefined)
|
|
120
|
+
throw new TypeError(`${name} must be a point cloud { coords: Float64Array, d: number }, got ${kind(v)}`);
|
|
121
|
+
const hint = Array.isArray(given) ? '; pointCloud(rows) builds a point cloud from one array of numbers per point' : '';
|
|
122
|
+
throw new TypeError(`${name}.coords must be a Float64Array, got ${kind(given)}${hint}`);
|
|
123
|
+
}
|
|
124
|
+
const { coords, d } = v;
|
|
125
|
+
u32(d, `${name}.d`, 1);
|
|
126
|
+
if (coords.length === 0 || coords.length % d !== 0)
|
|
127
|
+
throw new RangeError(`${name}.coords must hold a positive whole number of points of ${d} coordinates, got length ${coords.length}`);
|
|
128
|
+
return coords.length / d;
|
|
129
|
+
}
|
|
130
|
+
/** `length` must be `expected`. */
|
|
131
|
+
export function sized(length, expected, name, what) {
|
|
132
|
+
if (length !== expected)
|
|
133
|
+
throw new RangeError(`${name} must have ${what} (${expected}), got length ${length}`);
|
|
134
|
+
}
|
|
135
|
+
/** A number that is not NaN. */
|
|
136
|
+
export function notNaN(v, name) {
|
|
137
|
+
num(v, name);
|
|
138
|
+
if (Number.isNaN(v))
|
|
139
|
+
throw new RangeError(`${name} must not be NaN`);
|
|
140
|
+
return v;
|
|
141
|
+
}
|
|
142
|
+
/** A positive number or `Infinity` (a cutoff). */
|
|
143
|
+
export function positive(v, name) {
|
|
144
|
+
num(v, name);
|
|
145
|
+
if (!(v > 0))
|
|
146
|
+
throw new RangeError(`${name} must be positive, got ${v}`);
|
|
147
|
+
return v;
|
|
148
|
+
}
|
|
149
|
+
/** A non-negative number or `Infinity` (a cutoff that may be 0). */
|
|
150
|
+
export function nonNegative(v, name) {
|
|
151
|
+
num(v, name);
|
|
152
|
+
if (!(v >= 0))
|
|
153
|
+
throw new RangeError(`${name} must be non-negative, got ${v}`);
|
|
154
|
+
return v;
|
|
155
|
+
}
|
|
156
|
+
/** A finite number. */
|
|
157
|
+
export function finite(v, name) {
|
|
158
|
+
num(v, name);
|
|
159
|
+
if (!Number.isFinite(v))
|
|
160
|
+
throw new RangeError(`${name} must be finite, got ${v}`);
|
|
161
|
+
return v;
|
|
162
|
+
}
|
|
163
|
+
/** Every entry of `values` finite, naming the first that is not. */
|
|
164
|
+
export function allFinite(values, name) {
|
|
165
|
+
for (let i = 0; i < values.length; i++) {
|
|
166
|
+
if (!Number.isFinite(values[i]))
|
|
167
|
+
throw new RangeError(`${name}[${i}] must be finite, got ${values[i]}`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/** No entry of `values` NaN, naming the first that is. */
|
|
171
|
+
export function noNaN(values, name) {
|
|
172
|
+
for (let i = 0; i < values.length; i++) {
|
|
173
|
+
if (Number.isNaN(values[i]))
|
|
174
|
+
throw new RangeError(`${name}[${i}] must not be NaN`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* The largest coefficient field: `2^31 - 1`, a prime. The engines are exact
|
|
179
|
+
* up to it: sums of two elements stay below `2^32`, products are taken in 64
|
|
180
|
+
* bits, inverses come from a table below `2^16` and from Fermat's
|
|
181
|
+
* `a^(p - 2)` above, and the field reaches the engines as a 32-bit `int`.
|
|
182
|
+
*/
|
|
183
|
+
export const MAX_COEFF = 2147483647;
|
|
184
|
+
/** Trial division up to the square root (at most 46,340 divisions). */
|
|
185
|
+
function isPrime(n) {
|
|
186
|
+
if (n < 2)
|
|
187
|
+
return false;
|
|
188
|
+
if (n % 2 === 0)
|
|
189
|
+
return n === 2;
|
|
190
|
+
for (let d = 3; d * d <= n; d += 2)
|
|
191
|
+
if (n % d === 0)
|
|
192
|
+
return false;
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
/** A prime coefficient field `coeff` in `[2, MAX_COEFF]`, default 2. */
|
|
196
|
+
export function coeff(v) {
|
|
197
|
+
if (v === undefined)
|
|
198
|
+
return 2;
|
|
199
|
+
num(v, 'coeff');
|
|
200
|
+
if (!Number.isSafeInteger(v) || v < 2 || v > MAX_COEFF || !isPrime(v)) {
|
|
201
|
+
throw new RangeError(`coeff must be a prime from 2 to ${MAX_COEFF}, got ${v}`);
|
|
202
|
+
}
|
|
203
|
+
return v;
|
|
204
|
+
}
|
|
205
|
+
/** The `minPersistence` option: a finite non-negative number, default 0. */
|
|
206
|
+
export function minPersistence(v) {
|
|
207
|
+
if (v === undefined)
|
|
208
|
+
return 0;
|
|
209
|
+
num(v, 'minPersistence');
|
|
210
|
+
if (!Number.isFinite(v) || !(v >= 0)) {
|
|
211
|
+
throw new RangeError(`minPersistence must be a finite non-negative number, got ${v}`);
|
|
212
|
+
}
|
|
213
|
+
return v;
|
|
214
|
+
}
|
|
215
|
+
/** The `flatTolerance` option: a finite non-negative number, or `undefined` (off). */
|
|
216
|
+
export function flatTolerance(v) {
|
|
217
|
+
if (v === undefined)
|
|
218
|
+
return undefined;
|
|
219
|
+
num(v, 'flatTolerance');
|
|
220
|
+
if (!Number.isFinite(v) || !(v >= 0)) {
|
|
221
|
+
throw new RangeError(`flatTolerance must be a finite non-negative number, got ${v}`);
|
|
222
|
+
}
|
|
223
|
+
return v;
|
|
224
|
+
}
|
|
225
|
+
/** An integer in `[min, max]` (a count or a dimension; `max` at most `2^31 - 1`, the module's 32-bit `int` arguments). */
|
|
226
|
+
export function int(v, name, min, max = 0x7fffffff) {
|
|
227
|
+
return u32(v, name, min, max);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* A point cloud (`cloud`) whose coordinates are finite, with `d` among
|
|
231
|
+
* `dims` when given and at least `min` points; returns its number of points.
|
|
232
|
+
* With `squaredDistances`, for the builders that compute distances from
|
|
233
|
+
* squared coordinate differences in double precision, no pair of points may
|
|
234
|
+
* have a squared distance that overflows (computed as those builders compute
|
|
235
|
+
* it), or the call is a `RangeError` that says to rescale.
|
|
236
|
+
*/
|
|
237
|
+
export function points(v, name, opts = {}) {
|
|
238
|
+
const n = cloud(v, name);
|
|
239
|
+
const { coords, d } = v;
|
|
240
|
+
if (opts.dims !== undefined && !opts.dims.includes(d)) {
|
|
241
|
+
throw new RangeError(`${name}.d must be ${opts.dims.join(' or ')}, got ${d}`);
|
|
242
|
+
}
|
|
243
|
+
if (opts.min !== undefined && n < opts.min) {
|
|
244
|
+
throw new RangeError(`${name} must hold at least ${opts.min} points, got ${n}`);
|
|
245
|
+
}
|
|
246
|
+
allFinite(coords, `${name}.coords`);
|
|
247
|
+
if (opts.squaredDistances)
|
|
248
|
+
squaredDistances(coords, d, name);
|
|
249
|
+
return n;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Refuses a cloud with a pair of points whose squared distance overflows
|
|
253
|
+
* double precision, computed as the builders compute it: the squares of the
|
|
254
|
+
* coordinate differences added in coordinate order. Rounding is monotone, so
|
|
255
|
+
* every pair's sum is at most the same sum over the extents of the bounding
|
|
256
|
+
* box; only when that one overflows are the pairs themselves checked (in
|
|
257
|
+
* time quadratic in the number of points, as the builders' own distances).
|
|
258
|
+
*/
|
|
259
|
+
function squaredDistances(coords, d, name) {
|
|
260
|
+
let bound = 0;
|
|
261
|
+
for (let c = 0; c < d; c++) {
|
|
262
|
+
let lo = Infinity;
|
|
263
|
+
let hi = -Infinity;
|
|
264
|
+
for (let i = c; i < coords.length; i += d) {
|
|
265
|
+
const x = coords[i];
|
|
266
|
+
if (x < lo)
|
|
267
|
+
lo = x;
|
|
268
|
+
if (x > hi)
|
|
269
|
+
hi = x;
|
|
270
|
+
}
|
|
271
|
+
const extent = hi - lo;
|
|
272
|
+
bound += extent * extent;
|
|
273
|
+
}
|
|
274
|
+
if (bound !== Infinity)
|
|
275
|
+
return;
|
|
276
|
+
const n = coords.length / d;
|
|
277
|
+
for (let i = 0; i < n; i++) {
|
|
278
|
+
for (let j = i + 1; j < n; j++) {
|
|
279
|
+
let sum = 0;
|
|
280
|
+
for (let c = 0; c < d; c++) {
|
|
281
|
+
const diff = coords[i * d + c] - coords[j * d + c];
|
|
282
|
+
sum += diff * diff;
|
|
283
|
+
}
|
|
284
|
+
if (sum === Infinity) {
|
|
285
|
+
throw new RangeError(`${name}.coords: the squared distance between points ${i} and ${j} overflows double precision; rescale the points`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/** An integer option with a default. */
|
|
291
|
+
export function intOption(v, name, fallback, min, max) {
|
|
292
|
+
return v === undefined ? fallback : int(v, name, min, max);
|
|
293
|
+
}
|
|
294
|
+
/** A boolean option with a default. */
|
|
295
|
+
export function boolOption(v, name, fallback) {
|
|
296
|
+
return v === undefined ? fallback : bool(v, name);
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH,oHAAoH;AACpH,MAAM,UAAU,QAAQ,CAAC,CAAU;IACjC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7C,wEAAwE;IACxE,8DAA8D;IAC9D,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,OAAO,CAA2B,CAAU,EAAE,IAAO;IACnE,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,IAAI,CAAC,CAAU;IAC7B,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IACpD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,UAAU,CAAC;IACxC,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACzB,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,IAAI,EAAE,CAAC;IAC3C,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,CAAU,EAAE,IAAY;IAC1C,IAAI,OA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